IPIDB API documentation
One key for three JSON APIs: IP data, blacklist status and MAC vendor lookup. Plain HTTPS requests, CORS enabled, no SDK needed.
Overview
Base URL: https://api.ipidb.com/v1. Every endpoint returns JSON with Content-Type: application/json. Add ?pretty to any request for indented output. Responses carry Access-Control-Allow-Origin: *, so the API can be called from browser code.
| Endpoint | What it does | Plan | Counted as |
|---|---|---|---|
GET /ip/{ip} | Location, timezone, ASN, ISP and more | All | 1 IP lookup |
GET /ip | The same for the address the request comes from | All | 1 IP lookup |
POST /ip/batch | Many addresses in one request | Paid | 1 per address |
GET /blacklist/{ip} | Blacklist status, threat type and confidence | All | 1 blacklist check |
POST /blacklist/batch | Many addresses in one request | Paid | 1 per address |
GET /mac/{mac} | MAC vendor and address flags | All | 1 MAC lookup |
GET /mac/search?q= | OUI prefixes registered to a company | Paid | 1 MAC lookup |
GET /usage | Plan and quota of the key | All | Not counted |
A request to the base URL without a path returns this list as JSON.
Authentication
Every endpoint needs an API key. Create a free account and open the dashboard: the first key is created for you. Keys look like ipw_ followed by 40 hex characters. Send the key in one of three ways, checked in this order:
# Header (recommended) curl https://api.ipidb.com/v1/ip/8.8.8.8 -H "X-API-Key: YOUR_API_KEY" # Bearer token curl https://api.ipidb.com/v1/ip/8.8.8.8 -H "Authorization: Bearer YOUR_API_KEY" # Query string (quick tests only: the key ends up in logs) curl "https://api.ipidb.com/v1/ip/8.8.8.8?key=YOUR_API_KEY"
A request without a key gets HTTP 401 missing_key; a malformed or revoked key gets 401 invalid_key.
Keys used in browser code
A key that ships in JavaScript is visible to everyone. On the dashboard, edit the key and list the websites it may be used from (example.com, *.example.com). The API then accepts the key only when the request's Origin matches one of them.
Keys tied to server addresses
A key used only from your own servers can be limited to their IP addresses. The API then accepts it only from those addresses; requests from anywhere else get 403 ip_not_allowed. Each key can also carry a label, production or test, and can be rolled from the dashboard at any time: a new secret replaces the old one at once, while the name, label and lists stay.
Plans and quotas
The free plan gives each API its own daily allowance and returns the basic field set. A paid plan opens every field of all three APIs and pools one monthly quota across them. Prices and limits per plan are on the pricing page.
Free quotas reset at 00:00 UTC. Monthly quotas reset on the first day of the month at 00:00 UTC. An expired paid plan falls back to the free plan and the keys keep working.
Rate limits and headers
Each plan has a per-second limit. Requests over it get HTTP 429 rate_limited with Retry-After: 1. When the daily or monthly quota is used up, the API answers HTTP 429 quota_exceeded until it resets. Every successful response carries these headers, also exposed to browser code:
X-Plan: free X-RateLimit-Limit: 1 X-Quota-Limit: 1000 X-Quota-Remaining: 999 X-Quota-Reset: 1790380800
| Header | Meaning |
|---|---|
X-Plan | Plan of the key: free, starter, pro or business |
X-RateLimit-Limit | Requests per second allowed on the plan |
X-Quota-Limit | Quota of the current period: the daily allowance of this API on the free plan, the monthly pool on paid plans |
X-Quota-Remaining | Lookups left in the period after this request |
X-Quota-Reset | Unix time (UTC) when the period resets |
Response format
Successful responses have "success": true, the echoed input (ip or mac), the data grouped in objects, and a meta object with your plan, field level and quota:
"meta": { "plan": "free", "fields": "basic", "quota": { "limit": 1000, "used": 2, "remaining": 998, "period": "day", "resets_at": "2026-12-01T00:00:00+00:00" } }
Fields with no data are null, never missing. Booleans are real booleans and numbers are numbers.
Trimming the response
Add ?fields= with a comma-separated list of paths to keep only what you need; dots select nested keys. success, ip, mac, version and meta are always included and unknown paths are ignored. The filter also applies to every item of a batch.
{
"success": true,
"ip": "1.1.1.1",
"version": 4,
"location": { "country": "Australia" },
"network": { "isp": "Cloudflare" },
"meta": { "plan": "free", "fields": "basic" }
}IP lookup
GET /ip/{ip}GET /ip
Location, timezone and network data for any public IPv4 or IPv6 address. Without an address the API looks up the address the request comes from. Coordinates come with an accuracy radius: read them as an area, not a point.
{
"success": true,
"ip": "8.8.8.8",
"version": 4,
"location": {
"continent": "North America",
"continent_code": "NA",
"country": "United States",
"country_code": "US",
"region": "California",
"city": "Mountain View",
"postal_code": "94035",
"latitude": 37.38605,
"longitude": -122.08385,
"accuracy_radius_km": 1000,
"is_eu": false
},
"timezone": { "id": "America/Los_Angeles" },
"network": {
"asn": 15169,
"isp": "Google",
"organization": "Google LLC",
"domain": "google.com",
"connection_type": "hosting"
},
"meta": { "plan": "free", "fields": "basic" }
}Paid plans return the same objects with more keys, plus country_info, security and abuse.
Fields
| Field | Plan | Description |
|---|---|---|
location.country, country_code | All | Country name and ISO 3166-1 alpha-2 code |
location.region, city, postal_code | All | Region, city and postal code where known |
location.latitude, longitude, accuracy_radius_km | All | Estimated location and the radius it is expected to fall in |
location.address, address_type | Paid | Street address of the datacenter or office, where known |
timezone.id | All | IANA timezone, for example Europe/Berlin |
timezone.utc_offset, is_dst, current_time | Paid | Current UTC offset, daylight saving flag and local time |
network.asn | All | Autonomous system that announces the address |
network.isp, organization, domain | All | Service provider, registered organisation and its website |
network.connection_type | All | isp, cable, mobile, hosting, business, backbone, education, research, government, military, financial, healthcare, media, satellite, fixed_wireless or ixp |
network.asn_name, org_domain | Paid | Registered name of the AS and the organisation's domain |
network.holding, holding_domain | Paid | Parent company of the provider, when it is part of a group |
network.usage | Paid | What the range is used for, for example FTTH customers or mobile |
network.hostname | Paid | Reverse DNS name of the address |
network.range | Paid | The block the address belongs to |
network.rpki | Paid | valid, invalid, unrouted or not_found (IPv4) |
network.anycast | Paid | Set when the address is anycast: prefix, number of sites and countries, and the cities it answers from |
network.speed_mbps | Paid | Average download and upload speed of the provider, null when unknown |
country_info | Paid | Calling code, TLD, currency and languages of the country |
security.is_vpn, vpn_provider | Paid | Address belongs to a VPN service, and which one |
security.is_proxy, is_tor, is_hosting | Paid | Open proxy, Tor exit node, datacenter range |
security.verified_crawler | Paid | Set when the address is in a range a search engine or crawler operator publishes |
security.is_threat, threat_type, threat_confidence, threat_reports, threat_last_seen | Paid | Listed on the blacklist, with type, confidence 0 to 100, number of reports and the last one |
abuse.email | Paid | Abuse contact of the network |
Private and reserved addresses
Private, loopback, link-local, carrier-grade NAT, multicast, documentation and other reserved space is answered without a database lookup. The response is still counted and has a different shape:
{
"success": true,
"ip": "192.168.1.1",
"version": 4,
"reserved": true,
"reserved_type": "private",
"description": "Private network (RFC 1918)",
"security": { "is_private": true, "is_cgnat": false }
}A public address that is not in the database returns "found": false with a message.
Batch IP lookup
POST /ip/batchpaid plans
Up to 100 addresses per request on Starter and Pro, 1,000 on Business. The body is JSON: {"ips": ["8.8.8.8", "1.1.1.1"]}.
curl -X POST https://api.ipidb.com/v1/ip/batch \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ips": ["8.8.8.8", "1.1.1.1", "not-an-ip"]}'{
"success": true,
"count": 3,
"results": [
{ "success": true, "ip": "8.8.8.8", "version": 4, "location": { }, "network": { } },
{ "success": true, "ip": "1.1.1.1", "version": 4, "location": { }, "network": { } },
{ "success": false, "ip": "not-an-ip", "error": { "code": "invalid_ip", "message": "Not a valid IPv4 or IPv6 address." } }
],
"meta": { "plan": "pro", "fields": "full" }
}Invalid addresses fail inside results and do not fail the request. A batch larger than the plan allows is rejected with HTTP 400 batch_too_large; on the free plan the endpoint answers HTTP 402 plan_required.
Blacklist check
GET /blacklist/{ip}POST /blacklist/batchbatch: paid plans
Tells you whether an address was reported for brute-force attacks, spam, scanning or other abuse.
{
"success": true,
"ip": "193.46.255.86",
"listed": true,
"threat_type": "brute-force",
"confidence": 85,
"last_seen": "2026-11-20 10:47:05"
}
{ "success": true, "ip": "8.8.8.8", "listed": false }| Field | Plan | Description |
|---|---|---|
listed | All | Address is on the blacklist. When false, no other fields follow. |
threat_type | All | Main category, for example brute-force, spam, scanner, web-attack |
confidence | All | 0 to 100, grows with the number and spread of reports |
last_seen | All | Time of the most recent report (UTC) |
total_reports, distinct_reporters | Paid | Number of reports and of independent reporters |
first_seen | Paid | Time of the first report |
country_code, isp | Paid | Country and provider of the address when it was listed |
reports | Paid | Up to 20 most recent reports with type, message and time |
The batch endpoint takes the same body as the IP batch and has the same size limits.
MAC vendor lookup
GET /mac/{mac}GET /mac/search?q={company}search: paid plans
Resolves a MAC address or OUI prefix to the registered manufacturer; the most specific block wins. Any common format works: 00:1A:2B:3C:4D:5E, 00-1A-2B-3C-4D-5E, 001A.2B3C.4D5E or the first 6 hex digits alone.
{
"success": true,
"mac": "00:1A:2B:3C:4D:5E",
"found": true,
"oui": "00:1A:2B",
"normalized": "00:1A:2B:3C:4D:5E",
"is_multicast": false,
"is_local": false,
"is_randomized": false,
"vendor": { "company": "Ayecom Technology Co., Ltd.", "country_code": "TW" }
}Paid plans add the vendor's website, address and company details, the registry block (type, start, end, size) and device (type, interface, virtual machine platform). /mac/search?q= lists the prefixes registered to companies whose name contains the query (at least two characters, up to 100 results).
Usage of a key
GET /usagenot counted
Returns the plan, the per-second limit and the counters of the account the key belongs to. The dashboard shows usage per key and per day and exports it as CSV. Request logs are kept for 120 days.
{
"success": true,
"plan": { "code": "free", "name": "Free", "expires_at": null },
"rate_limit_per_second": 1,
"today": { "ip": 7, "blacklist": 1, "mac": 3, "rejected": 5 },
"daily_quota": { "ip": 1000, "blacklist": 1000, "mac": 1000 }
}Errors
Errors use HTTP status codes and a JSON body with "success": false and an error object. The code is stable and meant for your program; the message is for people and may change.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_ip | Not a valid IPv4 or IPv6 address |
| 400 | invalid_mac | Fewer than 6 or more than 12 hex digits |
| 400 | invalid_query | MAC search with fewer than 2 characters |
| 400 | empty_batch | Batch request without addresses |
| 400 | batch_too_large | More addresses than the plan allows per batch |
| 400 | unavailable | The blacklist or MAC database is briefly unavailable; retry later |
| 401 | missing_key | No API key in the request |
| 401 | invalid_key | Malformed, unknown or revoked key |
| 402 | plan_required | Batch or MAC search on the free plan |
| 403 | origin_not_allowed | The key is limited to websites and the request came from elsewhere |
| 403 | ip_not_allowed | The key is limited to IP addresses and the request came from another one |
| 403 | account_suspended | The account is suspended; contact support |
| 404 | not_found | Unknown endpoint |
| 429 | rate_limited | Per-second limit exceeded; Retry-After: 1 is set |
| 429 | quota_exceeded | Daily or monthly quota used up; X-Quota-Reset says when it resets |
Code samples
Replace YOUR_API_KEY with a key from the dashboard. Each sample looks up 8.8.8.8 and prints the city and ISP.
import requests
r = requests.get("https://api.ipidb.com/v1/ip/8.8.8.8",
headers={"X-API-Key": "YOUR_API_KEY"}, timeout=10)
data = r.json()
if data["success"]:
print(data["location"]["city"], data["network"]["isp"])
else:
print(r.status_code, data["error"]["code"], data["error"]["message"])$ch = curl_init("https://api.ipidb.com/v1/ip/8.8.8.8");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
CURLOPT_HTTPHEADER => ["X-API-Key: YOUR_API_KEY"],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!empty($data["success"])) {
echo $data["location"]["city"], " ", $data["network"]["isp"];
} else {
echo $data["error"]["code"], ": ", $data["error"]["message"];
}const r = await fetch("https://api.ipidb.com/v1/ip/8.8.8.8", {
headers: { "X-API-Key": "YOUR_API_KEY" }
});
const data = await r.json();
if (data.success) {
console.log(data.location.city, data.network.isp);
} else {
console.error(r.status, data.error.code, data.error.message);
}Earlier base URL
The API was first published at https://ipwhois.net/api/v1. That address keeps working with the same keys, the same responses and the same quota, so nothing you built on it breaks. New integrations should use https://api.ipidb.com/v1.
Attribution and licence
On the free plan, attribution is required: show a visible credit such as "IP data by IPIDB" linking to ipidb.com wherever you display data from the API. Paid plans have no attribution requirement.
The database includes GeoLite2 data created by MaxMind, available from maxmind.com, and the IP2Location LITE database from lite.ip2location.com. When you redistribute or display free-plan data, keep those credits together with ours.
Need higher volumes, a database licence or a custom limit? Write to us with your expected volume.