Mapping IPs to ASNs at scale
For large lists, call the API per IP and cache results, since an IP's ASN rarely changes minute to minute. Because networks do re-announce prefixes over time, refresh the data periodically rather than treating it as fixed. The same lookup that powers the ASN Lookup tool is available through the API.
Using the data
Once you have the ASN and its type, you can route requests by risk: pass residential ISPs, and challenge or block hosting and data-center ASNs. See using ASN data for fraud detection for patterns.
Frequently Asked Questions
How do I look up an ASN with an API?
Send an IP address to an IP intelligence endpoint with your API key. The response returns the ASN, the operator, the ASN type, and risk flags, which your code can read and act on.
What does an ASN API return?
The ASN, the operator name and domain, the ASN type (ISP, hosting, business, education, or government), and usually risk flags such as is_hosting, is_vpn, and is_proxy.
Is there a free ASN API?
Yes. Abstract's IP Intelligence API has a free tier that returns ASN data for any IP, with no credit card required to start.
Can I map many IPs to ASNs with an API?
Yes. Call the API for each IP and cache the results. This is the practical way to map large lists, since manual lookups do not scale.
How often does an IP's ASN change?
Not often, but networks do re-announce prefixes over time, so refresh cached ASN data periodically rather than treating it as permanent.


