Available in plans >= small

ASN Endpoint

Retrieves the information about the provided ASN.


GET/v2/asns

ASN Information

This asn endpoint returns information about any specified ASN.

Required attributes

  • Name
    asn
    Type
    string
    Description

    The ASN you want to query

The JavaScript, Python and PHP SDKs do not cover this endpoint yet, so the examples call it over plain HTTP.

Response Structure

Our /asns endpoint offers the following information: data, its ranges, and on paid plans the ASN depth and the RPKI keys after them.

Request

GET
/v2/asns
curl -G https://api.ipbase.com/v2/asns \
    -d asn=AS13335 \
    -H "apikey: YOUR-API-KEY"

Full Response

{
    "data": {
        "asn": "13335",
        "organization": "Cloudflare, Inc.",
        "domain": "cloudflare.com",
        "country": "US",
        "isp": "Cloudflare, Inc.",
        "ip_count": 1543168,
        "ranges_count": 2,
        "ranges": [
            {
                "subnet": "1.0.0.0/24",
                "company": "APNIC Research and Development",
                "ip_count": 256,
                "country": "AU"
            },
            {
                "subnet": "1.1.1.0/24",
                "company": "APNIC Research and Development",
                "ip_count": 256,
                "country": "AU"
            }
        ],
        "type": "hosting",
        "registry": "arin",
        "allocated": "2010-07-14",
        "prefixes": {
            "v4": 384,
            "v6": 746
        },
        "peers_count": 2,
        "peers": [
            { "asn": "6939", "paths": 50 },
            { "asn": "3320", "paths": 17 }
        ],
        "upstreams_count": 3,
        "upstreams": [
            { "asn": "174", "paths": 3253 },
            { "asn": "2914", "paths": 2262 },
            { "asn": "1299", "paths": 1369 }
        ],
        "downstreams_count": 0,
        "downstreams": [],
        "rpki": {
            "valid": 2,
            "invalid": 0,
            "not_found": 0
        },
        "announced_prefixes_count": 2,
        "announced_prefixes": [
            { "prefix": "1.0.0.0/24", "rpki_status": "valid", "rpki_invalid_reason": null },
            { "prefix": "1.1.1.0/24", "rpki_status": "valid", "rpki_invalid_reason": null }
        ]
    }
}

data   Response Properties

Available in plans >= small
  • Name
    asn
    Type
    string
    Description

    The requested ASN as a string, without the AS prefix (e.g. "13335")

  • Name
    organization
    Type
    string
    Description

    ️️The organization which owns the ASN

  • Name
    domain
    Type
    string
    Description

    The domain of the organization

  • Name
    country
    Type
    string
    Description

    The ISO 3166-1 alpha-2 country code of the owner of the ASN

  • Name
    isp
    Type
    string
    Description

    ️ The ISP which the ASN belongs to

  • Name
    ip_count
    Type
    integer
    Description

    ️The total count of IPs owned by this ASN

  • Name
    ranges_count
    Type
    integer
    Description

    ️The total count of subnet ranges owned by this ASN

  • Name
    ranges
    Type
    array<object>
    Description

    An array of the ranges owned by this ASN (see below)

{
    "data": {
        "asn": "13335",
        "organization": "Cloudflare, Inc.",
        "domain": "cloudflare.com",
        "country": "US",
        "isp": "Cloudflare, Inc.",
        "ip_count": 1543168,
        "ranges_count": 2,
        ...
    }
}

ranges   Response Properties

Available in plans >= small
  • Name
    subnet
    Type
    string
    Description

    The subnet in CIDR notation

  • Name
    company
    Type
    string
    Description

    The company name owning this subnet

  • Name
    ip_count
    Type
    integer
    Description

    Count of the IPs contained in this subnet

  • Name
    country
    Type
    string
    Description

    The ISO 3166-1 alpha-2 country code for the location of the subnet

{
    ...
    "ranges": [
        {
            "subnet": "1.0.0.0/24",
            "company": "APNIC Research and Development",
            "ip_count": 256,
            "country": "AU"
        },
        {
            "subnet": "1.1.1.0/24",
            "company": "APNIC Research and Development",
            "ip_count": 256,
            "country": "AU"
        }
    ],
    ...
}

ASN depth   Response Properties

Available in plans >= small

Every paid plan with the ASN endpoint gets these keys after ranges. Each is null while its data is unavailable; an AS number without links in BGP has empty lists and counts of 0.

  • Name
    type
    Type
    string
    Description

    The class of the AS number: isp, hosting, business, education or government; null when it has no class

  • Name
    registry
    Type
    string
    Description

    The regional internet registry that delegated the AS number: afrinic, apnic, arin, lacnic or ripencc

  • Name
    allocated
    Type
    string
    Description

    When the registry delegated the AS number (YYYY-MM-DD)

  • Name
    prefixes
    Type
    object
    Description

    v4 and v6: how many IPv4 and IPv6 networks our ASN data lists for the AS number

  • Name
    peers_count
    Type
    integer
    Description

    How many AS numbers it peers with, as inferred from the day's BGP data (the AS paths that public route collectors of RouteViews and RIPE RIS saw)

  • Name
    peers
    Type
    array<object>
    Description

    The peers with the most AS paths over the link, most first, at most 50: asn (a string) and paths (the distinct AS paths over the link)

  • Name
    upstreams_count
    Type
    integer
    Description

    How many providers (transit) it has, as inferred from the day's BGP data

  • Name
    upstreams
    Type
    array<object>
    Description

    Its providers, as peers

  • Name
    downstreams_count
    Type
    integer
    Description

    How many customers it has, as inferred from the day's BGP data

  • Name
    downstreams
    Type
    array<object>
    Description

    Its customers, as peers

{
    ...
    "type": "hosting",
    "registry": "arin",
    "allocated": "2010-07-14",
    "prefixes": {
        "v4": 384,
        "v6": 746
    },
    "peers_count": 2,
    "peers": [
        { "asn": "6939", "paths": 50 },
        { "asn": "3320", "paths": 17 }
    ],
    "upstreams_count": 3,
    "upstreams": [
        { "asn": "174", "paths": 3253 },
        ...
    ],
    "downstreams_count": 0,
    "downstreams": [],
    ...
}

RPKI   Response Properties

Available in plans >= small

The RFC 6811 route origin validation of the prefixes the AS number announces (the routes it originates in the day's BGP data), against the day's RPKI data. They come after the depth, on the same plans. Each is null while the RPKI data is unavailable.

  • Name
    rpki
    Type
    object
    Description

    valid, invalid and not_found: how many of its announced prefixes have each state

  • Name
    announced_prefixes_count
    Type
    integer
    Description

    How many prefixes it announces

  • Name
    announced_prefixes
    Type
    array<object>
    Description

    The first 1,000 announced prefixes by address (IPv4 first), each with prefix, rpki_status (valid, invalid or not_found) and rpki_invalid_reason (asn or length for an invalid route, else null), as in the network object of /v2/info

/v2/asns has the RPKI states of the newest BGP data. /v2/info reads them from our ASN data, which takes them over at its next daily build, so the two can differ for up to a day.

{
    ...
    "rpki": {
        "valid": 2,
        "invalid": 0,
        "not_found": 0
    },
    "announced_prefixes_count": 2,
    "announced_prefixes": [
        { "prefix": "1.0.0.0/24", "rpki_status": "valid", "rpki_invalid_reason": null },
        { "prefix": "1.1.1.0/24", "rpki_status": "valid", "rpki_invalid_reason": null }
    ]
}