IP Geolocation API
The IP Geolocation API resolves an IP address as clean JSON.
🤖 Using an AI assistant? Copy this link into ChatGPT / Claude / Cursor — it reads every endpoint and parameter instantly and tells you if this API fits your use case.
The primary lookup endpoint returns country, region, city, coordinates, timezone and network info for an IP, and you can batch many lookups. It is built for personalization, fraud detection and analytics that need to place an IP without a local database. One ReefAPI key, one shared credit pool, the standard envelope.
Real request and response JSON
Captured from the indexed primary action, lookup, on .
{
"method": "POST",
"url": "https://api.reefapi.com/ip-geolocation/v1/lookup",
"headers": {
"x-api-key": "$REEF_KEY",
"content-type": "application/json"
},
"body": {
"ip": "8.8.8.8"
}
}{
"ok": true,
"meta": {
"api": "ip-geolocation",
"endpoint": "lookup",
"mode": "offline",
"latency_ms": 13.768,
"record_count": 1,
"bytes": 0,
"cache_hit": false,
"completeness_pct": 100,
"attribution": "IP Geolocation by DB-IP (https://db-ip.com); country data © GeoNames (CC BY 4.0)"
},
"data": {
"ip": "8.8.8.8",
"version": 4,
"status": "ok",
"is_private": false,
"found": true,
"country_code": "US",
"country_name": "United States",
"country": {
"area_km2": 9629091,
"calling_code": "1",
"capital": "Washington",
"continent": "NA",
"currency": "USD",
"currency_name": "Dollar",
"is_eu": false,
"iso2": "US",
"iso3": "USA",
"languages": [
"en-US",
"es-US",
"haw"
],
"name": "[redacted-name]",
"population": 327167434,
"tld": ".us"
},
"is_eu": false,
"continent_code": "NA",
"continent_name": "North America",
"region": "California",
"region_code": "US-CA",
"city": "Mountain View",
"postal": null,
"latitude": 37.422,
"longitude": -122.085,
"accuracy_radius_km": null,
"timezone": "America/Los_Angeles",
"utc_offset": "-07:00",
"asn": 15169,
"as_org": "Google LLC",
"isp": "Google LLC",
"network": "8.8.8.0/24",
"security": {
"is_hosting": true,
"is_proxy": null,
"is_vpn": null,
"is_tor": null
}
}
}What the IP Geolocation API does
| Action | Description | Concrete use case | Key params |
|---|---|---|---|
| lookup | geolocate ONE IPv4/IPv6 → country/region/city/lat-lon/timezone/ASN/ISP/org + hosting flag | Ops teams call lookup to get geolocate ONE IPv4/IPv6 → country/region/city/lat-lon/timezone/ASN/ISP/org + hosting flag. | ip, lang |
| batch | geolocate up to 100 IPs in one call | Developer tools call batch to get geolocate up to 100 IPs in one call. | ips, lang |
Call lookup from your stack
curl -X POST https://api.reefapi.com/ip-geolocation/v1/lookup \
-H "x-api-key: $REEF_KEY" \
-H "content-type: application/json" \
-d '{"ip":"8.8.8.8"}'import requests
r = requests.post(
"https://api.reefapi.com/ip-geolocation/v1/lookup",
headers={"x-api-key": REEF_KEY},
json={
"ip": "8.8.8.8"
},
)
print(r.json()["data"])const res = await fetch("https://api.reefapi.com/ip-geolocation/v1/lookup", {
method: "POST",
headers: {
"x-api-key": process.env.REEF_KEY,
"content-type": "application/json",
},
body: JSON.stringify({
"ip": "8.8.8.8"
}),
});
const { ok, data, meta, error } = await res.json();Ask your MCP-connected assistant: call reefapi.ip-geolocation.lookup with {"ip":"8.8.8.8"}.Who uses this API and why
- Apps call lookup to personalize content by a visitor's country.
- Fraud tools flag mismatches between an IP's geolocation and a claimed location.
- Analytics use batch to enrich server logs with geography.
Questions developers ask before integrating
What is the IP Geolocation API?
IP Geolocation API is a ReefAPI endpoint group for locate any ip — country, city and network. It returns live JSON through POST requests under /ip-geolocation/v1.
Is the IP Geolocation API free to try?
Yes. ReefAPI starts with 1,000 free credits, no card required. IP Geolocation calls use the same shared credit balance as every other ReefAPI engine.
Do I need a IP Geolocation login or account?
No login to IP Geolocation is needed for the API response. You call ReefAPI with your x-api-key header, and the playground can run live examples before you create a production key.
How fresh is the IP Geolocation data?
The page example is captured from a live lookup call, and production requests fetch live data through ReefAPI rather than a static sample.
How many credits does the IP Geolocation API use?
IP Geolocation actions currently cost 1-2 credits per successful call. Failed or blocked calls are free, and all APIs draw from one credit pool.
Can I call IP Geolocation from an AI assistant or MCP client?
Yes. Connect ReefAPI once through MCP and your assistant can call ip-geolocation actions with the same key, credit pool and JSON envelope used by normal REST requests.
Is the IP Geolocation API a IP Geolocation scraper?
It is the managed alternative to a DIY IP Geolocation scraper. Instead of building and maintaining your own scraper — proxies, headless browsers, captcha and constant breakage — you call one ReefAPI endpoint and get the same locate any ip — country, city and network back as clean JSON.
Why does my IP Geolocation scraper keep getting blocked?
Most IP Geolocation scrapers break on anti-bot defenses, rate limits and IP bans that need rotating residential proxies and browser fingerprinting to clear. ReefAPI handles all of that for you — no proxies, no captchas, no maintenance — and returns live JSON. Blocked or failed calls are free.