Documentation

Everything you need to integrate IPTruth IP intelligence into your application. Start with a simple API call and scale from there.

Terminal
$ 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.

1

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 Free
2

Make Your First Request

Use any HTTP client to query the API. Here's a quick example with curl:

Terminal
$ curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.iptruth.com/api/v1/ip/8.8.8.8
3

Parse the Response

Use the response data in your application. Here are examples in popular languages:

python
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']}")
javascript
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

MethodEndpointDescription
GET/api/v1/ip/{address}Look up any IPv4 or IPv6 address
GET/api/v1/ip/meLook up the requesting IP
GET/api/v1/asn/{number}Get ASN details and prefixes
GET/api/v1/asn/{number}/prefixesGet announced prefixes
GET/api/v1/asn/{number}/relationshipsGet upstream/downstream/peer relationships

Response Fields

FieldTypeDescription
ipstringThe queried IP address
citystringCity name
regionstringState/province
countrystringISO 3166-1 alpha-2 country code
latitudenumberGeographic latitude
longitudenumberGeographic longitude
timezonestringIANA timezone identifier
network.asnnumberAutonomous System Number
network.namestringOrganization name
network.bgp_statusstringBGP announcement status
network.rpki_statusstringRPKI validation result (valid/invalid/unknown)
security.is_vpnbooleanVPN connection detected
security.is_proxybooleanProxy detected
security.is_satellitebooleanSatellite internet connection
security.is_cgnatbooleanCarrier-grade NAT detected
security.risk_scorenumberRisk score (0-100)

Authentication

All API requests require authentication via Bearer token in the Authorization header.

HTTP Header
Authorization: Bearer YOUR_API_KEY

Your API key is available in your dashboard after signing up.

Error Codes & Rate Limits

CodeDescription
200Success
400Bad Request — Invalid IP address or ASN format
401Unauthorized — Missing or invalid API key
404Not Found — IP or ASN not in our database
429Too Many Requests — Rate limit exceeded
500Internal 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.

python
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())
javascript
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());
go
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))
Terminal
$ 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.