ASN lookup
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
asnrequiredstringThe 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.
asnrequiredintegerThe AS number.
namerequiredstringIts operator.
countryrequiredstringThe country its registry assigned it to.
registryrequiredstringThe registry that allocated it.
allocatedrequiredstringWhen.
domainrequiredstringIts operator's domain.
typestringThe kind of network it runs. Paid plans and the trial.
num_ipsintegerIPv4 addresses it announces. Paid plans and the trial.
num_prefixes4integerIPv4 prefixes it announces. Paid plans and the trial.
num_prefixes6integerIPv6 prefixes it announces. Paid plans and the trial.
rpki_validintegerIts announcements RPKI calls valid. Paid plans and the trial.
rpki_invalidintegerInvalid. Paid plans and the trial.
rpki_not_foundintegerWith no RPKI record. Paid plans and the trial.
whoisobjectIts 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.
prefixrequiredstringThe announced prefix.
peer_countrequiredintegerHow many peers saw it.
rpki_statusrequiredstringIts RPKI status.
first_seenrequiredstringThe first day BGP Route saw it.
countryrequiredstringWhere its first address is.
sizerequiredintegerIPv4 addresses it covers; 0 for IPv6.
other_originsrequiredarray<integer>Every other AS announcing it.
trial_expiredbooleanOn 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
{
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.
errorrequiredstringWhat went wrong.
TypeScript type
{
error: string;
}401application/json
The key is not one, or no longer works.
errorrequiredstringWhat went wrong.
TypeScript type
{
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.
errorrequiredstringWhat went wrong.
TypeScript type
{
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.
errorrequiredstringWhat went wrong.
TypeScript type
{
error: string;
}500application/json
Our data could not be read. Retry; nothing was charged.
errorrequiredstringWhat went wrong.
TypeScript type
{
error: string;
}