The IP Geolocation API for Building Location-Aware Applications

Look up any IPv4 or IPv6 address. Get country, city, coordinates, timezone, currency, ISP, and threat signals back as JSON. Try it on your own IP, then start free.

  • 100 free requests/mo
  • No credit card
  • Setup in 60 seconds
GET ipwho.is/<ip>LIVE
ip
type
country
region
city / zip
lat / long
time_zone.id
currency
connection
Try: ···
99.9%
Uptime
2M+
Locations
200,000+
Cities
100+
Fields per lookup

Trusted by Developers Worldwide

MicrosoftAirbnbSamsungActivisionHubSpot

What Is an IP Geolocation API?

An IP geolocation API is a web service that takes an IP address and returns its real-world location: country, region, city, and coordinates, plus network context like ISP, timezone, and currency. Your application sends one HTTP request and gets structured JSON back in milliseconds.

What apps do with it

Decide before the page renders: which currency to show, which consent banner to serve, whether a login looks suspicious. The lookup runs server-side, so it works on every request with no permission prompt and no client code.

What separates providers

The differences come down to accuracy, refresh frequency, coverage, and latency. A geolocation API is only as good as its data: ipstack covers 2M+ locations across 200,000+ cities, refreshed continuously through ISP partnerships.

Other names, same contract

You will also see this called a geolocation web service or an ip to geolocation API. The contract is identical: send an address, get back a structured answer your code can branch on.

IP Geolocation API vs. Browser Geolocation API (GPS)

An IP geolocation API tells your server where a request comes from. The browser Geolocation API asks the user’s device where it is. One is permissionless and city-level, the other is consent-gated and meter-level.

IP geolocation APIBrowser Geolocation API
How it locatesMaps the IP to ISP service areasGPS, Wi-Fi, and cell signals on the device
Permission requiredNoneExplicit user consent, per site
Works server-sideYes: APIs, webhooks, logs, edgeNo: browser JavaScript only
Typical accuracyCountry to city levelMeters, when the user allows it
Best forLocalization, fraud checks, analytics, geo-blockingNavigation, store finders, ride hailing

Reach for IP-based geolocation when

  • Every request needs an answer: localization, analytics, fraud screening, geo-blocking
  • The caller is an API, webhook, or edge function, not a browser
  • A permission prompt would hurt conversion, like currency defaults at checkout

Reach for browser GPS when

  • The feature needs the device's position: turn-by-turn navigation, ride hailing
  • "Stores near you" is exactly what the permission prompt promises
  • Meter precision is worth a consent dialog and a browser-only code path
Use both: resolve the IP server-side as the instant default, then offer browser GPS as an upgrade where precision earns it. If the user declines the prompt, the IP result is already on screen.

How IP Geolocation Works (and How Accurate It Is)

IP geolocation maps the address ranges that internet registries allocate to ISPs onto the physical areas where those ranges serve customers. GPS plays no part: the location comes from knowing who operates an address and where they route it.

Where the data comes from

  1. 1
    Registry allocationsARIN, RIPE, APNIC and peer registries record which organization holds each IP range.
  2. 2
    ISP partnershipsPartner ISPs continuously supply updated ranges and the real service areas they map to.
  3. 3
    Continuous refreshRanges are re-allocated constantly. Stale data is the top cause of wrong answers, so updates never stop.

The IP geolocation glossary defines registry, ASN, CGNAT, and the rest of the vocabulary.

Accuracy you can expect

Country level~99% across the industry
City levelVaries by connection type
Fixed broadbandResolves most precisely
Mobile (CGNAT)Can resolve to the carrier gateway
CoordinatesArea centroid, not a street address

VPNs and proxies resolve to the exit server, and the security fields flag them for you. IPv4 and IPv6 resolve with the same fields and the same precision.

100+ Data Fields in Every Response

Every lookup draws on five field groups: location, time zone, currency, connection, and security. Location fields come with the free plan, paid plans add time zone, currency, and connection, and Professional+ adds security. The JSON IP API page documents the full response format field by field.

FieldExampleWhat it tells you
Location
country_code / country_nameUS · United StatesISO 3166-1 country of the address
region_code / region_nameVA · VirginiaState, province, or region
city / zipAshburn · 20149Resolved city and postal code
latitude / longitude39.0438 · -77.4879Coordinates of the area centroid
location.country_flag_emoji🇺🇸Flag ready for UI display
location.is_eufalseEU membership, the GDPR consent trigger
Time zone
time_zone.idAmerica/New_YorkIANA timezone identifier
time_zone.current_time2026-08-18T09:13:13-04:00Local time at the address right now
time_zone.gmt_offset-14400Offset from GMT in seconds
Currency
currency.code / symbolUSD · $ISO 4217 currency for price display
currency.name / pluralUS Dollar · US dollarsNames for checkout copy
Connection
connection.asn14618Autonomous system number
connection.ispamazon.com Inc.Operator serving the address
Security  PROFESSIONAL+
security.is_proxy / proxy_typefalse · nullProxy detection and classification
security.is_torfalseTor exit node flag
security.is_crawler / crawler_namefalse · nullBot and crawler identification
security.threat_level / threat_typeslow · nullAggregated risk scoring
GET https://api.ipstack.com/3.95.197.167?access_key=YOUR_KEYSAMPLE
{
  "ip": "3.95.197.167",
  "type": "ipv4",
  "continent_name": "North America",
  "country_code": "US",
  "country_name": "United States",
  "region_name": "Virginia",
  "city": "Ashburn",
  "zip": "20149",
  "latitude": 39.0438,
  "longitude": -77.4879,
  "location": { "country_flag_emoji": "🇺🇸", "calling_code": "1", "is_eu": false },
  "time_zone": { "id": "America/New_York", "code": "EDT" },
  "currency": { "code": "USD", "symbol": "$" },
  "connection": { "asn": 14618, "isp": "amazon.com Inc." },
  "security": { "is_proxy": false, "is_tor": false, "threat_level": "low" }
}

What You Can Build: Geolocation Use Cases by Industry

Each of these patterns runs on a single lookup per request.

E-commerce: localization, currency display & regional pricing

Render the right currency and shipping terms on first paint using currency.code and country_code. The lookup runs during server-side rendering, so a shopper in Berlin sees € prices immediately. Match country_code to your price book for regional pricing, and use location.is_eu for tax wording.

Delivery & logistics apps: routing, serviceability & ETA context

A geolocation API for delivery apps answers the first operational question: do we serve this area? Resolve city and zip on arrival to pre-fill the coverage check, quote an ETA window from the regional depot, and keep delivery times in the customer's local clock with time_zone.id.

SaaS: onboarding, personalization & language defaults

Default country, language, and timezone at signup from the IP so new users confirm instead of typing. Segment trials by region_name for your CRM, and schedule onboarding emails inside the user's working hours with time_zone.id.

Fraud prevention & compliance: geo-blocking, licensing, GDPR

Compare country_code against the billing country at checkout and route mismatches to review. Enforce licensing windows and embargo rules at the edge, and trigger consent flows when is_eu is true. For continuous IP checks in security and ops workflows, use our real-time IP lookup API.

2M+ Locations. One API Key.

Coverage across 200,000+ cities, free to start with no credit card.

The Best IP Geolocation API for Developers Building Location-Based Features? Here's Our Case

One call returns location, timezone, currency, connection, and security data together. Most alternatives sell those as separate products or price tiers. With ipstack they are fields in the same JSON response.

The same endpoint serves your prototype and your production traffic, behind 99.9% uptime. When you need to enrich logs or backfill events, the bulk endpoint takes up to 50 IPs per request instead of 50 round trips.

Integrate in minutes: official SDKs, a maintained Postman collection, and copy-paste samples in every major language. Start on the free plan, 100 requests a month with no credit card, and verify the location data against your own traffic before paying anything.

Why developers pick ipstack
  • One GET request returns all 100+ fields
  • Security signals in the same call: is_proxy, is_tor, threat_level
  • Bulk endpoint: up to 50 IPs per request
  • Official SDKs, Postman collection, and an MCP server
  • Free plan: 100 requests/mo, no credit card

Start free, upgrade only when your volume demands it.

How ipstack Compares to Other Geolocation APIs

One call on one flat plan returns location, timezone, currency, connection, and threat data.

ipstackipinfoMaxMindip-api.comAbstract
Free tier100 requests/mo with keyCountry-level only (Lite)GeoLite2 self-hosted databases45 req/min, no signup, non-commercial, HTTP only1,000 req/mo, 1 req/sec
Data fields100+ incl. timezone, currency, connectionCity, ASN, privacy (paid tiers)City / Insights field sets~20 core fieldsLocation, timezone, security
Security / threat detectionProxy, Tor, crawler, threat level (Professional+)VPN/proxy on Core, $26/mo+Anonymizer via Insights, $0.002/queryBasic proxy/hosting flagsOn free tier; drops on Starter
Uptime commitment99.9%99.99% stated99.99% statedNone published99.99% SLA (Enterprise)
Bulk lookupsUp to 50 IPs per request (Professional+)Via database downloads, $1,000/mo+Not offered on web serviceBatch endpoint, rate-limitedSeparate bulk upload tool
Entry paid price$12.99/mo for 50,000 calls$26/mo for 150,000 callsPay-per-query from $0.0003Pro tier (unlimited, SSL)$17/mo billed annually (60,000 req/yr)

Based on each provider's published pricing and documentation, August 2026. Full plan details are on our pricing page.

Start in Three Steps

Get a key, make a call, and parse the response in a few minutes. Test everything on the free IP API plan first.

1

Get your key

Sign up with an email. No credit card. Copy the access key from your dashboard.

2

Make the first call

Send one GET request with an IP and your key. The code samples show the same call in cURL, JavaScript, Python, and PHP.

3

Parse the response

Read city, country_name, or any of the 100+ fields straight off the JSON.

# Look up any IP at city level
curl "https://api.ipstack.com/134.201.250.155?access_key=YOUR_KEY"
// Look up any IP at city level
const res = await fetch(
  `https://api.ipstack.com/${ip}?access_key=${process.env.IPSTACK_KEY}`
);
const geo = await res.json();
console.log(geo.city, geo.country_name);
# Look up any IP at city level
import os, requests

geo = requests.get(
    f"https://api.ipstack.com/{ip}",
    params={"access_key": os.environ["IPSTACK_KEY"]}
).json()

print(geo["city"], geo["country_name"])
// Look up any IP at city level
$geo = json_decode(file_get_contents(
  "https://api.ipstack.com/$ip?access_key=$key"
));

echo $geo->city, ", ", $geo->country_name;

The step-by-step ipstack API guide covers every endpoint, parameter, and error code.

Building with AI agents?

ipstack ships an MCP server so Claude, Cursor, and custom agents can call IP geolocation directly.

Read the MCP guide

Frequently Asked Questions - IP Geolocation API

An IP geolocation API runs server-side: it takes any IP address and returns city-level location with no permission prompt. The browser Geolocation API runs in client-side JavaScript, asks the user for consent, and reads GPS or Wi-Fi for meter-level precision. Most production apps use IP data as the instant default and offer browser GPS as an opt-in upgrade.

Regional internet registries allocate IP ranges to ISPs and organizations, and each range maps to the physical areas where it serves customers. ipstack combines registry data with ISP partnerships that continuously supply updated ranges, so a lookup resolves an address to its real-world location without touching the device.

Country-level IP geolocation is highly reliable across the industry, typically around 99%. City-level accuracy varies with how ISPs allocate addresses: fixed broadband resolves more precisely than mobile carrier ranges. ipstack draws on 2M+ locations across 200,000+ cities; treat coordinates as city-level context, not a street address.

Start with city, region_code, zip, latitude and longitude for serviceability and routing context. Add time_zone.id for delivery windows and the connection fields to flag mobile orders. With those six fields a courier app can pre-fill the delivery region and quote a realistic ETA on the first page load.

Yes. Region detection from an IP is a standard way to trigger consent banners for EU visitors (the is_eu field), enforce content licensing windows, and apply embargo rules. IP addresses are themselves personal data under GDPR, so process lookups under a lawful basis and a data processing agreement.

Yes. The security module returns is_proxy, proxy_type, is_tor, is_crawler, threat_level and threat_types on every lookup, and it is included on the Professional+ plan. Compare plans on the pricing page, and use the flags to route risky signups and checkouts to manual review.

Get Accurate IP Geolocation in Your App Today

One request returns the location, timezone, currency, and network context of any IP address. Sign up, copy your key, and make the first IP geolocation call in the next few minutes.