IP & ASN Intelligence API with Monitoring
Look up a public IP address or an autonomous system. The answer names the AS, the country, the cloud or CDN range and whether the address is a Tor exit. The tools are free without an API key and work over REST and as MCP tools, for developers and AI agents.
What you can ask
ip_lookup. The AS, country, cloud or CDN range, Tor exit status, DROP listing and PTR name of a public IP address. A Pro caller fills the Shodan and AbuseIPDB slots with its own key. API docs
asn_lookup. An autonomous system by AS number or by an address it holds: name, country and prefixes. API docs
Example
curl https://api.contrastcyber.com/ip_lookup/8.8.8.8Example response, trimmed; the values are an example:
{
"ip_address": "8.8.8.8",
"asn": 15169,
"asn_name": "GOOGLE",
"asn_country": "US",
"geo_country": "US",
"cloud_provider": "google",
"cloud_service": "google",
"is_cdn": false,
"is_datacenter": true,
"is_tor_exit": false,
"listed_on": [],
"ptr": "dns.google"
}From an agent
Your agent calls these MCP tools: ip_lookup and asn_lookup. Connect once with the MCP setup, then ask in plain words.
- “Which AS and country does 8.8.8.8 belong to?”
- “Is this IP address a Tor exit or a cloud address?”
- “List the prefixes of AS15169.”
- “Tell me when 8.8.8.8 lands on the DROP list or moves to another host.”
Limits
Without a key you get 30 credits per hour. A Pro key gets 500 credits per hour. These tools have no bulk form.
Monitor it
A Pro key can watch public IP addresses, one address per item. Add an item with watchlist_edit. Then read its change events with watchlist_events. You pull the events when you want them.
An IP item names one address and makes no request to it. The server compares the address with its local lists about every 15 minutes, after one of the lists is updated. An event says when the address lands on the DROP list, when it leaves the list, and when its hosting changes, such as from one AS to a cloud range. The hosting event comes when the new class is seen again after both hosting lists were updated. A DROP event also carries the date and the copyright text of the list. They stay with the data, as the list asks.
| Watched endpoint | Events |
|---|---|
ip_lookup | drop_listed drop_unlisted hosting_changed |
See pricing for the Pro key. The security monitoring page lists every watched endpoint and its events.
Data sources
- IPtoASN: PDDL 1.0. Local copy.
/healthshows the sync state of each feed. - DB-IP IP to Country Lite: CC BY 4.0. IP Geolocation by DB-IP. Local copy.
- Tor bulk exit list (The Tor Project): local copy.
- DROP list: free under the DROP Fair Use Policy. Local copy.
- Cloud and CDN ranges: the address ranges that AWS, Google, Microsoft Azure, Cloudflare, Fastly, Bunny and Gcore publish. Local copy.
- PTR names: asked live from the server's own DNS resolver.
- Shodan and AbuseIPDB: asked live, only for a Pro key that saved its own Shodan or AbuseIPDB key at vendor keys. They fill the
internet_exposureandreputationmembers.
FAQ
- Does it support IPv6?
- Yes. ip_lookup and asn_lookup take public IPv4 and IPv6 addresses.
- Can I tell if an IP is a Tor exit or a cloud address?
- Yes. ip_lookup returns is_tor_exit, and the cloud provider, the service and is_cdn when a published range holds the address.
- Are the AS prefixes the same as BGP announcements?
- Not always. asn_lookup derives its prefixes from IPtoASN ranges, so they can differ from what the AS announces in BGP.
- Does it need an API key?
- No. Both tools work without a key, within the hourly credit limit.