ipinfo.app/ API/ IP to ASN

ip2asn.ipinfo.app — API Reference

Base URL: https://ip2asn.ipinfo.app  |  CORS enabled  |  No auth required
Resolves any IPv4 or IPv6 address to its owning Autonomous System. Responses cached for 1 week (max-age=604800).

GET /api/v1/:ip

Resolves an IPv4 or IPv6 address to the ASN that announces it, returning the AS number and organisation name. Returns a 400 for invalid IPs and a 500 if the backend lookup fails.

Response fields
FieldTypeDescription
ipstringThe queried IP address as provided.
announcedByobject|falseObject with number (integer) and description (string), or false if no announcing ASN was found.
errornull|stringNull on success; error string on failure.
Example request
curl https://ip2asn.ipinfo.app/api/v1/1.1.1.1 curl https://ip2asn.ipinfo.app/api/v1/2606:4700::1111
Example response
{ "ip": "1.1.1.1", "announcedBy": { "number": 13335, "description": "CLOUDFLARENET" }, "error": null }
GET /api/v1/@me

Redirects (302) to /lookup/{client_ip} so the result is served from Cloudflare's cache for that specific IP. A convenient shortcut — you don't need to know your own IP before making the request. The redirect response itself is never cached.

Example request
curl -L https://ip2asn.ipinfo.app/api/v1/@me
GET /lookup/:ip

Alias for /api/v1/:ip. Identical response. Exists for backwards compatibility and is the canonical cached URL used by the /@me redirect.

Example request
curl https://ip2asn.ipinfo.app/lookup/8.8.8.8
GET /lookup/@me

Alias for /api/v1/@me. Redirects (302) to /lookup/{client_ip}.

Example request
curl -L https://ip2asn.ipinfo.app/lookup/@me