Documentation
Everything you need to integrate IPTruth IP intelligence into your application. Start with a simple API call and scale from there.
$ curl https://api.iptruth.com/ip/me { "ip": "203.0.113.42", "location": { "city": "San Francisco", "region": "California", "country_code": "US" } }
Getting Started
Quick start guides, authentication setup, and your first API call in minutes.
API Reference
Complete endpoint documentation with request/response schemas and examples.
SDKs & Libraries
Official client libraries for Python, Node.js, Go, Ruby, and more.
Guides
In-depth tutorials for common integration patterns and use cases.
Changelog
API updates, new features, and breaking change notifications.
Status
Real-time API uptime and system health monitoring.
Getting Started
Get up and running with the IPTruth API in three simple steps.
Get Your API Key
Sign up for a free account to get your API key. The free plan includes 1,000 lookups per day.
Sign Up FreeMake Your First Request
Use any HTTP client to query the API. Here's a quick example with curl:
$ curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.iptruth.com/api/v1/ip/8.8.8.8
Parse the Response
Use the response data in your application. Here are examples in popular languages:
import requests
response = requests.get(
"https://api.iptruth.com/api/v1/ip/8.8.8.8",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
data = response.json()
print(f"City: {data['city']}, Country: {data['country']}")
const response = await fetch(
"https://api.iptruth.com/api/v1/ip/8.8.8.8",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
const data = await response.json();
console.log(`City: ${data.city}, Country: ${data.country}`);
API Reference
Complete endpoint documentation for the IPTruth REST API.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/ip/{address} | Look up any IPv4 or IPv6 address |
| GET | /api/v1/ip/me | Look up the requesting IP |
| GET | /api/v1/asn/{number} | Get ASN details and prefixes |
| GET | /api/v1/asn/{number}/prefixes | Get announced prefixes |
| GET | /api/v1/asn/{number}/relationships | Get upstream/downstream/peer relationships |
Response Fields
| Field | Type | Description |
|---|---|---|
ip | string | The queried IP address |
city | string | City name |
region | string | State/province |
country | string | ISO 3166-1 alpha-2 country code |
latitude | number | Geographic latitude |
longitude | number | Geographic longitude |
timezone | string | IANA timezone identifier |
network.asn | number | Autonomous System Number |
network.name | string | Organization name |
network.bgp_status | string | BGP announcement status |
network.rpki_status | string | RPKI validation result (valid/invalid/unknown) |
security.is_vpn | boolean | VPN connection detected |
security.is_proxy | boolean | Proxy detected |
security.is_satellite | boolean | Satellite internet connection |
security.is_cgnat | boolean | Carrier-grade NAT detected |
security.risk_score | number | Risk score (0-100) |
Authentication
All API requests require authentication via Bearer token in the Authorization header.
Authorization: Bearer YOUR_API_KEY
Your API key is available in your dashboard after signing up.
Error Codes & Rate Limits
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request — Invalid IP address or ASN format |
401 | Unauthorized — Missing or invalid API key |
404 | Not Found — IP or ASN not in our database |
429 | Too Many Requests — Rate limit exceeded |
500 | Internal Server Error |
Rate limits are returned in response headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
SDKs & Libraries
Official SDKs are coming soon. In the meantime, our REST API works with any HTTP client in any language.
import requests
resp = requests.get(
"https://api.iptruth.com/api/v1/ip/8.8.8.8",
headers={"Authorization": "Bearer YOUR_API_KEY"}
)
print(resp.json())
const resp = await fetch(
"https://api.iptruth.com/api/v1/ip/8.8.8.8",
{ headers: { "Authorization": "Bearer YOUR_API_KEY" } }
);
console.log(await resp.json());
req, _ := http.NewRequest("GET",
"https://api.iptruth.com/api/v1/ip/8.8.8.8", nil)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
$ curl -H "Authorization: Bearer YOUR_API_KEY" \ https://api.iptruth.com/api/v1/ip/8.8.8.8
Integration Guides
Step-by-step tutorials for common use cases.
Fraud Prevention Integration
Use IP risk scoring and VPN detection to block fraudulent traffic in real time.
Ad Tech Geo-Targeting
Deliver geo-targeted ads with accurate IP-based location data and traffic validation.
GDPR Compliance Setup
Enforce data sovereignty and regulatory compliance with IP-based jurisdiction detection.
E-Commerce Localization
Automatically adjust currency, language, and shipping options based on visitor location.