API Documentation
The NexGeo API provides precise geolocation, timezone, ASN, and security intelligence data for any IP address. Built for speed and accuracy with global edge deployment.
Base URL
All API requests should be made to:
Fast
Sub-20ms latency globally
RESTful
JSON responses, standard HTTP
Secure
HTTPS only, API key auth
Authentication
Authenticate your API requests by including your API key in the X-API-Key header of every request. You can find your API key in the dashboard.
Keep your API key secret. Do not expose it in client-side code, public repositories, or share it with unauthorized users.
curl -H "X-API-Key: your_api_key_here" \
"https://api.nexgeo.dev/v1/geolocation?ip=8.8.8.8"
Geolocation
Look up the geographic location of an IP address. Returns country, region, city, coordinates, and more.
/v1/geolocation
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IPv4 or IPv6 address to look up |
| fields | string | Optional | Comma-separated list of fields to return |
| lang | string | Optional | Response language (default: en) |
Response
{
"ip": "8.8.8.8",
"type": "ipv4",
"country": {
"code": "US",
"name": "United States"
},
"region": {
"code": "CA",
"name": "California"
},
"city": "Mountain View",
"postal_code": "94035",
"latitude": 37.386,
"longitude": -122.0838,
"accuracy_radius": 1000
}
Timezone
Get timezone information for an IP address, including the IANA timezone identifier, UTC offset, and current local time.
/v1/timezone
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IPv4 or IPv6 address |
Response
{
"ip": "8.8.8.8",
"timezone": {
"id": "America/Los_Angeles",
"abbreviation": "PST",
"utc_offset": "-08:00",
"current_time": "2026-02-21T08:30:00-08:00",
"is_dst": false
}
}
ASN
Retrieve Autonomous System Number (ASN) information for an IP address, including the organization name and network range.
/v1/asn
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IPv4 or IPv6 address |
Response
{
"ip": "8.8.8.8",
"asn": {
"number": 15169,
"name": "GOOGLE",
"organization": "Google LLC",
"network": "8.8.8.0/24",
"type": "hosting"
}
}
Security
Plus+Get security intelligence for an IP address, including VPN, proxy, and Tor detection, threat classification, and abuse scoring.
/v1/security
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ip | string | Required | IPv4 or IPv6 address |
Response
{
"ip": "198.51.100.1",
"security": {
"is_vpn": true,
"is_proxy": false,
"is_tor": false,
"is_datacenter": true,
"threat_score": 72,
"threat_classification": "medium",
"last_reported": "2026-02-18T14:30:00Z"
}
}
Bulk Lookup
Plus+Look up multiple IP addresses in a single request. Supports up to 100 IPs per request. Results are returned in the same order as the input.
/v1/bulk
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| ips | string[] | Required | Array of IP addresses (max 100) |
| fields | string[] | Optional | Fields to include in each result |
Request Example
curl -X POST \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"ips": ["8.8.8.8", "1.1.1.1", "208.67.222.222"]}' \
"https://api.nexgeo.dev/v1/bulk"
Response
{
"results": [
{
"ip": "8.8.8.8",
"country": { "code": "US", "name": "United States" },
"city": "Mountain View"
},
{
"ip": "1.1.1.1",
"country": { "code": "AU", "name": "Australia" },
"city": "Sydney"
},
{
"ip": "208.67.222.222",
"country": { "code": "US", "name": "United States" },
"city": "San Francisco"
}
],
"count": 3
}
Response Format
All API responses are returned in JSON format with UTF-8 encoding. Successful responses return HTTP 200 with the data directly in the response body. Error responses include a structured error object.
Response body contains the requested data directly as a JSON object.
Response body contains an error object with details.
{
"error": {
"code": 429,
"type": "rate_limit_exceeded",
"message": "Rate limit exceeded. Please retry after 1 second."
}
}
Response Headers
| Header | Description |
|---|---|
| X-RateLimit-Limit | Maximum requests per second for your plan |
| X-RateLimit-Remaining | Remaining requests in the current window |
| X-Credits-Remaining | Remaining monthly API credits |
| X-Request-ID | Unique request identifier for debugging |
Rate Limits
Rate limits are enforced per API key using a sliding window algorithm. When you exceed the rate limit, the API returns a 429 Too Many Requests response with a Retry-After header.
| Plan | Requests/Month | Rate Limit | Burst |
|---|---|---|---|
| Free | 1,000 | 1 req/sec | 5 |
| Starter | 50,000 | 10 req/sec | 20 |
| Plus | 500,000 | 50 req/sec | 100 |
| Pro | 5,000,000 | 200 req/sec | 500 |
| Enterprise | Unlimited | Custom | Custom |
Tip: Use the X-RateLimit-Remaining response header to track your current rate limit status and implement client-side throttling.
Error Codes
The API uses standard HTTP status codes to indicate the success or failure of a request. Codes in the 2xx range indicate success, 4xx indicate client errors, and 5xx indicate server errors.
| Code | Type | Description |
|---|---|---|
| 400 | bad_request | The request was malformed or missing required parameters. Check the ip parameter format. |
| 401 | unauthorized | Missing or invalid API key. Ensure the X-API-Key header is set correctly. |
| 402 | quota_exceeded | Monthly API request quota has been exceeded. Upgrade your plan or wait until the next billing cycle. |
| 429 | rate_limit_exceeded | Too many requests per second. Wait for the duration specified in the Retry-After header. |
| 500 | internal_error | An unexpected server error occurred. Retry the request. If the issue persists, contact support. |
SDKs & Libraries
Official client libraries to integrate NexGeo into your application in minutes. All SDKs are open source and available on GitHub.
Node.js
npm install @nexgeo/node
import { NexGeo } from '@nexgeo/node';
const client = new NexGeo('your_api_key');
const data = await client.geolocation('8.8.8.8');
Python
pip install nexgeo
from nexgeo import NexGeo
client = NexGeo("your_api_key")
data = client.geolocation("8.8.8.8")
Go
go get github.com/nexgeo/go-sdk
client := nexgeo.NewClient("your_api_key")
data, err := client.Geolocation(ctx, "8.8.8.8")
cURL
Works everywhere
curl -H "X-API-Key: your_key" \
"https://api.nexgeo.dev/v1/geolocation?ip=8.8.8.8"