API: IP2ASN (free)ΒΆ

The IP2ASN API call retrieves ASN & Subnet info about an IP address (IPv4 and IPv6).

API request and parameters

https://freeapi.dnslytics.net/v1/ip2asn/<ip>

Parameter:

ip

IPv4 or IPv6 address, for example 8.8.8.8 or 2001:4860:4860::8888

API response

A JSON object with the following fields:

ip

Requested IP address.

announced

IP announced in global routing table (true or false).

cidr

Announced Prefix.

asn

AS Number.

shortname

AS Description.

country

AS Country Registration.

Examples

$ curl https://freeapi.dnslytics.net/v1/ip2asn/8.8.8.8
{
  "ip": "8.8.8.8",
  "announced": true,
  "cidr": "8.8.8.0/24",
  "asn": 15169,
  "shortname": "Google LLC",
  "country": "US"
}
$ curl https://freeapi.dnslytics.net/v1/ip2asn/192.168.1.1
{
  "ip": "192.168.1.1",
  "announced": false
}