IP Address Lookup

Fast, secure, and modern IP address geolocation lookup service built with Cloudflare Workers. Provides comprehensive location data, ISP information, timezone detection, and more for IPv4, IPv6 addresses, and domain names via web interface and REST API.

Live Demo

https://ip.xi-xu.me

Features

  • Universal Support: Query IPv4, IPv6 addresses, and domain names
  • Comprehensive Data: Location, ISP, timezone, coordinates, reverse DNS, and more
  • Modern Web UI: Beautiful, responsive interface with real-time lookups
  • REST API: Simple JSON API for programmatic access
  • Edge Computing: Powered by Cloudflare Workers for global low-latency responses
  • Security Features: Input validation, CORS support, CSP headers
  • SEO Optimized: Complete with meta tags, structured data, sitemap, and robots.txt
  • Health Monitoring: Built-in health check endpoint for uptime monitoring

API Reference

Endpoints

GET /api/lookup

Look up geolocation data for an IP address or domain name.

Query Parameters:

  • ip (optional): IPv4, IPv6 address, or domain name to look up
    • If omitted or set to me, returns your own IP address information

Example Requests:

# Look up your own IP
curl https://ip.xi-xu.me/api/lookup

# Look up a specific IPv4 address
curl https://ip.xi-xu.me/api/lookup?ip=8.8.8.8

# Look up an IPv6 address
curl https://ip.xi-xu.me/api/lookup?ip=2001:4860:4860::8888

# Look up a domain name
curl https://ip.xi-xu.me/api/lookup?ip=example.com

Example Response:

{
  "status": "success",
  "continent": "North America",
  "continentCode": "NA",
  "country": "United States",
  "countryCode": "US",
  "region": "VA",
  "regionName": "Virginia",
  "city": "Ashburn",
  "district": "",
  "zip": "20149",
  "lat": 39.03,
  "lon": -77.5,
  "timezone": "America/New_York",
  "offset": -18000,
  "currency": "USD",
  "isp": "Google LLC",
  "org": "Google Public DNS",
  "as": "AS15169 Google LLC",
  "asname": "GOOGLE",
  "reverse": "dns.google",
  "mobile": false,
  "proxy": false,
  "hosting": true,
  "query": "8.8.8.8"
}

Error Response:

{
  "status": "fail",
  "message": "Invalid format. Please enter a valid IPv4, IPv6 address, or domain name."
}

GET /health

Health check endpoint for monitoring service availability.

Example Request:

curl https://ip.xi-xu.me/health

Example Response:

{
  "status": "healthy",
  "service": "ip-address-lookup",
  "timestamp": "2025-01-15T10:30:00.000Z"
}

Rate Limits

This service uses IP-API.com for geolocation data, which has the following limits for non-commercial use:

  • 45 requests per minute from the same IP address
  • Requests are cached for 5 minutes to reduce rate limit hits

If you exceed the rate limit, you'll receive a 429 Too Many Requests response.

Features in Detail

Security

  • Input validation using strict regex patterns for IPv4, IPv6, and domain names
  • Content Security Policy (CSP) headers
  • CORS support for cross-origin requests
  • Protection against XSS and injection attacks
  • X-Content-Type-Options and X-Frame-Options headers

Performance

  • Edge caching with 5-minute TTL for geolocation data
  • Smart placement mode for optimal routing
  • Minimal JavaScript footprint
  • Single-file architecture for fast cold starts
  • Pre-cached HTML page to avoid regeneration

SEO & Discoverability

  • Comprehensive meta tags (Open Graph, Twitter Cards)
  • Schema.org structured data (WebApplication)
  • Sitemap.xml for search engine indexing
  • Robots.txt with crawl directives
  • Semantic HTML with ARIA labels

User Experience

  • Automatic lookup of visitor's IP on page load
  • Responsive design for mobile and desktop
  • Dark theme optimized for readability
  • Loading states and error handling
  • Keyboard shortcuts (Escape to clear)
  • Accessibility features (ARIA labels, screen reader support)

License

Copyright (c) Xi Xu. All rights reserved.

This repository is licensed under the MIT License - see the LICENSE file for details.


Note: This service is provided for free and is suitable for non-commercial use. Please respect the rate limits and terms of service of the underlying IP-API.com service.

S
Description
Fast, secure, and modern IP address geolocation lookup service
Readme MIT
69 KiB
0 Stars 1 Watchers 0 Forks
Languages
JavaScript 100%