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." }
// 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