ASN Lookup API and Network Intelligence

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.

    • stringip:"18.97.9.171" ,
    • objectasn:Object,
      • stringas_number:"AS14618" ,
      • stringorganization:"Amazon.com, Inc." ,
      • stringcountry:"US" ,
      • stringasn_name:"AMAZON-AES" ,
      • stringtype:"BUSINESS" ,
      • stringdomain:"arin.net" ,
      • stringdate_allocated:"" ,
      • stringallocation_status:"assigned" ,
      • stringnum_of_ipv4_routes:"1122" ,
      • stringnum_of_ipv6_routes:"345" ,
      • stringrir:"ARIN" ,
      • peers:Array[32],
        • objectpeers[0]:Object,
          • stringas_number:"AS32764" ,
          • stringdescription:"CSN Support Services" ,
          • stringcountry:"US" ,
        • objectpeers[1]:Object,
          • stringas_number:"AS400928" ,
          • stringdescription:"Private Tech Inc." ,
          • stringcountry:"US" ,
        • objectpeers[2]:Object,
          • stringas_number:"AS30265" ,
          • stringdescription:"77997 Newfoundland and Labrador Inc." ,
          • stringcountry:"CA" ,
        • objectpeers[3]:Object,
          • stringas_number:"AS401041" ,
          • stringdescription:"Axis Security" ,
          • stringcountry:"US" ,
        • objectpeers[4]:Object,
          • stringas_number:"AS27313" ,
          • stringdescription:"Spencer Stuart" ,
          • stringcountry:"US" ,
        • objectpeers[5]:Object,
          • stringas_number:"AS61162" ,
          • stringdescription:"Klarna Bank AB" ,
          • stringcountry:"SE" ,
        • objectpeers[6]:Object,
          • stringas_number:"AS14061" ,
          • stringdescription:"DigitalOcean, LLC" ,
          • stringcountry:"US" ,
        • objectpeers[7]:Object,
          • stringas_number:"AS400944" ,
          • stringdescription:"PopUp WiFi LLC" ,
          • stringcountry:"US" ,
        • objectpeers[8]:Object,
          • stringas_number:"AS13527" ,
          • stringdescription:"Gooflare LLC" ,
          • stringcountry:"US" ,
        • objectpeers[9]:Object,
          • stringas_number:"AS399805" ,
          • stringdescription:"Goliad Technologies" ,
          • stringcountry:"US" ,
        • ... and 22 more
      • upstreams:Array[1],
        • objectupstreams[0]:Object,
          • stringas_number:"AS16509" ,
          • stringdescription:"Amazon.com, Inc." ,
          • stringcountry:"US" ,
      • downstreams:Array[28],
        • objectdownstreams[0]:Object,
          • stringas_number:"AS32764" ,
          • stringdescription:"CSN Support Services" ,
          • stringcountry:"US" ,
        • objectdownstreams[1]:Object,
          • stringas_number:"AS400928" ,
          • stringdescription:"Private Tech Inc." ,
          • stringcountry:"US" ,
        • objectdownstreams[2]:Object,
          • stringas_number:"AS30265" ,
          • stringdescription:"77997 Newfoundland and Labrador Inc." ,
          • stringcountry:"CA" ,
        • objectdownstreams[3]:Object,
          • stringas_number:"AS401041" ,
          • stringdescription:"Axis Security" ,
          • stringcountry:"US" ,
        • objectdownstreams[4]:Object,
          • stringas_number:"AS27313" ,
          • stringdescription:"Spencer Stuart" ,
          • stringcountry:"US" ,
        • objectdownstreams[5]:Object,
          • stringas_number:"AS61162" ,
          • stringdescription:"Klarna Bank AB" ,
          • stringcountry:"SE" ,
        • objectdownstreams[6]:Object,
          • stringas_number:"AS14061" ,
          • stringdescription:"DigitalOcean, LLC" ,
          • stringcountry:"US" ,
        • objectdownstreams[7]:Object,
          • stringas_number:"AS400944" ,
          • stringdescription:"PopUp WiFi LLC" ,
          • stringcountry:"US" ,
        • objectdownstreams[8]:Object,
          • stringas_number:"AS13527" ,
          • stringdescription:"Gooflare LLC" ,
          • stringcountry:"US" ,
        • objectdownstreams[9]:Object,
          • stringas_number:"AS399805" ,
          • stringdescription:"Goliad Technologies" ,
          • stringcountry:"US" ,
        • ... and 18 more
      • stringwhois_response:" ASNumber: 14618 ASName: AMAZON-AES ASHandle: AS14618 RegDate: 2005-11-..." ,

    ASN Lookup

    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.

    Request

    curl -X GET 'https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&asn=1'

    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}

    Peer Relationships

    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.

    Request

    curl -X GET 'https://api.ipgeolocation.io/v2/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}

    Downstream ASNs

    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.

    Request

    curl -X GET 'https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&asn=1&include=downstreams'

    Response

    1{
    2  "asn": {
    3    "as_number": "AS1",
    4    "organization": "Level 3 Parent, LLC",
    5    "country": "US",
    6    "..."
    7    "downstreams": [
    8      {
    9        "as_number": "AS25139",
    10        "description": "TVCABO - Comunicacoes Multimedia, Lda",
    11        "country": "MZ"
    12      }
    13    ]
    14  }
    15}'

    Upstream Providers

    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.

    Request

    curl -X GET 'https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&asn=1&include=upstreams'

    Response

    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}

    Whois Details

    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.

    Request

    curl -X GET 'https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&asn=1&include=whois_response'

    Response

    1{
    2  "asn": {
    3    "as_number": "AS1",
    4    "organization": "Level 3 Parent, LLC",
    5    "country": "US",
    6    "..."
    7    "whois_response": "\n\n\nASNumber:       1\nASName:         LVLT-1\nASHandle:       AS1\nRegDate:        2001-09-20\nUpdated:        2024-06-18 "...""
    8  }
    9}

    Response in Multiple Languages

    You can retrieve the geolocation information for an IP address in the following languages:

    US FlagEnglish DE FlagGerman RU FlagRussian JP FlagJapanese FR FlagFrench CN FlagChinese Simplified ES FlagSpanish CZ FlagCzech IT FlagItalian KO FlagKorean FA FlagPersian PT FlagPortuguese

    Use Cases

    Cybersecurity and Threat Detection

    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.

    iplocation

    Network Performance and Routing Optimization

    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.

    geoip

    Business and Market Analysis

    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.

    iplook-up

    Fraud Detection and Prevention

    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.

    geoip

    Network Infrastructure Planning

    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.

    iplook-up

    Ready to get started?Get Started with ASN Lookup API Today

    ASN Lookup API Documentation

    ASN Lookup API

    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.

    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/v2/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/v2/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.

    A. Including Data (include)

    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.

    curl -X GET 'https://api.ipgeolocation.io/v2/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}

    - Include (Combine all objects with ASN details)

    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.

    curl -X GET 'https://api.ipgeolocation.io/v2/asn?apiKey=API_KEY&asn=12&include=peers,downstreams,upstreams,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": "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}

    B. 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/v2/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}

    C. 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/v2/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.

    Reference to ASN API Response

    FieldTypeDescriptionCan be empty?
    ipstringIP address for which asn data is required (appeared only when IP is queried).Yes
    asn.as_numberstringComplete 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.typestringType of the ASN (e.g. “isp”, “hosting”).Yes
    asn.domainStringThe domain associated with the ASN.Yes
    asn.date_allocatedstringThe date the ASN was originally allocated.Yes
    asn.allocation_statusstringCurrent 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_routesstringNumber of distinct IPv6 prefixes announced by this ASN.Yes
    asn.peersarrayDirectly connected ASes (asNumber, description, country).Yes
    asn.downstreamsarrayDownstream (customer) ASNs with their details.Yes
    asn.upstreamsarray Upstream (provider) ASNs with their details.Yes
    asn.whois_responsestringRaw 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 not exists 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.

    ASN API FAQs

    What is Autonomous System?
    What is an ASN?
    What is Border Gateway Protocol (BGP)?
    What is routing policy?
    What are upstreams and downstreams?
    What are peers?
    What data does IP to ASN API provide?
    Are there free ASN lookup tools available?
    How frequently is the ASN data updated?
    How can I get ASN Database?
    Can I perform lookups by IP address as well as ASN?
    Can I have sample data of ASN db?