IP Geolocation API
Look up country, region, city, coordinates, and timezone for any public IPv4 or IPv6 address. Powered by MaxMind GeoLite2 — fully local computation, no upstream rate limits.
Don't have an API key?
Sign in to your account to create and manage your API keys.
API Integration Guide
Learn how to integrate this API into your applications with code examples and detailed documentation.
/api/ip-geolocationBase URL
https://www.apipick.comFull Endpoint
https://www.apipick.com/api/ip-geolocationipPublic IPv4 or IPv6 address. Omit to look up caller's own IP.
Example: 8.8.8.8cURL Request
curl -X GET "https://www.apipick.com/api/ip-geolocation" \
-H "x-api-key: YOUR_API_KEY"YOUR_API_KEY with your actual API keyJSON Response
{
"success": true,
"code": 200,
"message": "ok",
"data": {
"ip": "8.8.8.8",
"country_code": "US",
"country_name": "United States",
"continent": "North America",
"continent_code": "NA",
"city": "Mountain View",
"latitude": 37.4056,
"longitude": -122.0775,
"timezone": "America/Los_Angeles",
"currency": "USD",
"isp": "Google LLC",
"asn": 15169
},
"credits_used": 1,
"remaining_credits": 99
}✓Best Practices
- • Always include x-api-key header
- • Always handle errors gracefully
- • Validate input data before sending
- • Use HTTPS for secure communication
- • Cache responses when appropriate
ℹResponse Headers
- • Content-Type: application/json
- • x-api-key: Required for authentication
- • Status codes: 200 (success), 400 (error), 401 (unauthorized)
- • No rate limiting applied
Built for Real-World Use Cases
Fraud Detection
Flag signups or transactions from high-risk regions. Check if a user's IP matches their claimed location or billing country.
Content Localization
Auto-select language, currency, and regional pricing based on visitor location. Serve EU-compliant cookie banners only to EU visitors.
Rate Limiting
Apply per-country rate limits or access controls. Block or throttle traffic from specific regions without purchasing expensive security tools.
AI Agent Enrichment
Let AI agents enrich user records, classify leads by geography, or localise generated content based on real-time IP data.
ipinfo.io & ipapi.co Alternative
Per-account credit billing — no shared rate-limit pool, no plan tiers, no monthly caps that reset on day one of the month.
ipinfo.io | ipapi.co | API Pick ✓ | |
|---|---|---|---|
| Free tier | 50k req/month | 1,000 req/day | 100 credits on signup |
| Rate limiting model | Shared IP pool risk | Shared IP pool risk | Per-account credits |
| Credits / quota expire? | Monthly reset | Daily reset | Never expire |
| Country + region + city | ✓ | ✓ | ✓ |
| Timezone | Paid plan | ✓ | ✓ |
| IPv6 support | ✓ | ✓ | ✓ |
| EU membership flag | Paid plan | ✓ | ✓ |
| No credit card to start | ✓ | ✓ | ✓ |
| AI agent / LLM ready | Partial | Partial | ✓ Native JSON |
The shared rate-limit pool problem
With ipinfo.io and ipapi.co free tiers, rate limits are enforced per client IP. That means all requests from the same Vercel, AWS, or GCP region share a single quota pool. If another tenant on the same edge node has already burned through the 1,000 daily limit, your API calls start failing — even though you haven't made a single request yet.
Credit-based billing: predictable at any scale
API Pick charges per account, not per IP. Every call deducts exactly 1 credit from your balance — only on a successful response. Credits never expire. Whether you make 10 lookups or 10,000 in a single day, you only pay for what you use with zero risk of surprise failures from a shared quota.
Response Fields
| Field | Type | Description |
|---|---|---|
| data.ip | string | The queried IP address |
| data.country_code | string | ISO 3166-1 alpha-2 country code (e.g. US, DE, JP) |
| data.country_name | string | Full English country name |
| data.continent | string | Continent name (e.g. North America, Europe) |
| data.continent_code | string | Two-letter continent code (e.g. NA, EU) |
| data.city | string | City name (empty string if not available) |
| data.latitude | number | null | Approximate latitude of the IP location |
| data.longitude | number | null | Approximate longitude of the IP location |
| data.timezone | string | IANA timezone identifier (e.g. America/Los_Angeles) |
| data.currency | string | ISO 4217 currency code for the country (e.g. USD, EUR) |
| data.isp | string | ISP / organisation name from the ASN database |
| data.asn | integer | null | Autonomous System Number (e.g. 15169 for Google) |
| credits_used | integer | Credits deducted for this request |
| remaining_credits | integer | Credits remaining in your account |
Frequently Asked Questions
Q: What happens if I don't pass an IP address?
A: The endpoint auto-detects your caller's IP from the request headers (X-Forwarded-For). This is useful for server-side lookups where you want to geolocate the end user without passing the IP explicitly.
Q: Are private IPs supported?
A: No. Private IPs (RFC 1918 ranges like 192.168.x.x, 10.x.x.x), loopback (127.0.0.1), and other reserved ranges return a 400 error. Only publicly routable IPv4 and IPv6 addresses are supported.
Q: How accurate is the geolocation?
A: Powered by MaxMind GeoLite2-City. Country-level accuracy is typically 95–99%. City-level accuracy varies by region — generally reliable in North America and Europe, less precise in parts of Asia and Africa. Coordinates represent the general area, not a precise physical location.
Q: Can AI agents use this as a tool?
A: Yes. The endpoint accepts a single optional ip query parameter and returns a flat JSON object — easy to expose as a function tool for OpenAI, Claude, LangChain, or any agent framework. Useful for agents that need to reason about user location, enforce geo-based rules, or enrich lead data with regional context.