API Reference
Markdown

Caller IP lookup

Look up the connecting visitor’s public IPv4 or IPv6 address without an API key, with proxy-aware Cloudflare edge header resolution.

GEThttps://api.ipscope.io/v1/ip/mePublic · 120 req/min No key
GEThttps://api.ipscope.io/v1/public/ipAlias · 120 req/min No key

Returns the full IpLookupResponse for the client IP address that initiated the HTTP request. Both GET /v1/ip/me and GET /v1/public/ip are public, keyless endpoints designed for CLI diagnostics, health scripts, and interactive browser/edge tools.

# Code examples

curl -sS "https://api.ipscope.io/v1/ip/me"

# Responses

Responses
application/json

Full IPv4/IPv6 intelligence record for the connecting visitor IP.

{
  "ip": "198.51.100.7",
  "ip_version": 4,
  "matched_network": "198.51.100.0/24",
  "geo": {
    "country_code": "US",
    "declared_country_code": "US",
    "physical_country_code": "US",
    "is_virtual_location": false,
    "location_type": "physical",
    "confidence": 0.94,
    "subdivision": "Virginia",
    "city": "Ashburn",
    "postal_code": "20147",
    "latitude": 39.0438,
    "longitude": -77.4874,
    "accuracy_radius_km": 10,
    "timezone": "America/New_York"
  },
  "network": {
    "asn": 64501,
    "organization": "Example Cloud LLC"
  },
  "connection": {
    "connection_type": "hosting",
    "is_hosting": true,
    "is_residential": false,
    "is_mobile": false,
    "is_business": false
  },
  "security": {
    "is_vpn": true,
    "is_hosting": true,
    "is_tor_exit": false,
    "is_proxy": false,
    "anonymizer_type": "vpn",
    "confidence": 0.96,
    "reason_codes": [
      "vpn_handshake_confirmed",
      "datacenter_asn_range"
    ]
  },
  "security_extensions": {
    "abuse_velocity_score": 18,
    "is_known_scanner": false,
    "observation_recency_hours": 12,
    "anonymizer_reason": "vpn_handshake_confirmed",
    "threat_level": "medium",
    "abuse_velocity": "low",
    "confidence": 0.96
  },
  "dataset_version": "2026-10-27T00:00:00Z.crawl-1793088000000",
  "updated_at": "2026-10-27T00:00:00Z"
}

# Proxy-aware IP extraction & anti-spoofing

To prevent X-Forwarded-For header spoofing while supporting reverse-proxy and Cloudflare deployments, LookupController inspects the TRUST_PROXY environment configuration:

  • When TRUST_PROXY=true: The service extracts the visitor’s real public IP in priority order from cf-connecting-ip, the first hop of x-forwarded-for, or x-real-ip, falling back to the socket peer req.ip.
  • When TRUST_PROXY=false (default direct mode): Forwarded headers are ignored and only the verified TCP/QUIC socket address (req.ip) is used.
  • Cloudflare edge hint fallback: When behind Cloudflare (TRUST_PROXY=true), the service also reads cf-ipcountry, cf-ipcity, cf-region, and cf-ray as fallback hints if a newly allocated prefix has no city record in the local snapshot.