IP Geolocation in Your App: 7 Places It Changes a Decision
Every product team that adds IP location hits the same week. A fraud report lands, someone wires country and city into a rule, and the rule starts firing on honest customers. The lookup was not the weak part. The assumption was.
An IP address belongs to whoever holds the connection behind it: a flat, an office, a mobile tower, a data centre running someone else's traffic. Read a location field that way and the work changes shape. You stop asking IP geolocation to prove who a person is, and start using it to decide what to check next.
A 2026 measurement study of four major geolocation providers, using RIPE Atlas and UNICEF Giga ground truth across 175 countries, found median errors of 179 to 207 km on mobile networks against 3 to 16 km on fixed networks. Roughly 70% of mobile prefixes span more than 100 km. Failure rates reached 53 to 61% in Asia and 66 to 72% in Africa, against 9 to 20% in Europe.
Nabi, Bliton, Chung and Hasan, "Lost in the Prefix: Revisiting IP Geolocation Accuracy Across Networks and Geographies", arXiv:2605.21937, submitted May 2026.
That study sets the ceiling for what any provider can promise at city level. It also explains the failures support teams see every day: a customer in Madrid shows up as Paris, a phone in Nairobi resolves to a tower's regional core three hours away. The rules have to be built on fields that survive that noise.
What an IP address can and cannot tell you
A lookup returns more than a place name. Greip's GET /lookup/ip/{ip} returns the address version, a geo block with country, region, city and coordinates, the network owner as an ASN with a type such as hosting or ISP, security flags for VPN, proxy, Tor and relay, and optional module blocks for currency, timezone, device and location detail that you request with params.
That is the whole of IP address geolocation in commerce: a handful of fields that describe a network at a moment in time. Read together, those fields answer different questions. Country tells you which rule set applies. The ASN tells you whether the connection comes from a home broadband line, a mobile carrier, a hosting provider or a corporate egress point. The security flags tell you whether someone is hiding the route. The device module adds whether the session looks mobile, which matters because the same city field means something different on a phone than on a fibre line.
Country and region survive mobile routing far better than city does. When a rule breaks because a customer travelled, it is almost always a city rule.
The mistake to avoid is treating a single field, or a single set of geolocation data, as proof of anything. A city match is weak evidence. A country match with a hosting ASN and a proxy flag is strong evidence of something worth a second look.
Signup: checking that an account comes from where it claims
The first place IP location earns its keep is account creation, because that is where a fake account is cheapest to stop. A signup from a hosting ASN in a country the customer did not mention is one signal. A signup from a residential line in the stated city is a weak positive, not a pass.
What makes the check useful is what you compare it against. Put the IP country next to the phone country code, the email domain, the billing country on the card and the language of the form. Two fields agreeing is ordinary. Three disagreeing on a first order is worth a verification step, a hold or a manual review.
Greip's fake accounts use case sets out the signal set that matters at this stage. The practical version for most teams is short: score the signup, ask for one extra proof when the score is in the middle, and block only when several independent fields point the same way. Blocking on a country alone turns a fraud problem into a growth problem.
Login: catching the session that changed network
Account takeover looks different from signup fraud and needs a different rule. Here the history matters more than the absolute location. A customer who has logged in from the same city and the same ASN for eight months, then appears from a hosting provider in another country with no VPN flag change, is worth a step up whatever the city field says.
Two signals carry most of this work. The first is the change itself: same account, different network, short window. The second is what the network is. Relay traffic, hosting ranges and proxy exits are the usual vehicles for a stolen session, and each is reported as its own flag rather than folded into one vague risk number.
Greip's account takeover use case covers the sequence. The tech side is a lookup at login on the server, not in the browser, because a client side call can be skipped by anyone automating the login.
Checkout: when the address, the network and the issuer disagree
Payments are where location data gets misused most often, because the temptation is to treat the billing country as a truth test. It is not. People order to a second home, send gifts abroad and use cards issued in the country they left.
The useful pattern at checkout is agreement scoring. IP country, billing country, issuing country from the card BIN, shipping country and the phone's country code each get a vote. When they line up, the risk of a location based rule firing is low and you can keep friction down. When the IP sits in one country, the card was issued in a second and the shipping address is in a third, the order is not automatically fraud, but it does deserve the checks that cost the least: address verification, 3D Secure where the issuer supports it, and a velocity rule on the shipping address.
Our VPN and proxy detection service exists for the case where the customer's route is deliberately hidden. A masked route does not prove fraud either. It removes location from the evidence you can use, which changes the weight the other fields deserve.
Pricing and currency: display rules are not enforcement rules
Regional pricing is a legitimate use of IP location and a common source of bugs. Showing a price in the visitor's currency, with tax treatment that matches the country, is a display decision: if it is wrong, the customer sees a price that fails at checkout and support fixes it.
Enforcing regional pricing is a different job. If a discount exists only in one market, the check belongs on the server at the moment of purchase, and it needs to accept that a customer in that market may be travelling or using a work VPN. Blocking on the IP country alone locks out paying customers who route through a company network.
For the ecommerce version of this work, including the geo targeting side, IP geolocation for ecommerce goes deeper into pricing and localization. The short version here is that display rules can be generous and enforcement rules cannot.
Content, language and redirects
Language detection from IP is convenient and easy to get wrong. A visitor in the Netherlands is not necessarily a Dutch speaker, and a customer on a corporate tunnel in Frankfurt may be sitting in Cairo.
Two habits keep this useful. Suggest rather than force: pick a default language, show it, and keep the switcher obvious on the first screen. And keep the redirect out of the path of links people share. A hard redirect keyed to IP country breaks bookmarks, breaks shared URLs and confuses crawlers, which is a lot of damage for a small convenience.
The web personalization use case covers the softer version, where location sets a default in a way the visitor can override in one click.
Analytics: what location data does to your funnel numbers
Location is the one attribute every request carries without consent prompts, cookies or a client side call, which makes it tempting to treat as a clean traffic source in your funnel. It is clean in the sense of always present and always the same for the same visitor. It is not clean in the sense of always true.
Segment by country and your mobile traffic will look fuzzier than your desktop traffic, for the reason the study found: carrier prefixes are coarser. If signup conversion looks worse in one market, check whether the market has a large mobile share before concluding anything about intent or the product.
For reporting, aggregate at country level and keep city level out of dashboards people make decisions from. Save city for the individual case, and treat it as a hint there too.
Support queues: what an agent needs on the same screen
The most overlooked use of location data is inside the review queue. An agent deciding whether to release an order needs a small set of facts in one place: the IP country and city, the ASN and its type, whether the route was masked, whether the device looked mobile, the billing and shipping country, and the account's earlier network history.
With those on one screen, an agent can usually clear a held order in under a minute. Without them, they ask the customer for documents, which costs more and annoys the honest majority.
The cases where IP location stops working
Five situations account for most of the noise, and each has a workable answer.
Mobile carriers route traffic through a regional core, so a phone in one city can resolve to another, and IP based location for a phone is often the core rather than the customer. Treat mobile city as unknown and let the country and the security flags carry the decision.
Carrier grade NAT puts many subscribers behind one address, so the address is shared and its history is not one person's history. Velocity rules keyed to a single IP will over fire on those ranges, which is why the ASN type matters.
VPN and proxy users show the exit location. A customer who turns on a VPN to watch a streaming catalogue in another country will look like they travelled. Compare against the account's history and step up rather than block.
Corporate networks egress in one place. Staff in three countries can all appear from a head office address, so the address says little about where the person is.
Satellite and some rural links land where the ground station is, which can be a different country from the customer, especially on maritime and remote connections.
Wiring it in: one server side lookup, cached per session
Do the lookup on the server, at the points where a decision is made: signup, login, checkout and any price or entitlement check. One IP geolocation lookup, modules limited to what you use, and no browser call that a script can skip, which is also the simplest form of geo detection to defend in a code review.
curl --request GET \
--url "https://v2.greipapi.com/lookup/ip/165.227.149.217?params=security,location,currency" \
--header "Authorization: Bearer <api key>"The response carries the fields the rules need, without asking for modules you will not read:
{
"success": true,
"data": {
"ip": { "address": "165.227.149.217", "version": 4, "bogon": false },
"geo": { "country": "Germany", "country_code": "DE", "region": "Hessen", "city": "Frankfurt am Main" },
"asn": { "number": "AS14061", "name": "DIGITALOCEAN-ASN", "type": "hosting" },
"security": { "vpn_or_proxy": true, "vpn_or_proxy_type": "VPN", "tor": false, "relay": false, "hosting": true },
"currency": { "code": "EUR" }
}
}Cache the result per session, not for days. Addresses get reassigned, and a cached location from last month can be wrong in a way nobody will notice until a customer is blocked. The response modules page lists what each params value adds, and the IP lookup reference has the full field list.
Read the ASN separately when you need network detail rather than location. The network intelligence service and the ASN lookup reference cover the fields, including the type that separates a hosting range from a residential line.
Scoring beats blocking
A rule that blocks on a single field will be wrong often, and every wrong block costs a customer. A small score is easier to defend and easier to tune.
Give each signal a weight: masked route, hosting network, country mismatch with billing, new device combined with a new country, several accounts on one address in a short window. Then set two thresholds, one for extra verification and one for a hold. Write down why each weight exists, so the next person can change one without breaking the rest.
Keep the scores in your own system, not buried in a vendor dashboard. When support asks why an order was held, the answer should be readable in one line.
Measuring the result after launch
Two numbers decide whether the rule set is working: fraud caught before fulfilment and honest customers pushed into friction. The second is the one teams forget to instrument.
Pick a sample of held orders each week and have a person judge them. Track how many held orders were real fraud, how many were customers who completed verification and how many abandoned at the step. If the abandonment share climbs while the fraud share stays flat, the rules are too tight, whatever the fraud team says.
No published benchmark applies to your traffic. Your own sample is the only honest baseline, and it changes with your markets, your payment mix and the season.
Frequently asked questions
Is IP geolocation accurate enough to block a signup?
Country level is accurate enough to be one signal in a decision. City level is not accurate enough to be proof, and the 2026 study found median mobile errors above 100 km, so a city based block will hit honest customers. Score the signup and block only when several independent fields agree.
What is the difference between IP location and device location?
Device location comes from GPS or the browser and needs the user's permission, so it is unavailable on many requests and easy to fake in an automated client. IP location is derived from the network on the server, which means you always have it, including on requests where the client sends nothing.
Why does a VPN user show the wrong country?
A VPN sends traffic through an exit node in another country, so the address belongs to that node's network. The lookup is correct about the network and wrong about the person. Greip reports this in the security block with the VPN or proxy flag and the relay flag, which lets you treat the location as unavailable rather than false.
How long should a location lookup be cached?
For the length of the session, and no longer. Addresses are reassigned between customers and connections change when a phone moves between networks. A cache measured in days will hand you stale locations, and the failure shows up as a block on a customer who never moved.
Does IP geolocation work for IPv6?
Yes. The v2 lookup returns the address version, and the same geo, ASN and security blocks apply. IPv6 prefixes are often larger than IPv4 ones, so a single prefix can cover more ground, which makes country level the safer aggregate there too.
Can I use IP location to set prices?
For display, yes: currency and tax treatment by country is standard. For enforcement, treat it as one field in a wider check, because customers travel and many route through a work VPN, so a mismatch is a prompt for another check rather than a refusal.
The IP geolocation service returns the country, currency and the EU flag in the same response, so the mismatch check costs one request.
Get started
Start protecting your business today
Our service is trusted by thousands of businesses worldwide.
- 1,000 requests during trial
- Cancel anytime