Skip to content
Log In Sign up

IP Info (free IP geolocation API)

IP Info is a free IP geolocation and ASN API maintained by Shifter. One GET request returns the country, region, city, coordinates, time zone, ISP, ASN and connection type of an IP address as JSON. There is no signup, no API key and no subscription.

It runs on the same IP location and network database that Shifter uses for its own proxy pools, so when you check a Shifter exit IP with IP Info you see the location the way our network sees it.

RequestReturns
GET http://ip-info.com/jsonThe IP that made the request (your server, or your proxy exit when sent through a proxy)
GET http://ip-info.com/json?ip=8.8.8.8A specific public IPv4 or IPv6 address
GET http://ip-info.com/8.8.8.8/jsonThe same lookup, path form

HTTPS (https://ip-info.com/json) works too, on the same routes. Plain HTTP is never redirected; use HTTPS when calling from a web page served over HTTPS, to avoid mixed-content blocking. Responses allow cross-origin GET, so browser code can call the API directly.

Terminal window
curl --max-time 10 "http://ip-info.com/json?ip=94.204.59.232"
{
"ip": "94.204.59.232",
"city": "Motor City",
"region": "Dubai",
"region_code": "DU",
"country": "AE",
"country_name": "United Arab Emirates",
"continent": "AS",
"loc": "25.0459,55.241",
"latitude": 25.0459,
"longitude": 55.241,
"postal": null,
"timezone": "Asia/Dubai",
"asn": 15802,
"as_name": "Emirates Integrated Telecommunications Company PJSC",
"isp": "Emirates Integrated Telecommunications Company PJSC",
"org": "Emirates Integrated Telecommunications Company",
"connection_type": "Corporate",
"user_type": "business",
"is_anycast": false
}

The live response has 29 fields; the example above shows the ones most integrations read. Every field is always present, and a value the database does not have comes back as null.

Send the no-argument request through your proxy. The IP Info response describes the exit IP, so you can confirm that the country, city or ASN you targeted is the one you got.

Terminal window
curl --max-time 15 \
--proxy http://p.shifter.io:443 \
--proxy-user "customer-USERNAME-country-us-city-new_york:PASSWORD" \
http://ip-info.com/json

Compare country (ISO 3166 two-letter code) with the country you requested and asn (a plain number, no AS prefix) with the network you targeted. See Geo-targeting for the username flags.

IP Info needs no authentication flow, so an agent can call it like any other HTTP endpoint. It publishes machine-readable descriptions that agents and tool builders can load directly:

No MCP server is required. If your framework takes function or tool definitions, this one is enough:

{
"name": "ip_lookup",
"description": "Approximate geolocation and network (ASN, ISP) for a public IP address. Omit ip to look up the agent's own network exit.",
"input_schema": {
"type": "object",
"properties": {
"ip": { "type": "string", "description": "Public IPv4 or IPv6 literal. Leave empty for the caller's exit IP." }
}
}
}

Implement it as GET http://ip-info.com/json when ip is empty and GET http://ip-info.com/json?ip=<URL-encoded ip> otherwise.

Give the agent these rules along with the tool:

  1. A call without ip describes the agent’s own server or proxy exit, not the human user. To look up a user’s IP, the agent must be given that IP explicitly.
  2. Use country for country comparisons and asn for network checks.
  3. Treat null as unknown. Never fill in a missing field.
  4. Location is approximate, and IP Info is not VPN or proxy detection.

Typical agent uses: confirming a browsing agent’s proxy is in the right country before it scrapes a localized page, tagging collected data with the exit location it was fetched from, and enriching log or signup IPs with country and ASN.

Errors come back as JSON with a stable code:

{ "error": { "code": "invalid_ip", "message": "Supply a literal IPv4 or IPv6 address." } }
StatusCodeMeaning
400invalid_ipMalformed, private, reserved or otherwise non-public input, or conflicting parameters
404ip_not_foundNo record for this IP in the active database
405method_not_allowedUse GET
503database_unavailableTemporary; retry with backoff
504timeoutTemporary; retry with backoff

Fix 4xx inputs before retrying. For 503, 504 and connection errors, retry with a short bounded backoff (for example 1, 2 and 4 seconds), then give up and report the failure.

  • Free, no quota. There is no per-key or per-app quota and no API key. It is a shared service with finite capacity: make the requests your application needs and follow the terms. Automated and commercial use is allowed.
  • Approximate by design. Coordinates point to an area, not an address, and never identify a person.
  • Not a proxy or VPN detector. connection_type, user_type and is_anycast are database classifications, not proof of how an IP is used.
  • Privacy. The API keeps no lookup history. See the privacy policy.

Questions or data discrepancies: email hi@shifter.io with the IP and the location you expected.