IP to ASN Database
The IP to ASN Database contains every Autonomous System (AS) of the Internet: 83,158 active ASNs and 375,593 inactive ones, each with its organization, domain, type, country, abuse contact, registration dates and all IPv4 and IPv6 prefixes it announces. It maps every routed IP address to the AS that announces it, by combining live BGP routing data with the WHOIS data of all five Regional Internet Registries.
- The organization, website domain and abuse contact behind every ASN
- A type for every
organization:
hosting,isp,business,education,governmentorbanking - An abuse score per ASN, from the share of its address space reported for abuse
- 1,091,569 IPv4 and 256,391 IPv6 routes
- CSV and MMDB for IP lookups, JSON for ASN lookups with all prefixes
- Rebuilt every day
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.
{
"asn": 7018,
"abuser_score": "0 (Very Low)",
"descr": "ATT-INTERNET4 - AT&T Enterprises, LLC, US",
"country": "us",
"active": true,
"org": "AT&T Enterprises, LLC",
"domain": "att.com",
"abuse": "abuse@att.net",
"type": "isp",
"created": "1996-07-30",
"updated": "2025-03-18",
"rir": "ARIN"
}
Limited output — unauthenticated requests get 11 fields. Log in or sign up free and this box returns the complete API response.
# Use Cases
Traffic classification
The ASN type tells hosting networks from ISPs at a glance: traffic from a cloud ASN is usually a server, traffic from an ISP usually a person.
Risk scoring
Weigh logins, signups and payments by the type and abuse score of the network they come from.
Firewall rules
Block, rate-limit or allow whole networks with the complete list of prefixes of an ASN, for IPv4 and IPv6.
Abuse handling
Send abuse reports to the network that is responsible, with the abuse contact of every ASN.
Analytics
Group traffic, errors and latency by network and see which ISPs and clouds your users and attackers come from.
Routing research
Analyze the prefixes, registrations and growth of every AS, with all registries in a single dataset.
# Purchase Database
Create a free account, subscribe in your dashboard with a card or PayPal, and download the database right away, in every format it comes in. The subscription is billed monthly and can be canceled at any time. Updates are included: your personal download link always serves the latest release, so one scheduled command keeps your copy current. See pricing and the terms.
Need more than one database? The Business plan includes all seven databases ($563 per month if bought separately), the largest standard API plan and the right to run the API on your own servers, for $200 per month.
# ASN Database Format
The database comes in two shapes. The CSV and MMDB files have one record per announced IP range, for lookups by IP address. The JSON file has one record per ASN with all its prefixes, for lookups by ASN. The CSV file has these columns:
| Column | Description | Example |
|---|---|---|
startIp, endIp |
First and last IP address of the announced range | 1.0.0.0, 1.0.0.255 |
ipVersion |
4 for IPv4, 6 for IPv6 |
4 |
asn |
The Autonomous System Number that announces this range | 13335 |
abuser_score |
Abuse score of the ASN: the share of its address space reported for abuse, with a label from
Very Low to Very High |
0.001 (Low) |
route |
The announced prefix (CIDR) covering this range | 1.0.0.0/24 |
descr |
Description of the AS from WHOIS | CLOUDFLARENET - Cloudflare, Inc., US |
country |
ISO 3166-1 alpha-2 code of the country the AS is registered in. Its addresses can be used in other countries. | us |
active |
true if the ASN currently announces at least one prefix |
true |
org |
The organization the ASN is registered to | Cloudflare, Inc. |
domain |
The website domain of the organization | cloudflare.com |
abuse |
Email address for abuse complaints | abuse@cloudflare.com |
type |
Type of the organization, see below | hosting |
created, updated |
When the ASN was registered and when its record was last updated | 2010-07-14, 2017-02-17 |
rir |
The Regional Internet Registry responsible for the ASN | ARIN |
The type is one of:
hosting: a hosting, cloud or datacenter provider (example: AS396982, Google)isp: an Internet Service Provider (example: AS3320, Deutsche Telekom)education: a university or another educational institution (example: AS1111, University of Klagenfurt)government: a government institution (example: AS1701, NASA)banking: a bank or another financial institution (example: AS2134, Santander)business: any other organization (example: AS714, Apple)
In the JSON file, every ASN is a key with the same fields, plus prefixes and
prefixesIPv6, the lists of all IPv4 and IPv6 prefixes the ASN announces. Inactive ASNs have
no prefixes and often less metadata. This is the record of AS12:
{
"asn": "12",
"descr": "NYU-DOMAIN - New York University, US",
"abuser_score": "0 (Very Low)",
"country": "US",
"active": true,
"org": "New York University",
"domain": "nyu.edu",
"abuse": "abuse@nyu.edu",
"type": "education",
"created": "1984-07-05",
"updated": "2023-05-25",
"rir": "ARIN",
"prefixes": [
"128.122.0.0/16",
"128.238.0.0/16",
"192.76.177.0/24",
"192.86.139.0/24",
"216.165.0.0/18",
"216.165.64.0/19",
"216.165.88.0/24",
"216.165.89.0/24",
"216.165.96.0/20",
"216.165.102.0/24",
"216.165.103.0/24",
"216.165.112.0/21",
"216.165.120.0/22"
],
"prefixesIPv6": [
"2607:f600::/32"
]
}
# How to Use the ASN Database
Download the sample in JSON format:
curl -O https://ipapi.is/data/samples/ASN-Database-Sample.json
and read it with Node.js:
const asnDatabase = require('./ASN-Database-Sample.json');
for (const asn in asnDatabase) {
console.log(asn, asnDatabase[asn]);
}
To look up IP addresses, download the sample in MMDB format and read it with mmdbctl:
curl -O https://ipapi.is/data/samples/asnSample.mmdb
mmdbctl read -f json-pretty 1.6.191.77 asnSample.mmdb
which outputs:
{
"abuse": "abuse@sifycorp.com",
"abuser_score": "0 (Very Low)",
"active": "true",
"asn": "9583",
"country": "in",
"created": "",
"descr": "SIFY-AS-IN - Sify Limited, IN",
"domain": "sify.com",
"ip": "1.6.191.77",
"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"
}
The MMDB format can be read by the MaxMind DB reader library of every major programming language. In Python:
import maxminddb # pip install maxminddb
reader = maxminddb.open_database('asnSample.mmdb')
record = reader.get('1.0.0.1')
print('AS' + record['asn'], record['org'], record['type'])
# What is an Autonomous System?
An Autonomous System is a group of IPv4 and IPv6 networks (routes, or prefixes) operated by a single administrative entity, such as an Internet Service Provider, a cloud provider or a large company, under one routing policy.
Autonomous systems exchange routes with the Border Gateway Protocol (BGP): each AS announces its own prefixes to its neighbors, and BGP spreads the information on which AS can reach which network across the Internet. IP is the protocol that carries data between hosts; BGP is the protocol that tells routers which way to send it.
The current version is BGP-4, first specified in 1994 and today defined by RFC 4271 (2006). BGP-4 introduced support for Classless Inter-Domain Routing (CIDR) and route aggregation into supernetworks, which reduced the size of routing tables considerably.
# What is an Autonomous System Number (ASN)?
An ASN is the number that uniquely identifies an Autonomous System. ASNs used to be 16-bit numbers, which allows for at most 65,536 of them. Because the Internet kept growing, the regional Internet registries have also assigned 32-bit ASNs since 2007. One of the earliest ASNs is AS12 of New York University. According to its WHOIS record, AS12 was registered on July 5, 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
New ASNs are registered every day, and 83,158 of them announce prefixes today. The growth is slower than in the 1990s and early 2000s, though: Figure 1 shows the number of unique ASes announced on the Internet, and its slope decreases from 2021 on.
Figure 2 shows the growth of the IPv4 routing table (APNIC Blog: BGP in 2022 - the routing table). The supply of IPv4 addresses has been progressively constrained since 2011, and the address pools of the Regional Internet Registries are exhausted. Yet, as the APNIC authors conclude, this had no visible impact on the growth of the number of announced prefixes, which Figure 2 shows clearly.
# Frequently Asked Questions
Look the IP address up in the CSV or MMDB file of the IP to ASN Database, or use the ipapi.is API: its asn object contains the ASN, route,
organization and type.
The JSON file lists all IPv4 and IPv6 prefixes of every ASN. With an API key, the API returns the
same for a single ASN: https://api.ipapi.is?q=AS4851&key=YOUR_API_KEY.
The database contains 83,158 active ASNs, which announce at least one prefix, and 375,593 inactive ones, which are registered but announce nothing.
The IP to ASN Database names the network that routes an address. The IP to Company Database names the organization the address is registered to. For an address that an ISP has assigned to a business customer, the ASN is the ISP's, while the company is the customer.
# ASN Table
The table below lists the 100 largest active ASNs by IPv4 address
space. All 10,000 largest are in the
list of active ASNs, each with a page of its own. To look up any other
ASN, use the API with an API key: https://api.ipapi.is?q=AS4851&key=YOUR_API_KEY
# More IP Databases
All seven databases are also part of the Business plan, together with the API.