Earth Geolocation API
Sign in to access your API dashboard
Don't have an account?
Professional IP Geolocation & Analytics
Enterprise-grade APIs with comprehensive dashboards, real-time monitoring, and flexible pricing tiers
IP Geolocation API
Accurate IP-to-location mapping with comprehensive geographic data including country, region, city, coordinates.
- 99.9% accuracy for country detection
- Single & batch IP lookup support
Real-time Analytics
Comprehensive usage analytics with detailed request history, performance metrics, and geographic insights for all your API calls.
- Real-time request monitoring
- Geographic usage insights
- Performance & error tracking
Comprehensive Dashboard
Professional dashboard with API key management, usage monitoring, subscription control.
- API key management & rotation
- Usage limits & notifications
- Subscription tier management
Complete Geographic Data
Access comprehensive country, state, and city information with coordinates, translations, and hierarchical relationships.
- 195+ countries with detailed info
- 5,000+ states & regions covered
- 150,000+ cities with coordinates
Flexible Subscription Tiers
Choose from Free, Paid, and Premium tiers with different request limits, features, and analytics capabilities. Easy upgrades and downgrades.
- Free tier with 1,000 requests/month
- No setup fees or hidden costs
- Cancel or upgrade anytime
Enterprise-Grade Support
Professional support with comprehensive documentation, interactive examples, and dedicated assistance for enterprise customers.
- Comprehensive API documentation
- Interactive code examples
- Priority email & chat support
Perfect for Every Use Case
From fraud prevention to content localization - our IP geolocation API powers it all
Security & Fraud Prevention
Detect suspicious activities, prevent fraud, and implement location-based security measures with accurate IP geolocation data.
Content Localization
Deliver personalized content based on user location, show relevant products, and customize experiences for different regions.
Analytics & Business Intelligence
Enhance business intelligence with geographic insights, user demographics, and location-based analytics for better decision making.
E-commerce & Payments
Streamline checkout with address validation, tax calculations, shipping estimates, and payment fraud detection based on location.
Mobile & Web Applications
Build location-aware apps with user registration forms, store locators, geo-targeted advertising, and location-based services.
Compliance & Regulations
Ensure GDPR compliance, implement geo-blocking, manage data sovereignty requirements, and meet regional regulations.
AI-Powered Development
Copy, Paste, and Go Live in Minutes
Our OpenAPI 3.1 specification makes integration effortless. Upload to any LLM (ChatGPT, Claude, GitHub Copilot) and get instant, production-ready code in your preferred programming language.
LLM-Ready OpenAPI Spec
Download our complete OpenAPI 3.1 specification and upload it to any AI coding assistant:
How to Use the OpenAPI Spec
The downloaded OpenAPI JSON specification contains complete documentation of our Earth API. Use it with various tools and LLMs for integration, testing, and development.
1
LLM Integration (ChatGPT, Claude, etc.)
π€ Upload to LLM:
- β’ Open ChatGPT, Claude, or your preferred LLM
- β’ Upload the downloaded JSON file
- β’ Ask: "Help me integrate with this API"
Example Prompts:
- β’ "Generate Python code to get country data"
- β’ "Create a JavaScript client for IP lookup"
- β’ "Show me the authentication requirements"
2
Development Tools
π οΈ Code Generation:
- β’ Swagger Codegen: Generate client SDKs
- β’ OpenAPI Generator: Create API clients
- β’ Postman: Import for testing
Quick Commands:
# Generate Python client
openapi-generator-cli generate \
-i earth-api-docs.json \
-g python \
-o ./earth-api-client
π Step-by-Step Usage Guide
Download & Save the Spec
- β’ Click "Download For LLM" button above
- β’ Save the
earth-api-docs-YYYY-MM-DD.jsonfile - β’ Keep it accessible for your tools
Choose Your Integration Method
For LLMs:
Upload directly to get instant help
For Development:
Import into your IDE or tools
Get Your API Key
π Remember: You'll need an API key from your Dashboard to make actual API calls.
Start Building
- β’ Use the spec to understand endpoints and parameters
- β’ Generate client code or make manual requests
- β’ Test with your API key in the Authorization header
- β’ Refer back to this documentation for examples
π§ Popular Tools That Support OpenAPI
Testing Tools
- β’ Postman
- β’ Insomnia
- β’ Thunder Client (VS Code)
- β’ Swagger UI
Code Generation
- β’ OpenAPI Generator
- β’ Swagger Codegen
- β’ NSwag Studio
- β’ AutoRest
AI Assistants
- β’ ChatGPT
- β’ Claude
- β’ GitHub Copilot
- β’ Cursor AI
π‘ Pro Tips
- β’ The spec includes all endpoint details, parameters, and response schemas
- β’ Look for "x-tier-required" in the spec to understand tier requirements
- β’ Rate limiting information is included in the response headers section
- β’ Use the examples in the spec as starting points for your requests
Download Options
β‘ Instant Code Generation
Upload our OpenAPI spec to any LLM and get production-ready integration code in seconds:
Integration in 3 Simple Steps
Download OpenAPI Spec
Click the download button above to get our complete API specification in OpenAPI 3.1 format.
Upload to Your LLM
Upload the JSON file to ChatGPT, Claude, or any AI assistant and ask: "Generate integration code for this API"
Copy, Paste & Deploy
Get ready-to-use code with error handling, authentication, and best practices. Just add your API key!
π€ Example: What LLMs Generate from Our OpenAPI Spec
Upload our spec and ask: "Generate Python code to get IP location data"
import requests
def get_ip_location(ip_address, api_key):
"""Get IP geolocation data"""
url = "https://api.keshtay.com/earth/v1/ip/lookup"
headers = {
"Authorization": f"Bearer {api_key}",
"Accept": "application/json"
}
params = {"ip": ip_address}
response = requests.get(url, headers=headers, params=params)
return response.json()
# Usage
location = get_ip_location("8.8.8.8", "your-api-key")
async function getIPLocation(ipAddress, apiKey) {
const response = await fetch(
`https://api.keshtay.com/earth/v1/ip/lookup?ip=${ipAddress}`,
{
headers: {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'application/json'
}
}
);
return await response.json();
}
// Usage
const location = await getIPLocation('8.8.8.8', 'your-api-key');
LLMs automatically generate: Error handling, TypeScript definitions, async/await patterns, authentication headers, request validation, and response parsing, all from our OpenAPI specification!
Works with Every Framework & Platform
Plus: .NET Core, Ruby on Rails, Go (Gin/Echo), Rust (Actix/Axum), and any framework that supports HTTP requests
Transparent Pricing, No Hidden Fees
Choose the plan that fits your needs. Start free and scale as you grow. 30-day notice for any pricing changes.
Choose Your Plan
free plan
- 10 requests/min
- 100 requests/day
- 1,000 requests/month
- Countries, States & Cities data
- ISO2/ISO3 country lookup
- Advanced search capabilities PAID
- IP geolocation lookup PAID
- Coordinate-based country search PAID
- Batch IP lookup (multiple IPs) PREMIUM
- Full country hierarchy data PREMIUM
- Location insights & analytics PREMIUM
- Coordinate-based city/state search PREMIUM
- IP lookup history PREMIUM
- Complete API documentation
- Email support
- Usage analytics dashboard PAID
paid plan
- 60 requests/min
- 5,000 requests/day
- 100,000 requests/month
- Countries, States & Cities data
- ISO2/ISO3 country lookup
- Advanced search capabilities
- IP geolocation lookup
- Coordinate-based country search
- Batch IP lookup (multiple IPs) PREMIUM
- Full country hierarchy data PREMIUM
- Location insights & analytics PREMIUM
- Coordinate-based city/state search PREMIUM
- IP lookup history PREMIUM
- Complete API documentation
- Email support
- Usage analytics dashboard
premium plan
- 300 requests/min
- 50,000 requests/day
- 1,000,000 requests/month
- Countries, States & Cities data
- ISO2/ISO3 country lookup
- Advanced search capabilities
- IP geolocation lookup
- Coordinate-based country search
- Batch IP lookup (multiple IPs)
- Full country hierarchy data
- Location insights & analytics
- Coordinate-based city/state search
- IP lookup history
- Complete API documentation
- Priority support
- Usage analytics dashboard
Optional Auto-Billing for Overages
Never worry about hitting your limits again. Enable automatic billing to keep your service running seamlessly when you exceed your plan's usage caps.
Daily Overage Billing
When you exceed your daily request limit, auto-billing charges approximately 1/30th of your monthly plan cost for that day's additional usage.
Monthly Overage Billing
When you exceed your monthly limit, auto-billing immediately resets your billing cycle and charges you for a full new month of service.
Requirements & Important Notes
- β’ Default payment method required: Must have a valid credit card saved to your account
- β’ Optional feature: Auto-billing is disabled by default and can be toggled in your account settings
- β’ Notification system: You'll receive email alerts before and after any overage charges
Auto-billing ensures uninterrupted service while giving you full control over your usage costs.
See It In Action
Sample responses from our Earth API endpoints - notice how data richness varies by tier
GET /api/earth/v1/countries
{
"status": "success",
"message": "Success",
"data": [
{
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA"
},
{
"id": 39,
"name": "Canada",
"iso2": "CA",
"iso3": "CAN"
},
{
"id": 107,
"name": "Germany",
"iso2": "DE",
"iso3": "DEU"
},
{
"id": 74,
"name": "France",
"iso2": "FR",
"iso3": "FRA"
},
{
"id": 109,
"name": "Italy",
"iso2": "IT",
"iso3": "ITA"
}
],
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": [
{
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"phonecode": "+1",
"tld": ".us",
"native": "United States",
"emoji": "πΊπΈ",
"states_count": 51,
"cities_count": 19369
},
{
"id": 39,
"name": "Canada",
"iso2": "CA",
"iso3": "CAN",
"phonecode": "+1",
"tld": ".ca",
"native": "Canada",
"emoji": "π¨π¦",
"states_count": 13,
"cities_count": 7494
}
],
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": [
{
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"phonecode": "+1",
"tld": ".us",
"native": "United States",
"emoji": "πΊπΈ",
"latitude": 37.0902,
"longitude": -95.7129,
"states_count": 51,
"cities_count": 19369,
"states": [
{
"id": 1434,
"name": "California",
"country_id": 231,
"latitude": 36.7783,
"longitude": -119.4179,
"cities_count": 1634
},
{
"id": 1452,
"name": "New York",
"country_id": 231,
"latitude": 42.9538,
"longitude": -75.5268,
"cities_count": 1654
}
],
"timezones": [
"America/New_York",
"America/Chicago",
"America/Denver",
"America/Los_Angeles"
],
"translations": {
"de": "Vereinigte Staaten",
"es": "Estados Unidos",
"fr": "Γtats-Unis",
"ja": "γ’γ‘γͺγ«εθ‘ε½",
"ar": "Ψ§ΩΩΩΨ§ΩΨ§Ψͺ Ψ§ΩΩ
ΨͺΨΨ―Ψ©"
}
}
],
"timestamp": "2024-10-14T15:30:42.000000Z"
}
GET /api/earth/v1/ip/lookup/8.8.8.8
{
"status": "error",
"message": "IP geolocation requires paid subscription",
"data": null,
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": {
"ip": "8.8.8.8",
"zip_code": "94043",
"country": {
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"phonecode": "+1",
"tld": ".us",
"native": "United States",
"emoji": "πΊπΈ"
},
"state": {
"id": 1434,
"name": "California",
"country_id": 231
},
"city": {
"id": 111543,
"name": "Mountain View",
"state_id": 1434,
"country_id": 231
},
},
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": {
"ip": "8.8.8.8",
"zip_code": "94043",
"country": {
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"phonecode": "+1",
"tld": ".us",
"native": "United States",
"emoji": "πΊπΈ",
"latitude": 37.0902,
"longitude": -95.7129,
"timezones": [
"America/New_York",
"America/Chicago",
"America/Denver",
"America/Los_Angeles"
],
"translations": {
"de": "Vereinigte Staaten",
"es": "Estados Unidos",
"fr": "Γtats-Unis"
}
},
"state": {
"id": 1434,
"name": "California",
"country_id": 231,
"latitude": 36.7783,
"longitude": -119.4179,
"cities_count": 1634
},
"city": {
"id": 111543,
"name": "Mountain View",
"state_id": 1434,
"country_id": 231,
"latitude": 37.4056,
"longitude": -122.0775
},
"latitude": 37.4056,
"longitude": -122.0775,
},
"timestamp": "2024-10-14T15:30:42.000000Z"
}
GET /api/earth/v1/cities/search?q=new york
{
"status": "error",
"message": "Search functionality requires paid subscription",
"data": null,
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": {
"cities": [
{
"id": 111532,
"name": "New York",
"state_id": 1452,
"country_id": 231,
"state": {
"id": 1452,
"name": "New York",
"country_id": 231
},
"country": {
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA"
}
},
{
"id": 111533,
"name": "New York Mills",
"state_id": 1424,
"country_id": 231,
"state": {
"id": 1424,
"name": "Minnesota",
"country_id": 231
},
"country": {
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA"
}
}
]
},
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": {
"cities": [
{
"id": 111532,
"name": "New York",
"state_id": 1452,
"country_id": 231,
"latitude": 40.7128,
"longitude": -74.0060,
"state": {
"id": 1452,
"name": "New York",
"country_id": 231,
"latitude": 42.9538,
"longitude": -75.5268,
"cities_count": 1654
},
"country": {
"id": 231,
"name": "United States",
"iso2": "US",
"iso3": "USA",
"phonecode": "+1",
"emoji": "πΊπΈ",
"latitude": 37.0902,
"longitude": -95.7129
},
"timezone": "America/New_York"
}
]
},
"timestamp": "2024-10-14T15:30:42.000000Z"
}
GET /api/earth/v1/analytics/usage-stats
{
"status": "error",
"message": "Analytics API requires Premium tier",
"data": null,
"timestamp": "2024-10-14T15:30:42.000000Z"
}
{
"status": "success",
"message": "Success",
"data": {
"period": "last_30_days",
"total_requests": 45267,
"successful_requests": 44891,
"error_requests": 376,
"success_rate": 99.17,
"avg_response_time": 87,
"unique_ips_queried": 12543,
"unique_endpoints_used": 8,
"data_transferred": "2.3 GB",
"peak_hour": "14:00 UTC",
"top_countries_queried": [
{
"country": "United States",
"requests": 15432,
"percentage": 34.1
},
{
"country": "Canada",
"requests": 6789,
"percentage": 15.0
}
],
"endpoint_usage": {
"/api/earth/v1/ip/lookup": 28456,
"/api/earth/v1/countries": 8901,
"/api/earth/v1/cities/search": 4567,
"/api/earth/v1/states": 3343
},
"daily_breakdown": [
{
"date": "2024-10-13",
"requests": 1876,
"errors": 12,
"avg_response_time": 92
}
]
},
"timestamp": "2024-10-14T15:30:42.000000Z"
}
API Feature Comparison by Tier
| Feature | Free | Paid | Premium |
|---|---|---|---|
| Requests Per Minute | 10 | 60 | 300 |
| Daily Requests | 100 | 5,000 | 50,000 |
| Monthly Requests | 1,000 | 100,000 | 1,000,000 |
| Max Pagination Per Request | 5 | 50 | 100 |
| IP Batch Processing | β No Access | 50 IPs per batch | 100 IPs per batch |
| Basic Geographic Data | β Countries, States, Cities | β Full Access | β Full Access |
| ISO2/ISO3 Country Lookup | β | β | β |
| Search Functionality | β Not Available | β Countries, States, Cities | β Enhanced Search |
| IP Geolocation Lookup | β Not Available | β Single IP | β Single + Batch |
| Coordinate-Based Search | β | β Countries Only | β Countries, States, Cities |
| Full Hierarchy Data | β | β | β Complete Nested Data |
| IP Lookup History | β | β | β Full History Access |
| Location Insights & Analytics | β | β | β Advanced Analytics |
| Usage Analytics API | β | β | β Comprehensive Stats |
| Basic Account Usage Stats | β | β | β |
Ready for More Power?
Unlock IP geolocation, advanced search, comprehensive analytics, and higher request limits by upgrading your tier.