Look up ASN, network, and geolocation data for an IP address via the ipinfo.io API
domain: ipinfo.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Get an API token from ipinfo.io and authenticate via query param (?token=<token>), HTTP Basic (-u <token>:), or a Bearer header.
For basic country/ASN lookups on the free Lite tier, call GET https://api.ipinfo.io/lite/<ip>?token=<token> (unlimited requests on this tier).
For full city/region/postal/lat-long geolocation plus ASN org/domain/type and network flags (is_anonymous, is_anycast, is_hosting, is_mobile, is_satellite), call the paid Core tier at GET https://api.ipinfo.io/lookup/<ip>?token=<token>.
Append a specific field name to the path (e.g. /lite/<ip>/country_code?token=<token>) to get a single plaintext value instead of the full JSON object, or use me in place of an IP to look up your own request's origin.
For ASN-only, no-auth lookups as a free fallback, use Team Cymru's DNS interface instead (a TXT query against <reversed-ip>.origin.asn.cymru.com) — but note Team Cymru explicitly disclaims its country-code field as a geolocation source.
Known gotchas
Abuse-contact data is gated to ipinfo's Enterprise tier only — it is not available on Lite, Core, or even Plus, so don't design a self-serve/low-cost integration around getting abuse contacts from ipinfo.
ipinfo.io splits its API across two hosts (https://ipinfo.io for legacy/Enterprise vs. https://api.ipinfo.io for Lite/Core/Plus/Max) — using the wrong host gives confusing auth and field differences.
Team Cymru's IP-to-ASN mapping is explicitly not a geolocation service by their own documentation — its country-code field can differ significantly from the IP's actual location; don't substitute it for a real geolocation query.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?