API Documentation
Integrate powerful IP geolocation data into your applications in minutes.
Getting Started
Endpoints
Overview
The IP-API API provides real-time IP geolocation data including country, region, city, latitude, longitude, ZIP code, time zone, and ISP information.
Base URL
https://ip-api.in/api/v1
Authentication
Authentication is optional for public endpoints but recommended for higher rate limits. You can authenticate your requests by including your API token in the Authorization header.
Accept: application/json
Rate Limits
API requests are rate-limited to ensure fair usage and system stability. Rate limits vary based on authentication status.
Guest Users
- No authentication required
- Rate limited by IP address
- Shared limit per IP
- Resets every 24 hours
Authenticated Users
- Requires API token
- Rate limited by user account
- 10x higher limit
- Resets every 24 hours
Rate Limit Headers
Every API response includes headers with your current rate limit status:
Rate Limit Exceeded Response
When you exceed your rate limit, you'll receive a 429 Too Many Requests response:
{
"success": false,
"message": "Daily rate limit exceeded. Please try again later.",
"error": "Too Many Requests",
"code": 429,
"retry_after": 86400,
"limit": 100,
"limit_type": "guest"
}
/ip/{ip_address}
Retrieve geolocation information for a specific IP address.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ip_address |
String | Yes | The IPv4 or IPv6 address you want to query (e.g., 8.8.8.8). |
Example Request
curl -X GET "https://ip-api.in/api/v1/ip/8.8.8.8" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"
Example Response
{
"success": true,
"message": "IP lookup successful",
"api_version": "v1",
"data": {
"ip": "8.8.8.8",
"country": "United States",
"country_code": "US",
"region": null,
"region_code": null,
"city": null,
"postal_code": null,
"latitude": 37.751,
"longitude": -97.822,
"timezone": "America/Chicago",
"continent": "North America",
"continent_code": "NA",
"asn": "AS15169",
"organization": "GOOGLE",
"is_in_european_union": false
}
}
/ip
Retrieve geolocation information for the IP address making the request (useful for client-side detection).
Example Request
curl -X GET "https://ip-api.in/api/v1/ip" \
-H "Accept: application/json"
/ip/bulk
Look up multiple IP addresses in a single request.
Request Body
{
"ips": ["8.8.8.8", "1.1.1.1"]
}
Example Request
curl -X POST "https://ip-api.in/api/v1/ip/bulk" \
-H "Content-Type: application/json" \
-d '{"ips": ["8.8.8.8", "1.1.1.1"]}'