Our ASN API provides a simple way to retrieve accurate information about an Autonomous System Number (ASN) and the number of its associated IP address ranges (both IPv4 and IPv6). Knowledge of internet traffic patterns, ASN peering, upstream providers, and downstream ASNs is essential for network engineers, security professionals, and anyone interested in the structure of the internet. The API further enables IP-to-ASN lookups, which return ASN network details, including the Autonomous System Organization associated with a given IP address.
Look up an ASN or IP address to gain comprehensive insights through our API. It analyzes key information such as the country of registration, owning organization, ASN classification (e.g., ISP, hosting provider, enterprise, education), peering relationships, upstream and downstream providers, and WHOIS data. The ASN Lookup API offers a complete overview of the ASN, including its allocation date and current status.
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}
One of the core features provided by the IP and ASN information API is the listing of network peers. Peers are AS organizations that connect directly to exchange traffic without intermediaries. Peering details of any network give insight into its connectivity strength and efficiency. This information is crucial for network operators, content delivery networks (CDNs), and cybersecurity teams.
Analyzing the peering relationships of specific AS organizations helps determine the quality of routing paths and optimize latency-sensitive services. A network that peers with multiple global ISPs generally offers fast and reliable access across different regions.
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}
Downstream organizations are the networks or customers that receive internet access from a given ASN. Obtain the list of downstream ASNs of a primary ASN to understand the network's customer base and how it distributes its internet access. This information is useful for understanding the influence and reach of a network. It is also helpful in security operations, where tracking a suspicious IP through its downstream path can assist in identifying the origin of a threat.
The upstream providers of a target AS organization are the networks that supply its internet connectivity and routing. Knowing the transit providers of an ASN helps in understanding how traffic enters the network and which providers it relies on for connectivity. Understanding upstream relationships helps in making improved backup strategies if an upstream provider goes down or experiences difficulties.
1{
2 "asn": {
3 "as_number": "AS1",
4 "organization": "Level 3 Parent, LLC",
5 "country": "US",
6 "..."
7 "upstreams": [
8 {
9 "as_number": "AS7046",
10 "description": "Verizon Business",
11 "country": "US"
12 },
13 {
14 "as_number": "AS51925",
15 "description": "NUVEI BULGARIA EOOD",
16 "country": "BG"
17 },
18 "..."
19 ]
20 }
21}
The WHOIS response in the ASN API provides essential registration details about the Autonomous System, including the AS number, name, allocation status, registration and update dates, and the organization responsible for managing the network. This data is useful for network administrators and security teams when communicating with network operators regarding issues. It is available in the WHOIS response field of the API.
You can retrieve the geolocation information for an IP address in the following languages:
ASN data helps security teams identify the source of malicious network activity with greater precision. By continuously monitoring ASN-related patterns, security professionals can detect anomalies more quickly and mitigate emerging threats before they escalate. Leveraging this intelligence allows them to make smarter, data-driven decisions, and proactively defend their infrastructure.
Network engineers can analyze ASN data to optimize routing paths and reduce latency. An understanding of peering relationships between ASNs helps them identify the optimal path for data packets, ensuring efficient data delivery and an improved user experience. Additionally, by utilizing peering information, ISPs can bypass transit providers and reduce operational costs.
By understanding where internet connections are coming from (geolocation) and which network they belong to (ASN information), businesses can get a much clearer and more accurate picture of where their customers are, which internet companies or organizations they use, and how people in different areas are using their services. This deeper understanding enables the creation of more effective marketing strategies, make customer interactions feel more personal, and really focus on reaching the right people to get the best results.
Financial institutions and e-commerce platforms can use ASN finder tools to identify suspicious transactions and activities originating from high-risk ASNs. By pinpointing these potential threats early, organizations can make smarter decisions, such as implementing additional verification steps, monitoring high-risk traffic more closely, and proactively preventing fraudulent activities. This not only strengthens security measures but also builds greater trust with customers by safeguarding their financial and personal information.
By observing ASN peering relationships, upstream providers, and downstream organizations, ISPs can strategically plan which ASes they should connect to in order to make optimal decisions for their network infrastructure. Through careful analysis of traffic patterns, capacity demands, and geographic distribution, ISPs can design a more efficient, resilient, and cost-effective network. This proactive approach improves overall network performance, reduces latency, and minimizes dependency on costly transit providers, ensuring better service quality for end users.
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.
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/v2/asn?apiKey=API_KEY&asn=1 and it's default JSON response below:
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}
To retrieve ASN details using an IP address, use the following endpoint: https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&ip=1.0.0.0. The default response is in JSON format.
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}
You can use the following parameters to customize the API response based on your requirements.
This parameter accepts four options:
peers
downstreams
upstreams
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.
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}
To get a complete ASN response, include all values (peers, downstreams, upstreams, 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.
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": "AS137",
15 "description": "Consortium GARR",
16 "country": "IT"
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 }
47}
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.
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.
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.
Field | Type | Description | Can be empty? |
---|---|---|---|
ip | string | IP address for which asn data is required (appeared only when IP is queried). | Yes |
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 | Type of the ASN (e.g. “isp”, “hosting”). | Yes |
asn.domain | String | The domain associated with the ASN. | Yes |
asn.date_allocated | string | The date the ASN was originally allocated. | 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 (asNumber, description, country). | Yes |
asn.downstreams | array | Downstream (customer) ASNs with their details. | Yes |
asn.upstreams | array | Upstream (provider) ASNs with their details. | Yes |
asn.whois_response | string | Raw WHOIS record text returned for the ASN. | Yes |
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 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:
|
404 Not Found | It is returned for one of the following reasons:
|
405 Method Not Allowed |
|
429 Too Many Requests | It is returned for one of the following reasons:
|
499 Client Closed Request |
|
5XX Server Side Error |
|