Lookup IP Batch
POSThttps://api-ip-intelligence.dataandapis.com/v1/ip
Lookup IP Batch is an endpoint of the IP Intelligence API. Country, ASN, datacenter, cloud and Tor detection with an explainable risk score for any IP.
Send your key in the X-Api-Key header. Each call costs 1 token; a free key includes 500 tokens a month.
Request
Request body
{
"addresses": [
"8.8.8.8",
"2001:4860:4860::8888",
"3.5.140.10"
]
}Example request
curl
curl -X POST "https://api-ip-intelligence.dataandapis.com/v1/ip" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "addresses": [ "8.8.8.8", "2001:4860:4860::8888", "3.5.140.10" ] }'JavaScript / TypeScript (dataandapis package)
// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const data = await client.ipIntelligence.lookupIpBatch({
body: {
addresses: ["8.8.8.8", "2001:4860:4860::8888", "3.5.140.10"],
},
});Node.js (fetch)
const res = await fetch("https://api-ip-intelligence.dataandapis.com/v1/ip", {
method: "POST",
headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY, "Content-Type": "application/json" },
body: JSON.stringify({
"addresses": [
"8.8.8.8",
"2001:4860:4860::8888",
"3.5.140.10"
]
}),
});
const data = await res.json();Python (dataandapis package)
# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
data = client.ip_intelligence.lookup_ip_batch(
body={
"addresses": ["8.8.8.8", "2001:4860:4860::8888", "3.5.140.10"],
},
)Python (requests)
import os, requests
r = requests.post(
"https://api-ip-intelligence.dataandapis.com/v1/ip",
headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
json={
"addresses": [
"8.8.8.8",
"2001:4860:4860::8888",
"3.5.140.10"
]
},
)
data = r.json()Guide to the dataandapis npm package →Guide to the dataandapis Python package →
Example response
Example response{
"ok": true,
"count": 4,
"results": [
{
"ok": true,
"ip": "8.8.8.8",
"family": "ipv4",
"mapped_from": null,
"special_use": null,
"country": "US",
"registry_country": "US",
"country_matches_registry": true,
"asn": {
"number": 15169,
"organization": "GOOGLE",
"registry_country": "US",
"range": {
"start": "8.8.8.0",
"end": "8.8.8.255"
}
},
"hosting": null,
"is_datacenter": false,
"is_cdn": false,
"is_tor_exit": false,
"is_routed": true,
"risk": {
…
Show full response
Example response
{
"ok": true,
"count": 4,
"results": [
{
"ok": true,
"ip": "8.8.8.8",
"family": "ipv4",
"mapped_from": null,
"special_use": null,
"country": "US",
"registry_country": "US",
"country_matches_registry": true,
"asn": {
"number": 15169,
"organization": "GOOGLE",
"registry_country": "US",
"range": {
"start": "8.8.8.0",
"end": "8.8.8.255"
}
},
"hosting": null,
"is_datacenter": false,
"is_cdn": false,
"is_tor_exit": false,
"is_routed": true,
"risk": {
…{
"ok": true,
"count": 4,
"results": [
{
"ok": true,
"ip": "8.8.8.8",
"family": "ipv4",
"mapped_from": null,
"special_use": null,
"country": "US",
"registry_country": "US",
"country_matches_registry": true,
"asn": {
"number": 15169,
"organization": "GOOGLE",
"registry_country": "US",
"range": {
"start": "8.8.8.0",
"end": "8.8.8.255"
}
},
"hosting": null,
"is_datacenter": false,
"is_cdn": false,
"is_tor_exit": false,
"is_routed": true,
"risk": {
"score": 0,
"level": "none",
"reasons": []
}
},
{
"ok": true,
"ip": "2001:4860:4860::8888",
"family": "ipv6",
"mapped_from": null,
"special_use": null,
"country": "CA",
"registry_country": "US",
"country_matches_registry": false,
"asn": {
"number": 15169,
"organization": "GOOGLE",
"registry_country": "US",
"range": {
"start": "2001:4860:480d::",
"end": "2001:4860:4864:ffff:ffff:ffff:ffff:ffff"
}
},
"hosting": null,
"is_datacenter": false,
"is_cdn": false,
"is_tor_exit": false,
"is_routed": true,
"risk": {
"score": 10,
"level": "low",
"reasons": [
{
"signal": "country_mismatch",
"weight": 10,
"detail": "Geolocates to CA but the block is registered in US."
}
]
}
},
{
"ok": true,
"ip": "127.0.0.1",
"family": "ipv4",
"mapped_from": null,
"special_use": "loopback",
"country": null,
"registry_country": null,
"country_matches_registry": null,
"asn": null,
"hosting": null,
"is_datacenter": false,
"is_cdn": false,
"is_tor_exit": false,
"is_routed": false,
"risk": {
"score": 0,
"level": "none",
"reasons": []
}
},
{
"ok": false,
"ip": "not-an-ip",
"message": "Not a valid IPv4 or IPv6 address."
}
]
}