API Documentation

IPPriv API

Free, fast, and privacy-focused IP geolocation API. No authentication required.

~50ms
Response Time
100%
Uptime SLA
Free
No API Key Required

Getting Started

Base URL

https://api.ippriv.com

Authentication

No authentication required. All endpoints are publicly accessible.

Rate Limiting

100 requests per hour per IP address.

CORS

CORS enabled for all origins. Call the API directly from frontend.

Endpoints

GET/api/ip

Detect client IP address

Response Example
{
  "ipv4": "5.50.177.22",
  "timestamp": "2025-12-29T13:27:40.560Z"
}
GET/api/geo/:ip

Get geolocation information for an IP address

Response Example
{
  "ip": "8.8.8.8",
  "country": "United States",
  "countryCode": "US",
  "region": "Virginia",
  "city": "Ashburn",
  "lat": 39.03,
  "lon": -77.5,
  "timezone": "America/New_York",
  "isp": "Google LLC"
}
GET/api/dns/:ip

Get DNS information (hostname, PTR records)

Response Example
{
  "ip": "1.1.1.1",
  "hostname": "one.one.one.one",
  "ptrRecords": [
    "one.one.one.one"
  ]
}
GET/api/security/:ip

Check security status (VPN, Proxy, Tor, Hosting detection)

Response Example
{
  "ip": "5.50.177.22",
  "isVPN": false,
  "isProxy": false,
  "isTor": false,
  "isHosting": false,
  "asn": "AS5410 Bouygues Telecom SA",
  "org": "Bouygues Telecom SA"
}
GET/api/headers

Get HTTP headers of the request

Response Example
{
  "user-agent": "Mozilla/5.0...",
  "accept-language": "en-US,en;q=0.9",
  "cf-connecting-ip": "5.50.177.22"
}

Code Examples

cURL

# Get your IP
curl https://api.ippriv.com/api/ip

# Get geolocation
curl https://api.ippriv.com/api/geo/8.8.8.8

# Get DNS info
curl https://api.ippriv.com/api/dns/1.1.1.1

# Security check
curl https://api.ippriv.com/api/security/5.50.177.22

JavaScript

// Using fetch
const getIPInfo = async () => {
  const ipRes = await fetch('https://api.ippriv.com/api/ip');
  const { ipv4 } = await ipRes.json();
  
  const geoRes = await fetch(`https://api.ippriv.com/api/geo/${ipv4}`);
  const geo = await geoRes.json();
  
  const secRes = await fetch(`https://api.ippriv.com/api/security/${ipv4}`);
  const security = await secRes.json();
  
  return { ipv4, geo, security };
};

getIPInfo().then(data => console.log(data));

Python

import requests

response = requests.get('https://api.ippriv.com/api/ip')
ip_data = response.json()
ipv4 = ip_data['ipv4']

geo_response = requests.get(f'https://api.ippriv.com/api/geo/{ipv4}')
geo = geo_response.json()

sec_response = requests.get(f'https://api.ippriv.com/api/security/{ipv4}')
security = sec_response.json()

print(f"IP: {ipv4}")
print(f"Location: {geo['city']}, {geo['country']}")
print(f"ISP: {geo['isp']}")
print(f"VPN: {security['isVPN']}")

Error Handling

The API uses standard HTTP status codes. Errors return JSON:

{
  "error": "Invalid IP address format"
}
200Success
400Bad Request (invalid IP format)
429Rate Limit Exceeded
500Internal Server Error