ASN Lookup API


Overview

The ASN API delivers detailed information about an Autonomous System Number (ASN), including the AS name, organization, country of registration, associated domain, and classification (ISP, hosting provider, education, or business). It also indicates the allocation date and whether the ASN is currently active. It also provides routing insights, including peering relationships, upstream, and downstream connections, helping users understand how ASNs interconnect across the internet.

The API also returns WHOIS data such as the registrant’s organization, contact emails, and abuse reporting addresses. Users can lookup AS numbers or IP addresses (IPv4 or IPv6) to retrieve this information.

Note

For client-side calls to the endpoints mentioned below using the Request Origin (available on paid plans only), the apiKey parameter can be omitted.

Important
Each successful ASN lookup costs 1 credits per valid IP/ASN. The X-Credits-Charged response header shows the total credits charged for the request. For details, please refer to our Credits Usage Guide.

Lookup By ASN

Use the endpoint below to retrieve ASN details by specifying an ASN as a query parameter. The API supports both JSON and XML formats. Alternatively, you can specify an IP address to retrieve the details of the ASN associated with that IP.

The URL for this API is https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=1 and it's default JSON response below:

Response
1{
2  "asn": {
3    "as_number": "AS1",
4    "organization": "Level 3 Parent, LLC",
5    "country": "US",
6    "asn_name": "LVLT-1",
7    "type": "BUSINESS",
8    "domain": "level3.com",
9    "date_allocated": "",
10    "allocation_status": "assigned",
11    "num_of_ipv4_routes": "137",
12    "num_of_ipv6_routes": "0",
13    "rir": "ARIN"
14  }
15}

Lookup By IP

To retrieve ASN details using an IP address, use the following endpoint: https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&ip=1.0.0.0 . The default response is in JSON format.

Response
1{
2  "ip": "1.0.0.0",
3  "asn": {
4    "as_number": "AS13335",
5    "organization": "Cloudflare, Inc.",
6    "country": "US",
7    "asn_name": "CLOUDFLARENET",
8    "type": "BUSINESS",
9    "domain": "cloudflare.com",
10    "date_allocated": "",
11    "allocation_status": "assigned",
12    "num_of_ipv4_routes": "2343",
13    "num_of_ipv6_routes": "2040",
14    "rir": "ARIN"
15  }
16}

API Parameters

You can use the following parameters to customize the API response based on your requirements.


1.Including Data (include)

This parameter accepts four options:

  • peers
  • downstreams
  • upstreams
  • routes
  • whois_response

To include peering data in the response, pass the value peers in the include parameter, as shown below. Also ensure the apiKey is included as a query parameter for authorization.

The response for this parameter appears below.

curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=1&include=peers'
Response
1{
2  "asn": {
3    "as_number": "AS1",
4    "organization": "Level 3 Parent, LLC",
5    "country": "US",
6    "...":"..."
7    "peers": [
8      {
9        "as_number": "AS25139",
10        "description": "TVCABO - Comunicacoes Multimedia, Lda",
11        "country": "MZ"
12      },
13      {
14        "as_number": "AS7046",
15        "description": "Verizon Business",
16        "country": "US"
17      },
18      "...":"..."
19    ]
20  }
21}

I.Include (Combine all objects with ASN details)

To get a complete ASN response, include all values (peers, downstreams, upstreams, routes, whois_response) in the include parameter parameter as shown below. Note that the apiKey must also be passed as a query parameter for authorization. The response for this parameter appears below.

curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=12&include=peers,downstreams,upstreams,routes,whois_response'
Response
1{
2  "asn": {
3    "as_number": "AS12",
4    "organization": "New York University",
5    "country": "US",
6    ...
7    "peers": [
8      {
9        "as_number": "AS3269",
10        "description": "Telecom Italia S.p.A.",
11        "country": "IT"
12      },
13      {
14        "as_number": "AS8220",
15        "description": "COLT Technology Services Group Limited",
16        "country": "GB"
17      },
18      ...
19    ],
20    "downstreams": [
21      {
22        "as_number": "AS394666",
23        "description": "NYU Langone Health",
24        "country": "US"
25      },
26      {
27        "as_number": "AS54965",
28        "description": "Polytechnic Institute of NYU",
29        "country": "US"
30      }
31    ],
32    "upstreams": [
33      {
34        "as_number": "AS3269",
35        "description": "Telecom Italia S.p.A.",
36        "country": "IT"
37      },
38      {
39        "as_number": "AS8220",
40        "description": "COLT Technology Services Group Limited",
41        "country": "GB"
42      },
43      ...
44    ],
45    "whois_response": "\n\n\nASNumber:       12\nASName:         NYU-DOMAIN\nASHandle:       AS12\nRegDate:        1984-07-05\nUpdated:        2023-05-25 ..."
46    "routes": [
47      "192.76.177.0/24",
48      "216.165.96.0/20",
49      "216.165.89.0/24",
50      "216.165.0.0/18",
51      ...
52    ]
53  }
54}

2.Excluding Fields

You can exclude specific fields from the API response (except the ip field) by listing them in the excludes parameter as a comma-separated list. For example, you want to remove date_allocated and allocation_status from api response, you can put the keys in excludes parameter like this.

curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=1&excludes=asn.date_allocated,asn.allocation_status'
Response
1{
2  "asn": {
3    "as_number": "AS1",
4    "organization": "Level 3 Parent, LLC",
5    "country": "US",
6    "asn_name": "LVLT-1",
7    "type": "BUSINESS",
8    "domain": "level3.com",
9    "num_of_ipv4_routes": "137",
10    "num_of_ipv6_routes": "0",
11    "rir": "ARIN"
12  }
13}

3.Get Specific fields

You can filter the API response to include only the fields you want by using the fields parameter. For example, to retrieve only the AS organization, its country, and downstreams in the API response, list these keys in the fields parameter as shown below. The API will combine these fields with the default ASN response. You can use the following URL.

curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=25139&fields=asn.organization,asn.country,asn.downstreams'
Response
1{
2  "asn": {
3    "organization": "Level 3 Parent, LLC",
4    "country": "US",
5    "downstreams": [
6      {
7        "as_number": "AS25139",
8        "description": "TVCABO - Comunicacoes Multimedia, Lda",
9        "country": "MZ"
10      }
11    ]
12  }
13}
Note

Parameters peers, downstreams, upstreams, whois_response can be used in both include , and fields . If both include and fields parameters are used simultaneously, only the fields parameter will be applied.


ASN Details in /ipgeo

The ASN Lookup API is part of the Paid Plan . By subscribing to the Paid plan, you can include asn details in the ipgeo endpoint along with other features such as abuse contact details, security information, and more.

You can also use asn endpoint separately to reduce payload and retrieve detailed ASN data.
You can get basic ASN details in /ipgeo endpoint by including asn object as mentioned below.

curl -X GET 'https://api.ipgeolocation.io/v3/ipgeo?apiKey=API_KEY&ip=1.0.0.0&include=asn'
Response
1{
2  "ip": "1.0.0.0",
3  "location": {
4    "continent_code": "OC",
5    "continent_name": "Oceania",
6    "country_code2": "AU",
7    "country_code3": "AUS",
8    "country_name": "Australia",
9    "country_name_official": "Commonwealth of Australia",
10    "country_capital": "Canberra",
11    "state_prov": "Queensland",
12    "state_code": "AU-QLD",
13    "district": "Brisbane",
14    "city": "South Brisbane",
15    "zipcode": "4101",
16    "latitude": "-27.47306",
17    "longitude": "153.01421",
18    "is_eu": false,
19    "country_flag": "https://ipgeolocation.io/static/flags/au_64.png",
20    "geoname_id": "10113228",
21    "country_emoji": "🇦🇺"
22  },
23  "country_metadata": {
24    "calling_code": "+61",
25    "tld": ".au",
26    "languages": [
27      "en-AU"
28    ]
29  },
30  "network": {
31    "connection_type": "",
32    "route": "1.0.0.0/24",
33    "is_anycast": true
34  },
35  "currency": {
36    "code": "AUD",
37    "name": "Australian Dollar",
38    "symbol": "A$"
39  },
40  "asn": {
41    "as_number": "AS13335",
42    "organization": "Cloudflare, Inc.",
43    "country": "US",
44    "type": "BUSINESS",
45    "domain": "cloudflare.com",
46    "date_allocated": "2017-02-17T00:00",
47    "rir": "ARIN"
48  },
49  "company": {
50    "name": "APNIC Research and Development",
51    "type": "",
52    "domain": ""
53  },
54  "time_zone": {
55    "name": "Australia/Brisbane",
56    "offset": 10,
57    "offset_with_dst": 10,
58    "current_time": "2026-02-11 15:41:29.494+1000",
59    "current_time_unix": 1770788489.494,
60    "current_tz_abbreviation": "AEST",
61    "current_tz_full_name": "Australian Eastern Standard Time",
62    "standard_tz_abbreviation": "AEST",
63    "standard_tz_full_name": "Australian Eastern Standard Time",
64    "is_dst": false,
65    "dst_savings": 0,
66    "dst_exists": false,
67    "dst_tz_abbreviation": "",
68    "dst_tz_full_name": "",
69    "dst_start": {},
70    "dst_end": {}
71  }
72}
73

Reference to ASN API Response

Below, we provide separate tables for each JSON object in the response, listing all possible fields available across the asn endpoint.

FieldTypeDescriptionCan be empty?
ipstring

IP address for which ASN data is required (appears only when IP is queried).

Yes
asn.as_numberstring

Complete Autonomous System Number that was looked up.

Yes
asn.organizationstring

The name of the organization to which that ASN is assigned.

Yes
asn.countrystring

The two-letter country code where the organization is registered.

Yes
asn.asn_namestring

The official ASN handle.

Yes
asn.typestring

Type of the ASN (e.g., “isp”, “hosting”).

Yes
asn.domainstring

The domain associated with the ASN.

Yes
asn.date_allocatedstring

The date the ASN was originally allocated.

Yes
asn.allocation_statusstring

Current status of the ASN (“assigned”, “allocated”, etc.).

Yes
asn.num_of_ipv4_routesstring

Number of distinct IPv4 prefixes announced by this ASN.

Yes
asn.num_of_ipv6_routesstring

Number of distinct IPv6 prefixes announced by this ASN.

Yes
asn.peersarray

Directly connected ASes (asNumber, description, country).

Yes
asn.downstreamsarray

Downstream (customer) ASNs with their details.

Yes
asn.upstreamsarray

Upstream (provider) ASNs with their details.

Yes
asn.routesarray

IPv4 and IPv6 prefixes managed by the provided ASN.

Yes
asn.whois_responsestring

Raw WHOIS record text returned for the ASN.

Yes

Error Codes

ASN API returns HTTP status code 200 for a successful API request along with the response.

While, in case of a bad or invalid request, ASN API returns 4xx HTTP status code along with a descriptive message explaining the reason for the error.

Below is a detailed explanation of the specific HTTP status codes and their corresponding error conditions:

HTTP StatusDescription
400
Bad Request

It is returned for one of the following reasons:

  • If the provided IPv4, IPv6 address, or ASN is invalid.

  • If special character(s) ( ) [ ] { } | ^ ` is passed in the API URL either as parameter or its value. Specially in case of API key.

401
Unauthorized

It is returned for one of the following reasons:

  • If API key (as apiKey URL parameter) is missing from the request to IP ASN API.

  • If an invalid (a random value) API key is provided.

  • If the API request is made from an unverified ipgeolocation.io account.

  • If your account has been disabled or locked to use by the admin due to abuse or illegal activity.

  • When the request to IP ASN API is made using API key for a database subscription

  • When the request to IP ASN API is made on the 'paused' subscription.

  • If you’re making API requests after your subscription trial has been expired.

  • If your active until date has passed and you need to upgrade your account.

  • If IP-ASN lookup is called using free subsciption API key.

404
Not Found

It is returned for one of the following reasons:

  • If the IPv4, IPv6, or ASN does not exist in our database.

  • If the IPv4, IPv6, or ASN is passed as a path variable, instead of url parameter as ip= , or asn= .

  • If the wrong endpoint is called, that does not exists in our API.

405
Method Not Allowed
  • If wrong HTTP request method is used for calling the endpoints. Only GET method is allowed.

429
Too Many Requests

It is returned for one of the following reasons:

  • If the API usage limit has reached for the free subscriptions, or paid subscriptions with the status 'past due', 'deleted' or 'trial expired'.

  • If the surcharge API usage limit has reached against the subscribed plan.

499
Client Closed Request
  • If the client has set the very short request or connection timeout, leading to the server closing the request prematurely.

5XX
Server Side Error
  • If a 500 (Internal Server Error), 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout), or 505 (HTTP Version Not Supported) status code is returned, it indicates an issue on our end. Please contact us with your request at  support@ipgeolocation.io for further assistance.


API SDKs

To facilitate the developers, we have added some SDKs for various programming languages. The detailed documentation on how to use these SDKs is available in the respective SDK's documentation page linked below.

Our SDKs are also available on Github. Feel free to help us improve them. Following are the available SDKs:


Frequently Asked Questions

An Autonomous System (AS) is a collection of IP networks and routers under the control of a single entity or organization. This entity can be an ISP, a large corporation, or a university. To connect to the internet, every network typically needs to be part of an autonomous system. Each autonomous system operates under a single routing policy.
An Autonomous System Number (ASN) is a unique identifier assigned to an autonomous system. ASNs are crucial for the Border Gateway Protocol (BGP), which uses them to identify ASes and determine the best routing paths between them.
BGP is the protocol used to exchange routing information between different autonomous systems on the internet. It announces the reachability of IP address prefixes through specific ASes, enabling data to be routed efficiently. BGP is essential for directing traffic along the best possible path across the internet.
The routing policy is a set of rules that asn AS organization follows to decide which routes to advertise (export policy) and which routes to accept (import policy). BGP does not select route on the basis of shortest path only but also considers the routing polices of networks, allowing them to control traffic flow based on their preferences, cost management concerns or agreements.
Upstreams are higher-tier network providers or ISPs through which an Autonomous System (AS) sends traffic to reach the rest of the internet. Organizations usually pay their upstream providers for global internet connectivity. Downstreams are client networks or smaller ASes that receive connectivity from a given AS. Traffic going towards these customers from the broader internet often goes through the AS.
Peers are networks or independent ASes that have direct connection with each other to exchange traffic without going through upstream transit provider. Peering is typically established for mutual benefits, meaning that neither party pays the other for the exchange of traffic.
The IP to ASN API provides details such as the ASN associated with a given IP address, the name of the owning organization, country of registration, peering information, upstreams, downstreams, and WHOIS data. This information is valuable for network analysis and monitoring.
Yes, our ASN finder tool offers free lookups with full ASN information. However, for high-volume usage or extensive queries, paid plans are available and offer more extensive access.
The ASN data is updated daily to maintain accuracy and reflect the latest changes in internet routing.
You can access a reliable IP ASN database by creating an account on ipgeolocation.io. Once registered, you'll receive an API key and can access daily or weekly ASN data updates.
Yes, our IP Address ASN Lookup API allows you to perform lookups using both IP addresses and ASNs. If neither is provided, the API returns ASN data based on the client device's IP address.
Yes, sample ASN data is available for download on our website. It includes a limited number of records to help you understand the structure and format of the full database. You can use this data to test API integration.

Subscribe Our Newsletter

Get the latest in geolocation tech, straight to your inbox.