TL;DR
IPinfo is a popular IP address data API — append /json to any IP and get back location, ISP, company, and network range. The free tier covers IP geolocation, ASN details, and company data without requiring an API key. Their example IP (8.8.8.8) returns Google's Mountain View data complete with org name, timezone, and coordinates. Clean JSON, fast responses, and straightforward pricing if you outgrow the free tier.
Quick start: https://ipinfo.io/8.8.8.8/json
No API key needed — just make a request!
https://ipinfo.io/8.8.8.8/json
How to Use This API
1. Lookup a Specific IP
Add /json after the IP for structured data:
https://ipinfo.io/8.8.8.8/json
Returns: ip, hostname, city, region, country, loc (lat,lng), org, postal, timezone, asn, and company.
2. Get Your Own IP Data
Call the root endpoint without an IP:
https://ipinfo.io/json
3. JavaScript — Display Geolocation
fetch('https://ipinfo.io/json')
.then(res => res.json())
.then(data => {
console.log(`IP: ${data.ip}`);
console.log(`Location: ${data.city}, ${data.region} ${data.country}`);
console.log(`Coordinates: ${data.loc}`);
console.log(`ISP: ${data.org}`);
});
4. Python — Get ASN Data
import requests
# Get info for Cloudflare DNS
resp = requests.get('https://ipinfo.io/1.1.1.1/json')
data = resp.json()
print(f"IP: {data['ip']}")
print(f"Organization: {data['org']}")
print(f"City: {data['city']}, {data['country']}")
print(f"Timezone: {data['timezone']}")
# The 'org' field includes ASN like "AS13335 Cloudflare"
Frequently Asked Questions
- What does the free tier include?
- The free tier includes IP geolocation, ASN (autonomous system number), organization/company data, and timezone. No API key required for up to 50,000 requests/month.
- Do I need an API key?
- For basic usage, no. However, signing up for a free API key raises your limit to 50,000 requests per month and unlocks additional fields.
- How accurate is the geolocation?
- IPinfo provides city-level accuracy for most IPs. They use multiple data sources including regional internet registries and user-contributed data.
- What format does the response use?
- JSON. The
/jsonsuffix requests JSON output. You can also omit the suffix for a plain text response with basic details. - Can I get ASN and company data?
- Yes, the response includes
org(ASN + organization name, e.g., "AS15169 Google LLC") and acompanyobject with name, domain, and type. - Is there carrier/abuse contact data?
- The free tier does not include abuse contact or privacy detection. Those require a paid IPinfo plan.
API Details
- API URL
https://ipinfo.io/{ip}/json- Documentation
- ipinfo.io/developers
- Category
- Development
- Authentication
- Not Required (free tier available)
- Geographic Coverage
- Global
What You Can Build
- User-facing "your IP info" widget showing location and ISP
- Geographic routing system that directs users to the nearest server
- Fraud detection tool comparing IP org data with claimed location
- Network diagnostics dashboard with ASN and ISP details
- Regional pricing enforcement based on visitor's country code