IP Geolocation: Understand and Use the Results
Get location, ASN, and org for an IP
IP geolocation: how websites guess where in the world you are
IP geolocation is the practice of taking an IP address and figuring out where in the physical world it is most likely located — country, region, city, sometimes ZIP code, occasionally even latitude and longitude. The interesting and frequently misunderstood part is that IP addresses do not actually contain location information. The number `93.184.216.34` does not encode any geography. The location is inferred by combining several external data sources: the regional internet registry that allocated the address block, BGP routing data, latency measurements between the IP and known reference points, and (most controversially) clickstream data from real users who voluntarily shared their location. The result is a database that maps IP ranges to locations with varying accuracy.
You should care because IP geolocation is the basis for almost every "where in the world is this user" question online, and the accuracy is much worse than most people realize. Country-level accuracy is usually 95–99% reliable. City-level accuracy in major Western markets is around 70–80%. Street-level accuracy is essentially impossible from IP alone — it requires GPS or browser geolocation. The classic story is the user in Brooklyn who is geolocated to Iowa because their VPN happens to exit through a server there. Or the user in Berlin whose corporate office is mapped to Frankfurt because all their traffic goes through a central proxy. These are not bugs in the database; they are the ground truth of how IP addresses actually flow.
The five sources every IP geolocation database draws from:
Regional internet registry data. ARIN, RIPE, APNIC, LACNIC, and AFRINIC publish the country a block was allocated to.
BGP routing announcements. The path a packet takes through the network often hints at the destination's geography.
Latency triangulation. Pinging an IP from multiple known locations and using the round-trip times to estimate distance.
User-contributed signals. Real users who shared their location through a browser permission, plus commercial clickstream feeds.
WHOIS contact addresses. Sometimes more accurate, sometimes wildly off — the registrant's billing address has nothing to do with where the IP is actually used.
**A related question every modern geolocation check also tries to answer is whether the IP is masking the real location at all.** An address that belongs to a known hosting / datacenter ASN, sits inside the Tor Project's published exit-node list, falls within Apple's iCloud Private Relay egress ranges, Cloudflare's WARP ranges, or a commercial VPN provider's address space is, by definition, not serving end-user residential traffic — whatever country the geolocation database thinks it's in. Treating those signals as a separate "privacy" channel (is_tor / is_hosting / is_relay / is_proxy_or_vpn) lets fraud, abuse, and access-control rules act on the kind of network the IP belongs to, not just on its coordinates.
Three questions an IP geolocation check answers:
Roughly where in the world is this user located?
Should this content be served in English, German, Japanese, or Portuguese based on the user's likely location?
For fraud rules, is the user's claimed country consistent with their IP's country?
The cost of treating IP geolocation as ground truth is being wrong about real users in subtle but real ways — wrong currency, wrong language, wrong fraud signals. The fix is to use it as a signal, not a fact, and to always provide a way for the user to correct it manually. The most authoritative database is MaxMind GeoIP2, with IP2Location and DB-IP as well-known alternatives.
The IP Geolocation endpoint, in plain language
Get location, ASN (Autonomous System Number), and org for an IP (Internet Protocol address)
IP (Internet Protocol address) geolocation is foundational for fraud detection, content localization, GDPR/regulatory compliance, and user analytics. The bundled privacy classification answers the question every fraud team eventually asks — "is this even an end-user, or is it a Tor (The Onion Router) exit / VPN (Virtual Private Network) / datacenter?" — without paying a third-party privacy-detection vendor. It enables security engineers to detect impossible travel attacks and anonymized traffic, product teams to serve localized content and pricing, and compliance teams to enforce geographic access controls mandated by regulations like GDPR (General Data Protection Regulation), CCPA (California Consumer Privacy Act), and data sovereignty laws.
What is actually happening when you call it
Resolves the physical location associated with an IP (Internet Protocol address) address using Cloudflare's geolocation database at the edge. Returns structured data including continent code, country (with ISO 3166-1 alpha-2 code), region/subdivision (ISO 3166-2), city, latitude/longitude coordinates, IANA timezone identifier, postal code where available, and the Autonomous System Number (ASN) with organization name operating the IP range. Also returns a `privacy` object flagging whether the IP is a known Tor (The Onion Router) exit node, falls within a published relay range (iCloud Private Relay, Cloudflare WARP), or belongs to a hosting / VPN (Virtual Private Network) ASN — useful for fraud detection and access-control gating without a second API (Application Programming Interface) call.
Why this specific tool matters
Choose a task: Impossible Travel Detection. Compare the geographic location of successive login attempts to detect physically impossible travel patterns (e.g., logins from New York and Tokyo within 30 minutes).
Run the IP Geolocation request below and retain the input and observed result. Before changing configuration, compare the relevant fields with the value or policy you expected. Use the IP Geolocation reference to check the field definitions and supported options.
Available on the free plan. The technical details: `GET /v1/ip/geolocation`.
When would I actually use this?
Impossible Travel Detection
Compare the geographic location of successive login attempts to detect physically impossible travel patterns (e.g., logins from New York and Tokyo within 30 minutes).
Use the finding: Automatically flag or block account takeover attempts from geographically inconsistent locations.
Content Localization & Pricing
Serve localized content, currency, and regional pricing based on visitor IP (Internet Protocol address) geolocation without requiring manual user selection.
Use the finding: Increase conversion rates with location-appropriate content, pricing in local currency, and locale-specific offers.
Regulatory Compliance & Geofencing
Enforce geographic access restrictions for content or services regulated under GDPR (General Data Protection Regulation), CCPA (California Consumer Privacy Act), sanctions (OFAC), or data residency requirements.
Use the finding: Meet data sovereignty and regulatory requirements by restricting access to approved geographic regions.
The easiest way: just ask your AI assistant
Connect the MCP server. Just ask in plain English:
Use ip_geolocation with ip=8.8.8.8. Show the returned findings, identify unavailable evidence, and explain a useful next check.
Confirm the tool and inputs in the client before accepting its summary. For IP Geolocation, use the response fields below to separate observations from recommendations.
The dedicated MCP server is available on every plan. Individual tool access and request limits depend on your plan. Management categories and endpoints disabled for the tool catalog are not exposed through MCP.
The technical way: call it from code
This IP Geolocation request uses the example inputs from its API contract. Replace YOUR_API_KEY with a key on the free plan or higher; adapt the target to your task.
curl --request GET 'https://api.edgedns.dev/v1/ip/geolocation?ip=8.8.8.8' \
--header "Authorization: Bearer YOUR_API_KEY"Prepare inputs for IP Geolocation
Start with the inputs below. Keep the same hostname, path, and options when comparing IP Geolocation observations. The API reference contains the complete parameter contract, optional settings, and access requirements.
| Field | Type | Required? | What it means | Example |
|---|---|---|---|---|
ip | string | Yes | The IPv4 (Internet Protocol version 4) or IPv6 (Internet Protocol version 6) address to geolocate. Omit to geolocate the requesting client IP (Internet Protocol address). | 8.8.8.8 |
Interpret IP Geolocation findings
Read these fields alongside the full response from your IP Geolocation check. A missing value or failed lookup is different from a passing result. Keep returned errors and confidence or cache metadata when available; do not replace missing evidence with a successful default. See the complete response reference for additional fields.
| Field | Type | What you'll see in it |
|---|---|---|
ip | string | The queried IP (Internet Protocol address) address |
ip_version | number | IP (Internet Protocol address) version (4 or 6) |
country | string | Country name |
Words you might be wondering about
IP (Internet Protocol address) — A unique number that identifies a computer on the internet, like a phone number for a server.
API (Application Programming Interface) — A way for one program to ask another program for something — like a waiter taking your order to the kitchen.
ASN (Autonomous System Number) — A unique number assigned to a big network operator (like an ISP or cloud provider). Tells you who owns a chunk of the internet.
VPN (Virtual Private Network) — A service that hides your real IP address by routing your internet traffic through someone else's server first. Used for privacy, getting around region locks, and connecting to work networks.
Tor (The Onion Router) — A free privacy network that bounces your traffic through several volunteer-run servers around the world to make it very hard to trace back to you. The 'exit node' is the last server in the chain — the one your destination actually sees.
IPv4 (Internet Protocol version 4) — The original kind of internet address — four numbers separated by dots, like 203.0.113.10. The internet has run out of new ones, which is why IPv6 exists.
IPv6 (Internet Protocol version 6) — The newer, longer kind of internet address. Looks like 2001:0db8:85a3::8a2e:0370:7334. Designed because the world ran out of IPv4 addresses.
GDPR (General Data Protection Regulation) — Europe's privacy law. Requires websites to be transparent about what personal data they collect and how they use it.
CCPA (California Consumer Privacy Act) — California's privacy law. Gives California residents the right to know what personal data a company has collected about them.
Related Guides
Reverse DNS: Understand and Use the Results
Find hostname from IP via PTR lookup
ASN Lookup: Understand and Use the Results
Get AS number, organization, and network type
Bogon Check: Understand and Use the Results
Check if IP is private, reserved, or bogon
Privacy Detection: Understand and Use the Results
Detect VPN, proxy, Tor, and datacenter IPs
Need Programmatic Access?
Automate domain intelligence with 100+ API endpoints and a free MCP server for AI integration.