API Documentation

Everything you need to integrate IPLocatePro into your application.

Authentication

All API requests require an API key passed in the X-API-Key header.

curl -H "X-API-Key: your_api_key" http://iplocatepro.com/v1/locate/8.8.8.8

Endpoints

GET /v1/locate/{ip}

Get geolocation data for a specific IP address.

Parameters

ip IPv4 or IPv6 address

Response

{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "region_code": "CA",
  "city": "Mountain View",
  "postal_code": "94035",
  "latitude": 37.386,
  "longitude": -122.0838,
  "timezone": "America/Los_Angeles"
}
GET /v1/locate?ip={ip}

Alternative endpoint using query parameter instead of path parameter.

GET /v1/asn/{ip}

Get ASN (Autonomous System Number) information for an IP address.

Parameters

ip IPv4 or IPv6 address

Response

{
  "ip": "8.8.8.8",
  "asn": 15169,
  "organization": "GOOGLE",
  "network": "8.8.8.0/24"
}
GET /v1/asn?ip={ip}

Alternative endpoint using query parameter instead of path parameter.

GET /v1/timezone/{ip}

Get timezone information for an IP address including current local time.

Parameters

ip IPv4 or IPv6 address

Response

{
  "ip": "8.8.8.8",
  "timezone": "America/Los_Angeles",
  "utc_offset": "-0800",
  "current_time": "2024-01-15T14:30:45.123456-08:00",
  "is_dst": false
}
GET /v1/timezone?ip={ip}

Alternative endpoint using query parameter instead of path parameter.

GET /v1/country/{ip}

Fast, lightweight country lookup for an IP address. Returns only country and continent data.

Parameters

ip IPv4 or IPv6 address

Response

{
  "ip": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "continent": "North America",
  "continent_code": "NA"
}
GET /v1/country?ip={ip}

Alternative endpoint using query parameter instead of path parameter.

GET /v1/ip

Get the caller's public IP address. No authentication required.

{
  "ip": "203.0.113.45"
}
GET /v1/health/

Health check endpoint. No authentication required.

{
  "service": "IPLocatePro",
  "version": "1.0.0",
  "status": "operational",
  "databases": {
    "city": true,
    "asn": true,
    "country": true
  }
}

Error Responses

Status Error Code Description
401 missing_api_key X-API-Key header not provided
401 invalid_api_key API key not found
400 invalid_ip Malformed IP address
404 not_found No data for this IP
429 rate_limited Daily request limit exceeded

Rate Limits

Plan Requests per Day
Free 1,000
Pro 100,000
Enterprise 1,000,000