ipinfo.app/ API/ Atlas

Atlas — API Reference

Base URL: https://atlas.ipinfo.app  |  CORS enabled  |  No auth required
IP geolocation, ASN lookups, BGP prefix resolution. Data from iptoasn.com. v2 is recommended; v1 is a simple plain-text interface.

// API v2 — JSON
GET /api/v2/ip/:ip

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

Response fields
FieldTypeDescription
ipstringResolved IP address. May differ from input if a hostname was 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.
errornull|stringNull on success; error string otherwise.
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 }
GET /api/v2/asn/:as_number

Returns all CIDR prefixes announced by an ASN, each annotated with country and continent. Also returns pre-computed announcement size stats — total IPv4 host addresses and IPv6 prefix count. :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 announced (sum of 2^(32−prefixLen) per IPv4 prefix).
ipv6_prefix_countnewnumberNumber of IPv6 prefix entries. Address space is too large to represent as a single count.
cidrsobject[]Array of prefix objects (see below).
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 request
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, "ipv6_prefix_count": 4, "cidrs": [ { "cidr": "1.1.1.0/24", "country_code": "AU", "country": "Australia", "continent": "Oceania" } ... ], "error": null }
// API v1 — Plain text
GET /api/v1/country/:ip

Returns the full country name for an IP or hostname as plain text. Accepts IPv4, IPv6, and hostnames. Cached for 7 days. Ideal for shell pipelines.

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

Returns the bare ASN number for an IP or hostname as plain text. No "AS" prefix.

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

Returns the full continent name for an IP or hostname as plain text.

Example request
curl https://atlas.ipinfo.app/api/v1/continent/1.1.1.1 Oceania