IP Geolocation API
IPv4 + IPv6
Batch: 100 IPs
ASN data

Where is this IP from?City, ASN, and coordinates.

Resolve any IPv4 or IPv6 address to country, region, city, latitude/longitude, ASN, and organization. PostgreSQL-backed for speed — single calls or batches up to 100.

IPv4 + IPv6 · full coverage100 · IPs per batchASN · + organizationGET + POST · dual methods

Why IP Geolocation API

Geo-aware in one call.

Country → City
Resolve country, region, and city with latitude/longitude coordinates ready to drop into a map component.
ASN + Org
Every result includes the Autonomous System Number (ASN), network CIDR, and the registered organization.
IPv4 and IPv6
Full coverage across IPv4 dotted-decimal and IPv6 (full or compressed). Mixed batches accepted.
Batch Processing
Send up to 100 IPs per request via comma-separated list or JSON array. Per-item success/failure tracking included.
PostgreSQL-Backed
Network-block lookups against an indexed PostgreSQL store with CIDR matching — fast cold reads, fast warm reads.
GET or POST
Dual endpoint architecture: simple GET for tooling, POST when you need a JSON body or array input.

/api/v1/ip-geolocation

Endpoints, at a glance.

Single or batch, GET or POST — call shape your codebase already speaks.

GET / POST/ip-geolocation
Single IP lookup
Resolve one IP to country, region, city, coordinates, ASN, and organization.
PRIMARY
GET / POST/ip-geolocation/batch
Batch lookup (≤100)
Resolve up to 100 IPs in a single call. GET takes comma-separated; POST takes a JSON array.
GET/ip-geolocation/batch/info
Batch capabilities
Returns batch size limits, response format, and an example payload.
GET/health
Service health
Status, version, and timestamp.
GET/metrics
Prometheus metrics
Lookup counts, batch processing metrics, and DB query performance.
ParameterTypeRequiredDescription
ipstring | arrayyesSingle IP ("8.8.8.8"), comma-separated list, or JSON array (POST) up to 100 IPs.
include_logsbooleannoEnable database logging for successful lookups (batch).
api_keystringyesAPI key via query string. Alternatively pass as x-api-key header.

Requests & responses.

GET for single IPs, POST for batches with a JSON body. Mix IPv4 and IPv6 freely.

Single IP
One IP → one JSON object.
GET https://datpaq.com/api/v1/ip-geolocation?api_key=YOUR_API_KEY&ip=8.8.8.8
Batch (≤100)
Summary stats plus per-item results array.
POST https://datpaq.com/api/v1/ip-geolocation/batch
Content-Type: application/json

{
  "ip": ["8.8.8.8", "1.1.1.1", "208.67.222.222"],
  "include_logs": false
}
Health
https://datpaq.com/api/v1/ip-geolocation/health
Metrics
https://datpaq.com/api/v1/ip-geolocation/metrics

Error reference

Predictable errors, always structured.

Single-IP errors return a JSON error object. Batch responses surface invalid items in an invalid_ips array so the rest still processes.

400Invalid IP Address
A non-IP string was passed. Must be valid IPv4 (e.g. "8.8.8.8") or IPv6 (e.g. "2001:db8::1").
400Invalid Batch Format
Batch payload was not an array. POST must send `ip` as an array; GET must use a comma-separated list.
400Batch Size Exceeded
More than 100 IPs in a single request. Split into smaller batches and call sequentially.
401Unauthorized
API key missing or invalid. Pass api_key as a query param or x-api-key as a header.
404IP Not Found
Valid IP but no record in the geolocation database. Common for very new or reserved ranges.
500Server Error
Internal lookup failure. Use the correlationId in the logs/headers to debug.
Example error response
{
  "error": "Batch size exceeds maximum of 100 IPs",
  "requested": 150,
  "maximum": 100
}

FAQ

API questions developers ask first.

How do I authenticate with this API?

Create an API key in your Datpaq dashboard and send it with each request as a bearer token in the Authorization header.

Is there a free tier?

Yes. Datpaq APIs include a free tier for building, testing, and small production workloads before you move to a paid plan.

What format do requests and responses use?

Datpaq APIs use REST over HTTPS and return JSON by default. Endpoint docs show the supported methods, query parameters, request bodies, and response fields.

Where can I see limits and errors?

Each API documents rate limits, validation rules, and error responses in the landing page and API docs so integrations can retry and fail cleanly.

From IP to map pin, in one call.

Resolve any IPv4 or IPv6 to city, ASN, and coordinates. One single endpoint, one batch endpoint, the same bearer auth as the rest of the catalog.