IP to ASN Database
The IP to ASN Database contains all known Autonomous Systems (AS) of the Internet. The database is continuously updated and new ASNs are added as soon as they are allocated.
The
IP to ASN database is mainly used to determine ASN meta data for every public IP address that is used in the
Internet. The most interesting fields are the org
, domain
and type
fields of the ASN database, since they give insights into the organization and help you to make better
traffic classification decisions.
IP to ASN Database
Demo for IP to ASN Database
Enter any IP address to obtain the ip to asn data associated with this IP address.
{
"message": "Please make an API request",
}
# Purchase Database
To purchase the database, you need to create a free account. Database subscriptions are billed monthly and can be canceled at any time. Learn more about the pricing and the terms. If you purchase the database, you will receive a download link to the database file for all formats.
# ASN Database Format
Each entry of the IP to ASN Database has the metadata listed below. If the ASN is
inactive, there is less metadata for the ASN. For example, inactive ASNs have no prefixes
or
prefixesIPv6
fields.
asn
- The fieldasn
is a unique identifier assigned to each autonomous system (AS) on the Internet. As of March 2024, there were over 81,000 active Autonomous System Numbers (ASNs) registered (ASN Statistics).descr
- The fielddescr
is a short informal descriptive name of the autonomous system (AS) in free format.country
- The ISO 3166-1 alpha-2 country code to which the AS belongs administratively. This is the country-specific location of the autonomous system (AS). This does not necessarily mean that all routes (IP addresses) assigned to this AS must originate from the same country.active
- The fieldactive
determines if the ASN is active or inactive. Active means that at least one route is assigned to the ASN. Put differently, this means that there is at least one entry in theprefixes
orprefixesIPv6
array.org
- The fieldorg
contains the organization that owns the ASN. It is crucial to understand that not every IP address assigned to an AS must belong to the organization contained inorg
. Put differently: The IP addresses included in theprefixes
orprefixesIPv6
array might be owned by a different organization than the one from the autonomous system (AS) itself.domain
- The fielddomain
is the domain of the organization's website that owns the ASN.abuse
- The fieldabuse
contains the abuse email address that can be used to direct abuse complaints to the owner of the ASN.type
- The fieldtype
contains the type of the ASN. The following ASN types exist:hosting
- The AS is owned by a hosting provider (Example: as396982)education
- The AS belongs to a university or other kind of educational institution (Example: AS1111)government
- The AS belongs to a governmental institution (Example: AS1701)banking
- The AS belongs to a banking/financial institution (Example: AS2134)isp
- The AS belongs to an Internet Service Provider (ISP) (Example: AS3222)business
- If the type is not one of the above, the type is the genericbusiness
type (Example: AS3271)
created
- The fieldcreated
specifies the date when this ASN was first registered.updated
- The fieldupdated
specifies the date when this ASN was last updated.rir
- The fieldrir
contains the Regional Internet Registry (RIR) responsible for this ASN.whois
- The fieldwhois
contains a URL pointing to the raw WHOIS record for this ASN.prefixes
- The fieldprefixes
contains all the IPv4 networks assigned to this ASN. This is a list of IPv4 networks in CIDR format.prefixesIPv6
- The fieldprefixesIPv6
contains all the IPv6 networks assigned to this ASN. This is a list of IPv6 networks in CIDR format.
The database contains key / value entries such as the following example for AS61018:
{
"asn": 61018,
"descr": "PVH-AS, NL",
"country": "nl",
"active": true,
"org": "PVH B.V.",
"domain": "www.pvh.com",
"abuse": "abuse@gtt.net",
"type": "business",
"created": "2013-03-13",
"updated": "2022-01-12",
"rir": "RIPE",
"whois": "https://api.ipapi.is/?whois=AS61018",
"prefixes": [
"64.250.22.0/24",
"64.250.23.0/24",
"185.19.103.0/24"
],
"elapsed_ms": 0.49
}
# How to use the ASN Database?
Download the ASN database sample in JSON format:
curl -O https://ipapi.is/data/samples/ASN-Database-Sample.json
And parse with NodeJS:
let asnDatabase = require('./ASN-Database-Sample.json');
for (const asn in asnDatabase) {
console.log(asn, asnDatabase[asn]);
}
In case of MMDB format, the usage looks as follows:
Download the ASN database sample in MMDB format and parse with mmdbctl:
# Download the Database
curl -O https://ipapi.is/data/asnSample.mmdb
# Read the Database
mmdbctl read -f json-pretty 1.6.191.77 asnSample.mmdb
This command produces the following output:
{
"active": "true",
"asn": "9583",
"country": "in",
"created": "",
"descr": "SIFY-AS-IN Sify Limited, IN",
"domain": "sifycorp.com",
"ipVersion": "4",
"network": "1.6.191.0-1.6.191.255",
"org": "Sify Limited",
"rir": "APNIC",
"route": "1.6.191.0/24",
"type": "isp",
"updated": "2013-04-07"
}
# What is an Autonomous System?
An Autonomous System is a collection of IPv4 and IPv6 networks (routes or prefixes) controlled by a single administrative entity such as a Internet Service Provider or other organization. This administrative entity defines a clear routing policy for its Autonomous System.
The Border Gateway Protocol (BGP) is the communication protocol used by autonomous systems. It is responsible for establishing the routing policies between autonomous systems and to provide reachability information. Put differently, the IPv4 and IPv6 protocol suites is the communication protocol between hosts in the Internet and the BGB is the protocol suite responsible for exchanging network reachability information with other BGP systems.
The current version of BGP is version Border Gateway Protocol 4 (BGP-4), which was published as RFC 4271 in 2006. BGP-4 also introduced the usage of the Classless Inter-Domain Routing (CIDR) notation and supernetworks, which reduced the size of routing tables considerably.
# What is an Autonomous System Number (ASN)?
An ASN is a 32 bit number that identifies Autonomous Systems uniquely. Before 2007, it used to be a 16 bit number, which allowed for a maximum of 65536 different AS numbers. Due to the ever growing Internet, IANA has begun to also assign 32-bit AS numbers to regional Internet registries. For example, one of the early ASN's is AS12 from New York University. Based on it's WHOIS record, AS12 was created already in July 15th 1984.
ASNumber: 12
ASName: NYU-DOMAIN
ASHandle: AS12
RegDate: 1984-07-05
Updated: 2011-10-10
Ref: https://rdap.arin.net/registry/autnum/12
OrgName: New York University
OrgId: NYU
Address: 726 Broadway, 8th Floor - ITS
City: New York
StateProv: NY
PostalCode: 10003
Country: US
RegDate: 1984-07-05
Updated: 2017-11-27
Ref: https://rdap.arin.net/registry/entity/NYU
The Internet is constantly growing. Therefore, new ASN's are created each day. For example, the following ASN's are all rather new:
However, the growth of the Internet is not as fast as it used to be in the 90s and early 2000s. Figure 1 below plots the number of unique ASN's announced on the Internet. It can be seen that the curve slope is decreasing starting from 2021.

Figure 2 shows the growth of the IPv4 routing table (APNIC Blog: BGP in 2022 - the routing table). The blog post mentions that the supply of IPv4 addresses has been progressively constrained since 2011 and that the available address pools of the various Regional Internet Registries (RIRs) have been exhausted. The APNIC authors conclude that there is no visible impact on the rate of growth of the number of announced prefixes in the global routing system since 2011. This can also be clearly seen in Figure 2.

# ASN Table
In the table below, you can inspect the first 10,000 active AS numbers. If
you
want to query any
autonomous system, use the API by specifying the ASN you want.
Example: https://api.ipapi.is?q=as4851