Skip to content
InternetData

ASN lookup

get/asn/{asn}

Answers what InternetData knows about one autonomous system: its registration on every plan, and on a paid one its ASN Whois record and every prefix it announces in global BGP, with RPKI status, up to 20000 per address family (the counts beside them are always whole). An AS no database knows answers its number with empty values.

Authorization (optional)

apiKeyQueryapikey in query

?apikey=<key>. Convenient in a browser; prefer a header elsewhere.

apiKeyHeaderX-Api-Key in header

X-Api-Key: <key>.

bearerAuthbearer token

Authorization: Bearer <key>.

Path parameters

asnrequiredstring

The AS number, as AS15169 in any case, or the bare number.

Responses

200application/json

What each database says about the AS, as much as your plan shows.

asnrequiredinteger

The AS number.

namerequiredstring

Its operator.

countryrequiredstring

The country its registry assigned it to.

registryrequiredstring

The registry that allocated it.

allocatedrequiredstring

When.

domainrequiredstring

Its operator's domain.

typestring

The kind of network it runs. Paid plans and the trial.

num_ipsinteger

IPv4 addresses it announces. Paid plans and the trial.

num_prefixes4integer

IPv4 prefixes it announces. Paid plans and the trial.

num_prefixes6integer

IPv6 prefixes it announces. Paid plans and the trial.

rpki_validinteger

Its announcements RPKI calls valid. Paid plans and the trial.

rpki_invalidinteger

Invalid. Paid plans and the trial.

rpki_not_foundinteger

With no RPKI record. Paid plans and the trial.

whoisobject

Its ASN Whois record, every column, empty where the registry states nothing. Paid plans and the trial.

prefixesarray<object>

What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial.

prefixrequiredstring

The announced prefix.

peer_countrequiredinteger

How many peers saw it.

rpki_statusrequiredstring

Its RPKI status.

first_seenrequiredstring

The first day BGP Route saw it.

countryrequiredstring

Where its first address is.

sizerequiredinteger

IPv4 addresses it covers; 0 for IPv6.

other_originsrequiredarray<integer>

Every other AS announcing it.

trial_expiredboolean

On every answer to a key on the free plan, and on no other: false while the day's trial of every field lasts, true once the answer has Unlimited's fields.

TypeScript type
ts
{
  asn: number;
  name: string;
  country: string;
  registry: string;
  allocated: string;
  domain: string;
  type?: string;
  num_ips?: number;
  num_prefixes4?: number;
  num_prefixes6?: number;
  rpki_valid?: number;
  rpki_invalid?: number;
  rpki_not_found?: number;
  whois?: Record<string, string>;
  prefixes?: {
    prefix: string;
    peer_count: number;
    rpki_status: string;
    first_seen: string;
    country: string;
    size: number;
    other_origins: number[];
  }[];
  trial_expired?: boolean;
}
400application/json

Not an address, an AS number or a domain.

errorrequiredstring

What went wrong.

TypeScript type
ts
{
  error: string;
}
401application/json

The key is not one, or no longer works.

errorrequiredstring

What went wrong.

TypeScript type
ts
{
  error: string;
}
403application/json

The key may not be used from this address, lacks the ip.lookup scope (Lookups, in the console's API keys), or was sent over plain HTTP.

errorrequiredstring

What went wrong.

TypeScript type
ts
{
  error: string;
}
429application/json

A rate limit, with Retry-After (this API protecting itself, or Unlimited's per-minute limit), or, with none, a paid plan's overage cap.

errorrequiredstring

What went wrong.

TypeScript type
ts
{
  error: string;
}
500application/json

Our data could not be read. Retry; nothing was charged.

errorrequiredstring

What went wrong.

TypeScript type
ts
{
  error: string;
}