ipinfo.app  ·  Successor to ip2asn.ipinfo.app

Atlas API

IP geolocation, ASN lookups, and BGP prefix resolution.
Base URL: https://atlas.ipinfo.app  ·  CORS enabled  ·  No auth required  ·  Data: iptoasn.com

Free No API key IPv4 + IPv6 Hostname resolution BGP prefix data
// API v2 — JSON responses
GET /api/v2/ip/:ip_or_hostname

Full geolocation and network lookup for an IPv4 address, IPv6 address, or resolvable hostname. Returns country, continent, ASN, organisation name, and — as of v0.1 — the most-specific announced BGP prefix covering the IP. Cached for 7 days.

Response fields
FieldTypeDescription
ipstringResolved IP address. May differ from input when a hostname is provided.
country_codestringISO 3166-1 alpha-2 code, e.g. "AU".
countrystringFull country name, e.g. "Australia".
country_flagstringUnicode flag emoji, e.g. "🇦🇺".
continentstringFull continent name, e.g. "Oceania".
as_numbernumberASN as an integer, e.g. 13335.
as_descriptionstringOrganisation name from the routing registry, e.g. "CLOUDFLARENET".
cidrnewstring|nullMost-specific announced BGP prefix containing this IP, e.g. "1.1.1.0/24". null when the ASN has no prefix entries in the database.
errornull|stringNull on success. Error message on failure.
Example requests
curl https://atlas.ipinfo.app/api/v2/ip/1.1.1.1 curl https://atlas.ipinfo.app/api/v2/ip/2606:4700::1111 curl https://atlas.ipinfo.app/api/v2/ip/cloudflare.com
Example response — 200 OK
{ "ip": "1.1.1.1", "country_code": "AU", "country": "Australia", "country_flag": "🇦🇺", "continent": "Oceania", "as_number": 13335, "as_description": "CLOUDFLARENET", "cidr": "1.1.1.0/24", "error": null }
Error response — 404 Not Found
{ "ip": "127.0.0.1", // private/reserved addresses are not in the database "country_code": null, "country": null, "country_flag": null, "continent": null, "as_number": null, "as_description": null, "cidr": null, "error": "IP address not found in database." }
GET /api/v2/asn/:as_number

Returns all CIDR prefixes announced by an ASN, annotated with country and continent data. Now also includes pre-computed announcement size stats so consumers don't need to iterate the full prefix list. :as_number accepts a bare integer or an AS-prefixed string (e.g. 13335 or AS13335). Cached for 24 hours.

Response fields
FieldTypeDescription
as_numbernumberThe ASN as an integer.
as_descriptionstringOrganisation name from the registry.
ipv4_countnewnumberTotal IPv4 host addresses across all announced prefixes (sum of 2^(32−prefixLen)).
ipv6_prefix_countnewnumberNumber of IPv6 prefix entries. IPv6 address space is too large to represent as a single sum.
cidrsobject[]Array of prefix objects.
cidrs[].cidrstringCIDR notation, e.g. "1.1.1.0/24".
cidrs[].country_codestringISO 3166-1 alpha-2 code for this prefix's allocation.
cidrs[].countrystringFull country name for this prefix.
cidrs[].continentstringFull continent name for this prefix.
errornull|stringNull on success.
Example requests
curl https://atlas.ipinfo.app/api/v2/asn/AS13335 curl https://atlas.ipinfo.app/api/v2/asn/13335
Example response — 200 OK
{ "as_number": 13335, "as_description": "CLOUDFLARENET", "ipv4_count": 1572864, // total IPv4 addresses announced "ipv6_prefix_count": 4, // number of IPv6 prefix entries "cidrs": [ { "cidr": "1.1.1.0/24", "country_code": "AU", "country": "Australia", "continent": "Oceania" } // ... more prefixes ], "error": null }
Error response — 404 Not Found
{ "as_number": 999999, "as_description": null, "ipv4_count": 0, "ipv6_prefix_count": 0, "cidrs": [], "error": "AS number not found or has no associated CIDRs in the database." }
GET /api/v2/hop/:ipnew

Traceroute hop annotation — returns the reverse-DNS record, the ASN details, and a best-effort "PoP" (point of presence) match derived from parsing the PTR against known carrier naming conventions (Hurricane Electric, Cogent, GTT, Zayo, Lumen/Level3, NTT). When no carrier pattern fits, a tier-2 "scatter" pass looks for 3-letter IATA hub codes and known city names anywhere in the hostname. Supports IPv4 and IPv6. Auto-generated IPv6 PTRs (e.g. residential Comcast nibble-hex labels) are detected and stripped before matching. Cached for 24 hours; rate-limited to 300 requests/minute per client IP.

Response fields
FieldTypeDescription
ipstringThe IP as supplied in the URL.
ip_version4 | 6 | nullAddress family. null only on 400 errors.
ptrstring|nullReverse-DNS hostname. null when no PTR is published or lookup timed out (2s).
asnobject|nullASN metadata (same shape as /api/v2/ip). null when the IP is not in the routing table.
asn.numbernumberAS number as integer.
asn.namestringOrganisation name from the registry.
asn.country_codestringISO 3166-1 alpha-2 country code.
popobject|nullMatched PoP annotation, or null when nothing matched.
pop.iatastringCanonical 3-letter IATA code for the PoP city.
pop.citystringCity name.
pop.countrystringISO alpha-2 country code.
pop.lat / pop.lonnumberAirport coordinates (proxy for PoP location).
pop.matchedstringOrigin of the match: carrier:<suffix> or scatter:<token>.
pop.confidence"high"|"medium"|"low"high = carrier pattern; medium = scatter hit whose country agrees with the ASN country; low = scatter hit only.
ptr_style"normal"|"auto"|"auto-prefix"|nullauto = PTR was auto-generated (no hint); auto-prefix = we stripped the auto label and still matched the suffix.
errornull|stringNull on success. Error message on 400 (invalid IP) or 429 (rate-limited).
Example requests
curl https://atlas.ipinfo.app/api/v2/hop/184.105.213.157 curl https://atlas.ipinfo.app/api/v2/hop/2001:470:0:68::2 curl https://atlas.ipinfo.app/api/v2/hop/154.54.30.173
Example response — 200 OK (carrier hit, high confidence)
{ "ip": "184.105.213.157", "ip_version": 4, "ptr": "100ge15-1.core1.lax1.he.net", "asn": { "number": 6939, "name": "HURRICANE", "country_code": "US", "country": "United States", "country_flag": "🇺🇸", "continent": "North America" }, "pop": { "iata": "LAX", "city": "Los Angeles", "country": "US", "lat": 33.9425, "lon": -118.408, "matched": "carrier:he.net", "confidence": "high" }, "ptr_style": "normal", "error": null }
Example response — 200 OK (no match)
{ "ip": "8.8.8.8", // google — generic PTR, no PoP hint "ip_version": 4, "ptr": "dns.google", "asn": { /* ... */ }, "pop": null, "ptr_style": "normal", "error": null }
Error response — 429 Too Many Requests
{ "ip": "...", "error": "Rate limit exceeded. Try again in 60 seconds." }
// API v1 — Plain text responses
GET /api/v1/country/:ip_or_hostname

Returns the full country name as a plain text string. Ideal for shell pipelines. Accepts IPv4, IPv6, or any resolvable hostname. Cached for 7 days.

Example
curl https://atlas.ipinfo.app/api/v1/country/1.1.1.1 Australia
GET /api/v1/asn/:ip_or_hostname

Returns the bare ASN number as plain text — no "AS" prefix.

Example
curl https://atlas.ipinfo.app/api/v1/asn/1.1.1.1 13335
GET /api/v1/continent/:ip_or_hostname

Returns the full continent name as plain text.

Example
curl https://atlas.ipinfo.app/api/v1/continent/1.1.1.1 Oceania
// Support This Project

Atlas is free and unmetered. If you're using it in something cool, consider supporting continued development.

♥ Donate