Utilities & AI

IP Geolocation API

The IP Geolocation API resolves an IP address as clean JSON.

2 actionsLive JSON1,000 free creditsMCP-ready
Get a free keyOpen in playground

🤖 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.

Live example

Real request and response JSON

Captured from the indexed primary action, lookup, on .

Captured request
{
  "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"
  }
}
Captured response
{
  "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
    }
  }
}
Actions

What the IP Geolocation API does

ActionDescriptionConcrete use caseKey params
lookupgeolocate ONE IPv4/IPv6 → country/region/city/lat-lon/timezone/ASN/ISP/org + hosting flagOps teams call lookup to get geolocate ONE IPv4/IPv6 → country/region/city/lat-lon/timezone/ASN/ISP/org + hosting flag.ip, lang
batchgeolocate up to 100 IPs in one callDeveloper tools call batch to get geolocate up to 100 IPs in one call.ips, lang
Code samples

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"}'
MCP one-liner
Ask your MCP-connected assistant: call reefapi.ip-geolocation.lookup with {"ip":"8.8.8.8"}.
Use cases

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.
FAQ

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.

docs / ip-geolocation

IP Geolocation

Locate any IP — country, city and network.

base /ip-geolocation/v12 endpoints
post/ip-geolocation/v1/lookup1 credit

geolocate ONE IPv4/IPv6 → country/region/city/lat-lon/timezone/ASN/ISP/org + hosting flag

ParameterAllowed / rangeDescription
iprequiredA single IPv4 or IPv6 address to geolocate (e.g. 8.8.8.8 or 2001:4860:4860::8888).
lang = enoptionalPreferred language for place names (country/region/city), e.g. en, de, fr, es, ru, ja. Falls back to English when a locale name is unavailable.
Try in playground →
post/ip-geolocation/v1/batch2 credits

geolocate up to 100 IPs in one call

ParameterAllowed / rangeDescription
ipsrequiredUp to 100 IPv4/IPv6 addresses. A JSON array, OR a comma/space/newline-separated string. Bad/private IPs are kept (per-item status) so one bad entry never fails the call.
lang = enoptionalPreferred language for place names (country/region/city), e.g. en, de, fr, es, ru, ja. Falls back to English when a locale name is unavailable.
Try in playground →