Reference
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ip |
string | one of ip/asn | IPv4 or IPv6 address. |
asn |
integer | one of ip/asn | AS number without the prefix, e.g. 15169. |
format |
string | no | plain, json, jsonp. Default: plain. |
callback |
string | no | JSONP callback name. Default: callback. |
Example request
curl -s "https://api2.globus.studio/v2/asn?ip=77.88.8.8&format=json"
An ASN lookup tells you which autonomous system an IP address belongs to. The answer is the network number, the organisation that runs it, and the domain the network publishes. Two addresses in the same block can sit in different countries, but they route through the same network, and that is often the fact you actually need.
The data is public and comes from the routing tables. An ASN lookup returns it in plain text, JSON or JSONP.
What an ASN lookup returns
The response holds the number in both forms, the network name and the network domain.
{
"asn": "AS15169",
"asnum": 15169,
"asname": "Google LLC",
"as_domain": "google.com",
"ip": "8.8.8.8"
}
asnum is an integer, which is what most code wants. asn carries the usual AS prefix for display. as_domain appears only when the network publishes one; some networks have a name and nothing else. ip comes back only when you asked by address.
The reverse direction works too: an ASN lookup with a number instead of an address returns the name.
curl -s "https://api.globus.studio/v2/asn?asn=15169&format=json"
Why the network matters more than the country
GeoIP databases place an address in a country. That answer changes with anycast: one address announced from several cities resolves differently depending on where you ask from. The network number does not change.
This shows up in support work. A complaint says the visitor is in Germany and the site logs say the Netherlands. Both can be true when the same network announces the prefix from two data centres. The ASN tells you that it is one operator and one routing policy, which is enough to stop treating it as a location bug.
Hosting networks are the second common case. Most abuse arrives from a small set of hosting providers, and their ASNs are stable while their addresses rotate. Filtering a list of unknown senders by ASN catches the pattern that address-level rules miss.
Hosting and mobile networks
Mobile carriers run their own ASNs and route subscriber traffic through a few gateways. An address that geolocates to a city hundreds of kilometres away is normal for a mobile user, and the network name explains it sooner than a city name does.
For hosting, the network name usually carries the provider. That is handy in a log table: asname reads faster than a prefix list.
Errors and limits
A missing address and a missing number are refused with a message, not with an empty object. An address outside every known network, including private and reserved ranges, returns ASN not found for this IP. Lookup is rate limited together with the other address endpoints, and both IPv4 and IPv6 are served from the same data.
Input is validated before any lookup. A truncated address or a hostname returns an error instead of a guess, which keeps the answer usable as a filter.
An ASN lookup is cheap enough to call inside a request handler, and small enough to cache. Two fields usually go into a log: the number and the name. Keep the domain out of logs unless you need it for a report, because it is the field that changes most often when a provider rebrands or splits a network.
Reading the answer in a log
A column with AS15169 sorts and filters better than a free-text name, and it survives a rename. Pair it with the country code from the geolocation endpoint and the pair answers most questions about a request without touching the user agent. When a number looks unfamiliar, the reverse lookup by number gives the current name in one call.
Run an ASN lookup from the command line
curl -s "https://api.globus.studio/v2/asn?ip=77.88.8.8&format=json"
curl -s "https://api.globus.studio/v2/asn?ip=2001:4860:4860::8888&format=json"
Add format=jsonp&callback=getName for a browser request without CORS workarounds. The ASN lookup endpoint accepts GET, POST and PUT, so a JSON body works as well as a query string.
Related endpoints
The ASN endpoint covers the network. For the country, city and coordinates of the same address, use the IP geolocation API. To see whether the address belongs to a search engine or a scraper, the bot detector API checks the reverse record against known robot patterns.
Further reading: RFC 1930, Guidelines for creation of an AS and the RFC 8200 address format for IPv6.