API v0 · OpenAPI 3.1
IP Geolocation API Docs
Look up any IPv4 or IPv6 address and get location with a transparent accuracy_radius_km and
confidence, plus ASN / network data and Tor exit, known VPN network, privacy relay and hosting/datacenter flags. One REST endpoint, JSON responses.
Free: 1,000 req/month · HTTPS · personal & non-commercial use
Quickstart
- Base URL —
https://api.networkdatalabs.com - Auth — send your key as
Authorization: Bearer YOUR_API_KEY. For quick tests you can also pass?api_key=YOUR_API_KEY; prefer the header in production. Missing or unknown keys return401 UNAUTHORIZED. - Format — JSON over HTTPS. All endpoints are versioned under
/v0. - Postman — Run in Postman to try every endpoint from the public collection. Set the
apiKeyenvironment variable to your own API key first.
Look up a single IP:
$ curl -s https://api.networkdatalabs.com/v0/ip/8.8.8.8 \ -H "Authorization: Bearer YOUR_API_KEY" { "ip": "8.8.8.8", "location": { "continent_code": "NA", "country_code": "US", "country": "United States", "is_eu": false, "region": "California", "region_code": "CA", "city": "Mountain View", "postal": null, "latitude": 37.422, "longitude": -122.085, "timezone": "America/Los_Angeles", "accuracy_radius_km": 50.0, "confidence": "medium" }, "network": { "asn": 15169, "as_org": "Google LLC", "isp": "Google LLC", "organization": "Google LLC", "network": "8.8.8.0/24" }, "traits": { "is_anycast": true, "is_hosting": true, "is_mobile": false, "is_satellite": false, "is_bogon": false, "is_proxy": false, "is_vpn": false, "is_tor": false, "is_relay": false } }
Note the radius: 8.8.8.8 is anycast, so it is answered from many places at once; the response tells you how precise the location is with
accuracy_radius_km: 50.0 and confidence: "medium".
Endpoints
GET /v0/ip/{ip}— full lookup for one IPv4 or IPv6 address: location, network and traits. Malformed IPs return400 INVALID_IP.GET /v0/ip— the same lookup for your own public IP (the address the request comes from). Counts toward the account quota like any other lookup.GET /v0/asn/{asn}— Autonomous System detail (15169orAS15169):name,org,domain,type(hosting, isp, education, government, business, unknown),country_code,rirandprefixes_sample. Unknown ASNs return404 NOT_FOUND.POST /v0/bulk— look up to 100 IPs in one request with body{"ips": [...]}. Paid plans only (Starter and up); Free keys get403 PLAN_REQUIREDbefore the body is read. Returnsresultskeyed by IP; per-IP failures go inerrors, so one bad IP doesn’t fail the batch.GET /v0/me— your apparent IP plusplan, current-periodusage(used, limit, remaining, reset_at) and planlimits(per-second, quota, key cap, bulk). Handy for validating a key.
$ curl -s https://api.networkdatalabs.com/v0/bulk \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ips": ["8.8.8.8", "1.1.1.1", "9.9.9.9"]}' { "results": { "8.8.8.8": { … }, "1.1.1.1": { … }, "9.9.9.9": { … } }, "errors": {} }
Response fields
location—continent_code,country_code(ISO 3166-1 alpha-2),country,is_eu,region,region_code,city,postal,latitude,longitude,timezone(IANA). For country-only use cases, see the IP to country API.location.accuracy_radius_km— estimated accuracy radius in kilometers, always present when geo is returned. A wide radius (e.g. 1000) means the city is a best-effort guess.location.confidence— qualitative confidence in the geo estimate:high|medium|low|unknown.network—asn,as_org,isp,organization,network(containing CIDR prefix) andrir(ARIN, LACNIC, RIPE, APNIC, AFRINIC).traits— booleans for risk and fraud checks. What each one detects:is_tor(the IP is a current Tor exit node; exit nodes only, not guard/middle relays or bridges),is_relay(the IP is a privacy relay egress),is_vpn(the IP belongs to a known VPN network; it catches major commercial VPN providers; whole networks of VPN-heavy hosting providers are flagged, so other servers there are flagged too; privacy relay IPs areis_relay, notis_vpn; overview and limits on the VPN detection API page),is_hosting(hosting/datacenter detection),is_satellite(satellite internet),is_mobile(mobile carrier networks; an estimate that may also flag some business/static or fixed-wireless blocks from those carriers),is_bogon(private / reserved ranges) andis_anycast(true only for a fixed set of well-known anycast DNS resolvers such as8.8.8.8and1.1.1.1).
Errors and rate limits
Errors use one shape: {"error": {"code": "…", "message": "…"}}, with codes such as
INVALID_IP, UNAUTHORIZED, PLAN_REQUIRED, KEY_RESTRICTED,
NOT_FOUND, RATE_LIMITED and QUOTA_EXCEEDED.
Exceeding the rate limit or the account quota returns 429 with
limit, reset_at, plan (current plan), and upgrade_url
(https://networkdatalabs.com/pricing) on the error object.
suggested_plan is the next tier (omitted on Scale). The same
plan and upgrade_url fields are on 403 PLAN_REQUIRED
(bulk and other paid-only features). 429 responses also include
Retry-After,
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
(plus X-RateLimit-Limit-Month / X-RateLimit-Remaining-Month
on Free and paid calendar-month plans).
Free is 1 request/second with no burst, and a hard 1,000 requests per UTC calendar month (no buffer; resets on the 1st). Paid plans are a strict per-second window with no burst (Starter 10/s, Growth 25/s, Scale 50/s) and allow a 10% buffer over the
monthly quota, then QUOTA_EXCEEDED. Quotas reset at the
start of the next UTC calendar month. Counters are per account (all keys combined) and
live in memory on the API machine (a single Fly VM today), refreshed from stored usage every
few minutes. A bulk call counts as 1 request toward the per-second limit and as N (one per IP)
toward the quota. If a key has origin or IP allowlists and the request matches neither, the API
returns 403 KEY_RESTRICTED
(Origin header, else Referer host; client IP from Fly-Client-IP on Fly, else the
socket peer — never X-Forwarded-For). After a plan downgrade, extra keys stay valid
until revoked and existing allowlists keep being enforced (Free can only clear them).
Free tier and API keys
The Free plan includes 1 request/second and 1,000 requests per UTC calendar month.
Free is for personal and non-commercial use; commercial use requires a paid plan.
Risk flags (is_hosting, is_proxy, is_vpn, is_tor, is_relay)
are omitted on Free keys; bulk lookup is paid-only.
See pricing for paid tiers. Sign up below to create a free account and get your API key instantly after email confirmation.