IPIDB
API reference

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.

EndpointWhat it doesPlanCounted as
GET /ip/{ip}Location, timezone, ASN, ISP and moreAll1 IP lookup
GET /ipThe same for the address the request comes fromAll1 IP lookup
POST /ip/batchMany addresses in one requestPaid1 per address
GET /blacklist/{ip}Blacklist status, threat type and confidenceAll1 blacklist check
POST /blacklist/batchMany addresses in one requestPaid1 per address
GET /mac/{mac}MAC vendor and address flagsAll1 MAC lookup
GET /mac/search?q=OUI prefixes registered to a companyPaid1 MAC lookup
GET /usagePlan and quota of the keyAllNot 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:

Three ways to send the key
# 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:

Response headers
X-Plan: free
X-RateLimit-Limit: 1
X-Quota-Limit: 1000
X-Quota-Remaining: 999
X-Quota-Reset: 1790380800
HeaderMeaning
X-PlanPlan of the key: free, starter, pro or business
X-RateLimit-LimitRequests per second allowed on the plan
X-Quota-LimitQuota of the current period: the daily allowance of this API on the free plan, the monthly pool on paid plans
X-Quota-RemainingLookups left in the period after this request
X-Quota-ResetUnix 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, on every metered response
"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.

GET/ip/1.1.1.1?fields=location.country,network.isp
{
  "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.

GET/ip/8.8.8.8 on the free plan (basic fields)
{
  "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

FieldPlanDescription
location.country, country_codeAllCountry name and ISO 3166-1 alpha-2 code
location.region, city, postal_codeAllRegion, city and postal code where known
location.latitude, longitude, accuracy_radius_kmAllEstimated location and the radius it is expected to fall in
location.address, address_typePaidStreet address of the datacenter or office, where known
timezone.idAllIANA timezone, for example Europe/Berlin
timezone.utc_offset, is_dst, current_timePaidCurrent UTC offset, daylight saving flag and local time
network.asnAllAutonomous system that announces the address
network.isp, organization, domainAllService provider, registered organisation and its website
network.connection_typeAllisp, cable, mobile, hosting, business, backbone, education, research, government, military, financial, healthcare, media, satellite, fixed_wireless or ixp
network.asn_name, org_domainPaidRegistered name of the AS and the organisation's domain
network.holding, holding_domainPaidParent company of the provider, when it is part of a group
network.usagePaidWhat the range is used for, for example FTTH customers or mobile
network.hostnamePaidReverse DNS name of the address
network.rangePaidThe block the address belongs to
network.rpkiPaidvalid, invalid, unrouted or not_found (IPv4)
network.anycastPaidSet when the address is anycast: prefix, number of sites and countries, and the cities it answers from
network.speed_mbpsPaidAverage download and upload speed of the provider, null when unknown
country_infoPaidCalling code, TLD, currency and languages of the country
security.is_vpn, vpn_providerPaidAddress belongs to a VPN service, and which one
security.is_proxy, is_tor, is_hostingPaidOpen proxy, Tor exit node, datacenter range
security.verified_crawlerPaidSet 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_seenPaidListed on the blacklist, with type, confidence 0 to 100, number of reports and the last one
abuse.emailPaidAbuse 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:

GET/ip/192.168.1.1
{
  "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"]}.

Request
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"]}'
Response
{
  "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.

GET/blacklist/{ip}, a listed and a clean address
{
  "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 }
FieldPlanDescription
listedAllAddress is on the blacklist. When false, no other fields follow.
threat_typeAllMain category, for example brute-force, spam, scanner, web-attack
confidenceAll0 to 100, grows with the number and spread of reports
last_seenAllTime of the most recent report (UTC)
total_reports, distinct_reportersPaidNumber of reports and of independent reporters
first_seenPaidTime of the first report
country_code, ispPaidCountry and provider of the address when it was listed
reportsPaidUp 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.

GET/mac/00:1A:2B:3C:4D:5E on the free plan
{
  "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.

GET/usage on the free plan
{
  "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.

HTTPCodeWhen
400invalid_ipNot a valid IPv4 or IPv6 address
400invalid_macFewer than 6 or more than 12 hex digits
400invalid_queryMAC search with fewer than 2 characters
400empty_batchBatch request without addresses
400batch_too_largeMore addresses than the plan allows per batch
400unavailableThe blacklist or MAC database is briefly unavailable; retry later
401missing_keyNo API key in the request
401invalid_keyMalformed, unknown or revoked key
402plan_requiredBatch or MAC search on the free plan
403origin_not_allowedThe key is limited to websites and the request came from elsewhere
403ip_not_allowedThe key is limited to IP addresses and the request came from another one
403account_suspendedThe account is suspended; contact support
404not_foundUnknown endpoint
429rate_limitedPer-second limit exceeded; Retry-After: 1 is set
429quota_exceededDaily 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.

Python (requests)
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"])
PHP (curl)
$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"];
}
Node.js (fetch)
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.