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, BUSINESS, EDUCATION, or GOVERNMENT). 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.
With include=whois_response, the API also returns the raw WHOIS record for the ASN as text, which usually contains the registrant’s organization, contact emails, and abuse reporting addresses. Users can look up AS numbers or IP addresses (IPv4 or IPv6) to retrieve this information.
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=24940 and its default JSON response is shown below:
1{
2 "asn": {
3 "as_number": "AS24940",
4 "organization": "Hetzner Online GmbH",
5 "country": "DE",
6 "type": "HOSTING",
7 "domain": "hetzner.com",
8 "date_allocated": "2002-06-03",
9 "asn_name": "HETZNER-AS",
10 "allocation_status": "ASSIGNED",
11 "num_of_ipv4_routes": "92",
12 "num_of_ipv6_routes": "5",
13 "rir": "RIPE"
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=49.12.0.0. The default response is in JSON format.
1{
2 "ip": "49.12.0.0",
3 "asn": {
4 "as_number": "AS24940",
5 "organization": "Hetzner Online GmbH",
6 "country": "DE",
7 "type": "HOSTING",
8 "domain": "hetzner.com",
9 "date_allocated": "2002-06-03",
10 "asn_name": "HETZNER-AS",
11 "allocation_status": "ASSIGNED",
12 "num_of_ipv4_routes": "92",
13 "num_of_ipv6_routes": "5",
14 "rir": "RIPE"
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 five options:
peersdownstreamsupstreamsrouteswhois_response
Use * (or all, any) to add all five modules. Values are case-sensitive; unknown values are ignored.
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'1{
2 "asn": {
3 "as_number": "AS1",
4 "organization": "Level 3 Parent, LLC",
5 "country": "US",
6 "type": "ISP",
7 "domain": "lumen.com",
8 "date_allocated": "2001-09-20",
9 "asn_name": "LVLT-1",
10 "allocation_status": "",
11 "num_of_ipv4_routes": "128",
12 "num_of_ipv6_routes": "0",
13 "rir": "ARIN",
14 "peers": [
15 {
16 "as_number": "AS264773",
17 "description": "GOZFLY S.A.",
18 "country": "HN"
19 },
20 {
21 "as_number": "AS38310",
22 "description": "iCan Solutions Pvt. Ltd. AS",
23 "country": "IN"
24 },
25 {
26 "as_number": "AS7046",
27 "description": "Verizon Business",
28 "country": "US"
29 },
30 {
31 "as_number": "AS198941",
32 "description": "Bianor Services EOOD",
33 "country": "BG"
34 },
35 {
36 "as_number": "AS262544",
37 "description": "RazaoInfo Internet Ltda",
38 "country": "BR"
39 },
40 {
41 "as_number": "AS11537",
42 "description": "Internet2",
43 "country": "US"
44 },
45 {
46 "as_number": "AS29132",
47 "description": "Easylinehost Finland Oy",
48 "country": "FI"
49 },
50 {
51 "as_number": "AS54043",
52 "description": "GOZFLY LLC",
53 "country": "US"
54 },
55 {
56 "as_number": "AS23688",
57 "description": "Link3 Technologies Limited",
58 "country": "BD"
59 },
60 {
61 "as_number": "AS396455",
62 "description": "CoverMyMeds LLC",
63 "country": "US"
64 },
65 {
66 "as_number": "AS265955",
67 "description": "C. H MALUZA E CIALTDA ME",
68 "country": "BR"
69 },
70 {
71 "as_number": "AS263309",
72 "description": "LaraNet Telecomunicações e Serviços EIRELI",
73 "country": "BR"
74 },
75 {
76 "as_number": "AS270444",
77 "description": "ZBL Telecom",
78 "country": "BR"
79 }
80 ]
81 }
82}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 (or use include=*) 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'1{
2 "asn": {
3 "as_number": "AS12",
4 "organization": "New York University",
5 "country": "US",
6 "type": "EDUCATION",
7 "domain": "nyu.edu",
8 "date_allocated": "1984-07-05",
9 "asn_name": "NYU-DOMAIN",
10 "allocation_status": "",
11 "num_of_ipv4_routes": "12",
12 "num_of_ipv6_routes": "1",
13 "rir": "ARIN",
14 "routes": [
15 "192.76.177.0/24",
16 "216.165.96.0/20",
17 "2607:f600::/32",
18 "128.122.0.0/16",
19 "192.86.139.0/24",
20 "216.165.103.0/24",
21 "128.238.0.0/16",
22 "216.165.89.0/24",
23 "216.165.0.0/18",
24 "216.165.112.0/21",
25 "216.165.64.0/19",
26 "216.165.102.0/24",
27 "216.165.120.0/22"
28 ],
29 "downstreams": [
30 {
31 "as_number": "AS394666",
32 "description": "NYU Langone Health",
33 "country": "US"
34 }
35 ],
36 "upstreams": [
37 {
38 "as_number": "AS3269",
39 "description": "Telecom Italia S.p.A.",
40 "country": "IT"
41 },
42 {
43 "as_number": "AS8220",
44 "description": "COLT Technology Services Group Limited",
45 "country": "GB"
46 },
47 {
48 "as_number": "AS286",
49 "description": "GTT Communications Inc.",
50 "country": "US"
51 },
52 {
53 "as_number": "AS3257",
54 "description": "GTT Communications Inc.",
55 "country": "US"
56 },
57 {
58 "as_number": "AS3754",
59 "description": "NYSERNet",
60 "country": "US"
61 },
62 {
63 "as_number": "AS3356",
64 "description": "Level 3 Parent, LLC",
65 "country": "US"
66 },
67 {
68 "as_number": "AS46887",
69 "description": "Zayo Bandwidth",
70 "country": "US"
71 },
72 {
73 "as_number": "AS6461",
74 "description": "Zayo Bandwidth",
75 "country": "US"
76 },
77 {
78 "as_number": "AS137",
79 "description": "Consortium GARR",
80 "country": "IT"
81 }
82 ],
83 "peers": [
84 {
85 "as_number": "AS3269",
86 "description": "Telecom Italia S.p.A.",
87 "country": "IT"
88 },
89 {
90 "as_number": "AS8220",
91 "description": "COLT Technology Services Group Limited",
92 "country": "GB"
93 },
94 {
95 "as_number": "AS286",
96 "description": "GTT Communications Inc.",
97 "country": "US"
98 },
99 {
100 "as_number": "AS394666",
101 "description": "NYU Langone Health",
102 "country": "US"
103 },
104 {
105 "as_number": "AS3257",
106 "description": "GTT Communications Inc.",
107 "country": "US"
108 },
109 {
110 "as_number": "AS3754",
111 "description": "NYSERNet",
112 "country": "US"
113 },
114 {
115 "as_number": "AS3356",
116 "description": "Level 3 Parent, LLC",
117 "country": "US"
118 },
119 {
120 "as_number": "AS6461",
121 "description": "Zayo Bandwidth",
122 "country": "US"
123 },
124 {
125 "as_number": "AS46887",
126 "description": "Zayo Bandwidth",
127 "country": "US"
128 },
129 {
130 "as_number": "AS137",
131 "description": "Consortium GARR",
132 "country": "IT"
133 }
134 ],
135 "whois_response": "\n#\n# ARIN WHOIS data and services are subject to the Terms of Use\n# available at: https://www.arin.net/resources/registry/whois/tou/\n#\n# If you see inaccuracies in the results, please report at\n# https://www.arin.net/resources/registry/whois/inaccuracy_reporting/\n#\n# Copyright 1997-2026, American Registry for Internet Numbers, Ltd.\n#\n\n\nASNumber: 12\nASName: NYU-DOMAIN\nASHandle: AS12\nRegDate: 1984-07-05\nUpdated: 2023-05-25\nRef: https://rdap.arin.net/registry/autnum/12\n\n\nOrgName: New York University\nOrgId: NYU-Z\nAddress: 726 Broadway, 8th Floor - ITS\nCity: New York\nStateProv: NY\nPostalCode: 10003\nCountry: US\nRegDate: 2023-05-15\nUpdated: 2023-05-15\nRef: https://rdap.arin.net/registry/entity/NYU-Z\n\n\nOrgNOCHandle: COSI-ARIN\nOrgNOCName: Communications Operations Services - ITS\nOrgNOCPhone: +1-212-998-3444 \nOrgNOCEmail: noc-cosi-arin@nyu.edu\nOrgNOCRef: https://rdap.arin.net/registry/entity/COSI-ARIN\n\nOrgAbuseHandle: OIS9-ARIN\nOrgAbuseName: Office of Information Security\nOrgAbusePhone: +1-212-998-3333 \nOrgAbuseEmail: abuse@nyu.edu\nOrgAbuseRef: https://rdap.arin.net/registry/entity/OIS9-ARIN\n\nOrgTechHandle: COSI-ARIN\nOrgTechName: Communications Operations Services - ITS\nOrgTechPhone: +1-212-998-3444 \nOrgTechEmail: noc-cosi-arin@nyu.edu\nOrgTechRef: https://rdap.arin.net/registry/entity/COSI-ARIN\n\nRTechHandle: COSI-ARIN\nRTechName: Communications Operations Services - ITS\nRTechPhone: +1-212-998-3444 \nRTechEmail: noc-cosi-arin@nyu.edu\nRTechRef: https://rdap.arin.net/registry/entity/COSI-ARIN\n\nRNOCHandle: COSI-ARIN\nRNOCName: Communications Operations Services - ITS\nRNOCPhone: +1-212-998-3444 \nRNOCEmail: noc-cosi-arin@nyu.edu\nRNOCRef: https://rdap.arin.net/registry/entity/COSI-ARIN\n\n\n#\n# ARIN WHOIS data and services are subject to the Terms of Use\n# available at: https://www.arin.net/resources/registry/whois/tou/\n#\n# If you see inaccuracies in the results, please report at\n# https://www.arin.net/resources/registry/whois/inaccuracy_reporting/\n#\n# Copyright 1997-2026, American Registry for Internet Numbers, Ltd.\n#\n\n"
136 }
137}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, to remove date_allocated and allocation_status from the API response, you can put the keys in the excludes parameter like this.
excludes also wins over include: include=*&excludes=peers (or excludes=asn.peers) returns every module except peers.
curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=12&excludes=asn.date_allocated,asn.allocation_status'1{
2 "asn": {
3 "as_number": "AS12",
4 "organization": "New York University",
5 "country": "US",
6 "type": "EDUCATION",
7 "domain": "nyu.edu",
8 "asn_name": "NYU-DOMAIN",
9 "num_of_ipv4_routes": "12",
10 "num_of_ipv6_routes": "1",
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, request downstreams with the include parameter and list the three keys in the fields parameter, as shown below. The response then contains only those fields.
curl -X GET 'https://api.ipgeolocation.io/v3/asn?apiKey=API_KEY&asn=25139&include=downstreams&fields=asn.organization,asn.country,asn.downstreams'1{
2 "asn": {
3 "organization": "TVCABO Comunicações Multimédia, Lda",
4 "country": "MZ",
5 "downstreams": [
6 {
7 "as_number": "AS329756",
8 "description": "MSTAR, SA",
9 "country": "MZ"
10 },
11 {
12 "as_number": "AS328162",
13 "description": "Icolo Ltd",
14 "country": "KE"
15 },
16 {
17 "as_number": "AS10798",
18 "description": "The Standard Bank of South Africa Proprietary Limited",
19 "country": "ZA"
20 },
21 {
22 "as_number": "AS37477",
23 "description": "Mozabanco",
24 "country": "MZ"
25 },
26 {
27 "as_number": "AS329394",
28 "description": "OneCloud LDA",
29 "country": "MZ"
30 },
31 {
32 "as_number": "AS329769",
33 "description": "SOCIEDADE INTERBANCÁRIA DE MOÇAMBIQUE, S.A",
34 "country": "MZ"
35 }
36 ]
37 }
38}ASN Details in Main IP Geolocation API Endpoint
ASN data is also included by default in the IP Geolocation API (/v3/ipgeo), with limited details on the Free plan and more comprehensive information on the Paid plan. See the Pricing page for plan details. Additional fields and related features are described in the IP Geolocation API documentation.
Basic ASN details are returned in the /v3/ipgeo endpoint response, as shown below.
curl -X GET 'https://api.ipgeolocation.io/v3/ipgeo?apiKey=API_KEY&ip=49.12.0.0'1{
2 "ip": "49.12.0.0",
3 "asn": {
4 "as_number": "AS24940",
5 "organization": "Hetzner Online GmbH",
6 "country": "DE",
7 "type": "HOSTING",
8 "domain": "hetzner.com",
9 "date_allocated": "2002-06-03",
10 "rir": "RIPE"
11 },
12 "location": {
13 "continent_code": "EU",
14 "continent_name": "Europe",
15 "country_code2": "DE",
16 "country_code3": "DEU",
17 "country_name": "Germany",
18 "country_name_official": "Federal Republic of Germany",
19 "country_capital": "Berlin",
20 "state_prov": "Bavaria",
21 "state_code": "DE-BY",
22 "district": "Cham",
23 "city": "Falkenstein",
24 "zipcode": "93167",
25 "latitude": "49.09745",
26 "longitude": "12.48637",
27 "is_eu": true,
28 "country_flag": "https://ipgeolocation.io/static/flags/de_64.png",
29 "geoname_id": "2927917",
30 "country_emoji": "🇩🇪"
31 },
32 "country_metadata": {
33 "calling_code": "+49",
34 "tld": ".de",
35 "languages": [
36 "de"
37 ]
38 },
39 "network": {
40 "connection_type": "",
41 "route": "49.12.0.0/16",
42 "is_anycast": false,
43 "is_cdn": false,
44 "cdn_provider_name": ""
45 },
46 "currency": {
47 "code": "EUR",
48 "name": "Euro",
49 "symbol": "€"
50 },
51 "company": {
52 "name": "Hetzner Online GmbH",
53 "type": "HOSTING",
54 "domain": "hetzner.com"
55 },
56 "time_zone": {
57 "name": "Europe/Berlin",
58 "offset": 1,
59 "offset_with_dst": 1,
60 "current_time": "2026-10-29 11:33:57.074+0100",
61 "current_time_unix": 1793270037.074,
62 "current_tz_abbreviation": "CET",
63 "current_tz_full_name": "Central European Standard Time",
64 "standard_tz_abbreviation": "CET",
65 "standard_tz_full_name": "Central European Standard Time",
66 "is_dst": false,
67 "dst_savings": 0,
68 "dst_exists": true,
69 "dst_tz_abbreviation": "GMT+02:00",
70 "dst_tz_full_name": "Central European Summer Time",
71 "dst_start": {
72 "utc_time": "2026-03-29 TIME 01:00",
73 "duration": "+1.00H",
74 "gap": true,
75 "date_time_after": "2026-03-29 TIME 03:00",
76 "date_time_before": "2026-03-29 TIME 02:00",
77 "overlap": false
78 },
79 "dst_end": {
80 "utc_time": "2026-10-25 TIME 01:00",
81 "duration": "-1.00H",
82 "gap": false,
83 "date_time_after": "2026-10-25 TIME 02:00",
84 "date_time_before": "2026-10-25 TIME 03:00",
85 "overlap": true
86 }
87 }
88}1. ASN Field Availability Comparison
| Field | /v3/ipgeo (Free) | /v3/ipgeo (Paid) | /v3/asn |
|---|---|---|---|
| asn.as_number | Available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.organization | Available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.country | Available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.type | Not available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.domain | Not available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.date_allocated | Not available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.rir | Not available in /v3/ipgeo Free plan | Available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.asn_name | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.allocation_status | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.num_of_ipv4_routes | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.num_of_ipv6_routes | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.peers | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.downstreams | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.upstreams | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.routes | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
| asn.whois_response | Not available in /v3/ipgeo Free plan | Not available in /v3/ipgeo Paid plan | Available in /v3/asn endpoint |
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.
| Field | Type | Description | Can Be Empty? |
|---|---|---|---|
| ip | string | IP address for which ASN data is required (appears only when IP is queried). | No |
| asn.as_number | string | Complete Autonomous System Number that was looked up. | Yes |
| asn.organization | string | The name of the organization to which that ASN is assigned. | Yes |
| asn.country | string | The two-letter country code where the organization is registered. | Yes |
| asn.asn_name | string | The official ASN handle. | Yes |
| asn.type | string | ASN category. Possible values include | Yes |
| asn.domain | string | The domain associated with the ASN. | Yes |
| asn.date_allocated | string | The date the ASN was originally allocated. | Yes |
| asn.rir | string | Regional Internet Registry (RIR) that allocated the ASN. Possible values include | Yes |
| asn.allocation_status | string | Current status of the ASN (“assigned”, “allocated”, etc.). | Yes |
| asn.num_of_ipv4_routes | string | Number of distinct IPv4 prefixes announced by this ASN. | Yes |
| asn.num_of_ipv6_routes | string | Number of distinct IPv6 prefixes announced by this ASN. | Yes |
| asn.peers | array | Directly connected ASes (as_number, description, country). | Yes |
| asn.downstreams | array | Downstream (customer) ASNs with their details. | Yes |
| asn.upstreams | array | Upstream (provider) ASNs with their details. | Yes |
| asn.routes | array | IPv4 and IPv6 prefixes managed by the provided ASN. | Yes |
| asn.whois_response | string | 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.
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 Status | Description |
|---|---|
| 400 Bad Request | It is returned for one of the following reasons:
|
| 401 Unauthorized | It is returned for one of the following reasons:
|
| 402 Payment Required |
|
| 403 Forbidden |
|
| 404 Not Found | It is returned for one of the following reasons:
|
| 405 Method Not Allowed |
|
| 423 Locked |
|
| 429 Too Many Requests | It is returned for one of the following reasons:
|
| 499 Client Closed Request |
|
| 5XX Server Side Error |
|
OpenAPI Specification
The ASN API has an OpenAPI 3.0 specification in JSON and YAML, published in our OpenAPI repository on GitHub. Import it into Postman, Insomnia or another API client, or use it to generate client code. To try the endpoints without any setup, open our Postman workspace.
API SDKs
To facilitate developers, we have added SDKs for various programming languages. Our SDKs are also available on GitHub. Feel free to help us improve them.
Detailed instructions are available on each SDK’s documentation page linked below.
- IP Geolocation API Java SDK
- IP Geolocation API Python SDK
- IP Geolocation API Go SDK
- IP Geolocation API Ruby SDK
- IP Geolocation API JavaScript SDK
- IP Geolocation API JavaScript (Web) SDK
- IP Geolocation API TypeScript SDK
- IP Geolocation API PHP SDK
- IP Geolocation API C# (.NET) SDK
- IP Geolocation API Rust SDK
- IP Geolocation API Kotlin SDK
- IP Geolocation API Swift SDK
- IP Geolocation API C++ SDK
- Astronomy API Client-Side Plugin
Other Ways to Use the ASN Lookup API
You can also look up ASN details using our CLI, MCP server, or third-party integration tools.
- Command Line (CLI): Use the IPGeolocation.io CLI to look up ASN details with the
asncommand. - AI Assistants (MCP): Use the IPGeolocation.io MCP Server with compatible AI assistants through the
lookup_asntool. - Automation and Integrations: Explore integration guides for Maltego, Steampipe, CloudQuery, Zapier, and n8n. View all integrations
Frequently Asked Questions
Looking for features, modules, and use cases? Visit the ASN API page.
Explore ASN API