ipapi.co
Geocoding
Find IP address location information
IP geolocation with city, region, and ISP — free tier 30k/month.
Auth
No Auth
HTTPS
Yes
CORS
Yes
Common Use Cases
- •Build location-aware applications with mapping features
- •Create public transit and navigation tools
- •Develop government data dashboards and civic tech apps
Integration Guide
Review the API Documentation
Visit the official ipapi.co documentation to understand available endpoints, request formats, and response structures. Familiarize yourself with the API's rate limits and usage policies before integration.
No Authentication Required
Good news — ipapi.co does not require any authentication. You can start making API requests directly without registering for an API key or setting up OAuth credentials.
Use HTTPS for Secure Requests
ipapi.co supports HTTPS, ensuring encrypted communication. Always use HTTPS endpoints in production to protect data in transit and comply with modern web security standards.
CORS Enabled — Direct Browser Access
ipapi.co has CORS enabled, meaning you can make requests directly from the browser. This is ideal for frontend-only applications built with React, Vue, or vanilla JavaScript.
Implement and Test
Write your API integration code, start with a simple test request to verify connectivity. Implement proper error handling for network failures, rate limits, and invalid responses. Monitor your API usage to stay within any limits.
Code Examples
JavaScript / Fetch API:
// JavaScript example
fetch("https://ipapi.co/api/#introduction")
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log("API response:", data);
})
.catch(error => {
console.error("Error fetching from ipapi.co:", error);
});Python / Requests:
# Python example
import requests
response = requests.get("https://ipapi.co/api/#introduction")
if response.status_code == 200:
data = response.json()
print("API response:", data)
else:
print(f"Error: {response.status_code}")Frequently Asked Questions
Is ipapi.co free to use?
Do I need an API key for ipapi.co?
Can I use ipapi.co in a browser-based application?
What category does ipapi.co belong to?
Is ipapi.co secure?
Editor's Notes & Deep Dive
Key Features
- →GET /json/ returns geolocation for the caller's IP
- →GET /{ip}/json/ geolocates a specific IPv4/IPv6 address
- →Returns city, region, country, postal code, timezone, ASN, and organization
Rate Limits & Quotas
Free tier: 30,000 req/month, 1 req/sec. Paid plans raise both caps. Requires no key for the free tier.
Known Issues & Pitfalls
- !Free tier is for non-commercial use only — check the ToS before deploying in a paid product
- !Accuracy varies by ISP; some mobile carriers return the carrier's NOC location instead of the user's city
- !HTTPS is required on the free tier; HTTP requests are rejected
How It Compares
More accurate than ip-api.com (which is HTTP-only by default) and has a more generous free tier than ipgeolocation.io. For ASN-only lookups use the Team Cymru DNS-based service.
Sample Response
{
"ip": "8.8.8.8",
"city": "Mountain View",
"region": "California",
"country_name": "United States",
"postal": "94043",
"latitude": 37.423,
"longitude": -122.084,
"org": "AS15169 Google LLC",
"timezone": "America/Los_Angeles"
}Pro Tips
- ✓Cache by /24 subnet for IPv4 — the city-level accuracy doesn't improve below that granularity