Location Verification: What an IP Address Proves About a Customer
Why one country field is not a location check
Say a customer opens an account from a phone in Lagos and the signup form says United Kingdom. The IP lookup returns the United Kingdom too. The team approves the account, and three weeks later the chargebacks arrive. A different team sees the reverse case: a paying customer in Frankfurt whose IP resolves to a mobile gateway two hundred kilometres away, flagged as a mismatch and pushed into manual review for no reason.
Both teams made the same mistake. They treated an IP address as a location proof, when it is a network signal with a known error radius. The error is not random either. It is largest exactly where fraud teams need it most.
Recent measurement work on IP geolocation databases puts a number on that gap. The same providers that place fixed line addresses within 16 kilometres at the median miss mobile addresses by 179 to 207 kilometres.
The authors find that mobile networks exhibit median errors more than 10 times higher than fixed networks across all providers (179 to 207 km vs 3 to 16 km), and that Global South regions show significantly higher failure rates than Global North: Asia exceeds 53 to 61 percent and Africa 66 to 72 percent, compared to 9 to 20 percent in Europe. The paper traces both gaps to prefix granularity, with approximately 70 percent of mobile prefixes spanning more than 100 km geographically. Lost in the Prefix: Revisiting IP Geolocation Accuracy Across Networks and Geographies, arXiv 2605.21937
That changes how the rule should be written. The question shifts from whether to check the IP to what each field on the response is allowed to decide.
What location verification means on a signup form
Location verification is the check that compares where a customer claims to be with where their connection actually comes from. The claim usually arrives as a dropdown, a billing address, a phone country code or a document. The connection evidence arrives as an IP address, and the lookup turns that address into a country, a region, a city and a network owner.
The useful question is narrow: whether the connection contradicts the claim badly enough to add friction, and which contradiction is strong enough to act on. A country that differs on a fixed line is a different signal from a city that differs on a phone, and a rule that scores both the same way produces the false positives that make a fraud team switch the check off.
Geolocation verification works best as a small set of named comparisons rather than one generic flag.
The four location claims on most forms
Most onboarding flows carry four separate location claims, and they do not agree with each other because they measure different things.
| Claim | Where it comes from | What it actually proves |
|---|---|---|
| IP country | The connection | Where the traffic entered the internet, as seen by the provider database |
| Billing country | The card or the address form | What the customer typed, matched against the issuer's country rules |
| Phone country | The number prefix | Where the number was issued, not where the phone is now |
| Document country | ID or licence upload | The issuing authority, which rarely changes when someone moves |
An address verification service covers the billing side and is worth reading on its own terms. The IP side answers a different question, and it is the only one of the four that the customer cannot type differently to pass.
What the IP address actually returns
The v2 IP Lookup endpoint returns the geolocation fields, the network owner and an optional security module in one response. The fields that carry weight for a location check are the country code, the region, the city, the postal code, the coordinates, the ASN type and the security flags.
curl -s "https://v2.greipapi.com/lookup/ip/165.227.149.217?params=security,timezone" \
-H "Authorization: Bearer $GREIP_API_KEY"{
"success": true,
"data": {
"ip": { "address": "165.227.149.217", "version": 4, "bogon": false },
"geo": {
"continent": "Europe",
"country": "Germany",
"country_code": "DE",
"region": "Hessen",
"city": "Frankfurt am Main",
"postal": "65931",
"latitude": 50.11552,
"longitude": 8.68417
},
"asn": {
"number": "AS14061",
"name": "DIGITALOCEAN-ASN",
"org": "DigitalOcean, LLC",
"type": "hosting"
},
"security": {
"vpn_or_proxy": true,
"vpn_or_proxy_type": "VPN",
"tor": false,
"bot": false,
"relay": false,
"hosting": true,
"is_blacklisted": false
}
},
"execution_ms": 4
}The sample above is the documented example response from the IP Lookup reference, trimmed to the fields a location check needs. Two things in it matter more than the city. The ASN type reads hosting, and the security module says the connection is a VPN on a hosting network. A customer who claims to be at home in Frankfurt while their traffic exits a DigitalOcean address in Frankfurt is not a geography problem. The city matches and the account is still suspicious, because the network type tells you the address is rented.
Why a city match is not a location proof
City level accuracy is the weakest part of any IP geolocation database, and the reason is structural rather than a vendor defect. Addresses are allocated in blocks, a block covers a geographic area, and providers estimate that area from routing data, registry records and latency measurements. When the block is large, the estimate is coarse.
Mobile networks make the block especially large. A carrier holds a range that serves a whole metro area or several, subscribers share addresses through carrier grade NAT, and traffic leaves through a regional gateway. The lookup returns the gateway. On a fixed line the same logic applies at a smaller scale, which is where the 3 to 16 kilometre median error comes from.
The practical result is that a city mismatch on a mobile connection is weak evidence, and a country mismatch is stronger but still not conclusive. A country match is weaker than most teams assume as well, since a proxy in the right country costs little. That is why IP address verification and proxy detection have to be read together, and why a single risk number for the connection helps when the fields disagree.
Read the network type before the city
The single most useful field on the response for location work is the ASN type, followed by the security flags. They explain why the location looks the way it does.
A hosting ASN means the address belongs to a cloud or data centre provider. Traffic from it is usually a server, a VPN exit or a scraper, whatever the city says. A security module that reports a VPN or proxy means the visible location is the exit node, so the country is where the exit sits and not where the person sits. Tor and private relay flags carry the same implication. A residential network type in the claimed country, with no proxy flag, is the case where the geolocation field deserves the most trust.
This is the part of the response that turns a lookup into a decision. The VPN and proxy detection reference explains the flags field by field, and the IP fraud score takes the same signals further into a single number with a recommendation.
A check that compares the claim with the connection
The comparison itself is a few lines. Take the country the customer declared, the country the lookup returns, the network type and the proxy flags, then return an outcome instead of a boolean.
async function checkLocation(customerIp, declaredCountry, apiKey) {
const url = `https://v2.greipapi.com/lookup/ip/${encodeURIComponent(customerIp)}?params=security`;
const res = await fetch(url, { headers: { Authorization: `Bearer ${apiKey}` } });
const body = await res.json();
if (!body.success) return { outcome: "review", reason: "lookup_failed" };
const d = body.data;
const ipCountry = d.geo.country_code;
const networkType = d.asn?.type ?? "unknown";
const s = d.security ?? {};
if (d.ip.bogon) return { outcome: "review", reason: "bogon_address" };
if (s.tor) return { outcome: "block", reason: "tor_exit" };
const countryMismatch = ipCountry !== declaredCountry;
const rentedNetwork = networkType === "hosting" || s.vpn_or_proxy === true;
if (countryMismatch && rentedNetwork) {
return { outcome: "block", reason: "country_mismatch_on_rented_network" };
}
if (countryMismatch) {
return { outcome: "review", reason: "country_mismatch", ipCountry };
}
if (rentedNetwork) {
return { outcome: "review", reason: "claimed_country_via_proxy" };
}
return { outcome: "accept", reason: "country_match_residential" };
}Four outcomes instead of a pass or fail. The customer who matches the country on a residential line passes. The customer who matches the country through a VPN goes to review, and the reviewer can see the exit network without running another tool. The mismatch on a rented network is the pairing that earns a hard stop.
Run the call from your server. The key belongs in an environment variable, and the request should carry the customer address from your own edge, not one the browser supplies.
Where the decision should land
| Signal pattern | What it usually means | Suggested outcome |
|---|---|---|
| Country match, residential ASN, no proxy flag | Consistent account | Accept |
| Country match, VPN or hosting ASN | Privacy tool or a cloud runner | Step up verification |
| Country mismatch, residential ASN | Travel, expat, border region, relocated number | Manual review with context |
| Country mismatch, hosting or proxy ASN | Exit node in another country | Block or hold |
| Tor exit | Deliberate anonymity | Block on financial flows, review elsewhere |
| Bogon or private address | Spoofed or malformed request | Reject the request |
The step up row is where most of the value sits. A VPN flag on its own is not fraud. Plenty of paying customers use one for reasons that have nothing to do with your product, and blocking them costs revenue with no matching gain. Asking for the second factor, or sending the confirmation code to the phone on file, sorts the honest privacy user from the account that was created with a stolen card in minutes.
Mismatches that are normal
Fraud rules age badly because they are written against a quiet baseline. Real traffic is messy, and some mismatch patterns are ordinary.
- A frequent traveller on a work VPN in another country, with a card issued at home
- A student on a university network whose egress address sits in a different region
- A border resident whose mobile carrier gateway is across the line
- A remote worker whose number was issued in one country and bought a local SIM in another, which also shows up in phone number scoring
- A customer on a privacy browser with private relay on, which hides the true origin by design
A rule that treats all of them as fraud will fire on a sizeable slice of good customers. The way to keep the rule sharp is to test each new condition against a sample of known good accounts before it goes live, and to keep the review reason attached so the queue can be triaged by cause rather than by score.
Compliance checks where location is an input
Location verification also shows up in flows where the question is regulatory rather than commercial: country restricted content, licensing by jurisdiction, tax treatment and sanctions screening. In each of those, the IP country is one input and rarely the deciding one.
If a licence limits you to a country, an IP country check can support the control, but a proxy defeats it in one step and a mobile gateway can raise a false alarm. Pair it with the declared address, the payment instrument country and, where the requirement is strict, a step that lets you verify location from the customer rather than letting the network assert it. Note what the check did and did not establish, because an auditor reading the log will ask which one you relied on.
What to log for a defensible review
An IP check that cannot be reconstructed later is hard to defend in a dispute. Store enough of the response that a reviewer six months from now can see what the system saw.
- The address that was looked up, and whether it was the customer address or a forwarded header
- The country, region and city returned, with the ASN number and type
- The security flags as returned, not as summarised
- The declared country and where the declaration came from
- The outcome your rule produced, with the reason string
- The timestamp, the endpoint version and the params you sent
Store the raw body if your privacy policy allows it. Fields change and providers revise their databases, so a summary written at the time is not the same evidence as the response itself.
Measure your own accuracy in shadow mode
Every fraud team has one dataset that beats any benchmark: its own closed accounts. Before switching a location rule to enforce, run it for a few weeks and log the outcome without acting on it.
Then compare the outcomes against what you later learned. Accounts that ended in chargebacks, disputes or confirmed fraud are your positive label. Accounts that paid for six months without a problem are the negative one. The comparison tells you how many mismatches your traffic actually produces, and what share of them were fraud. That number is specific to your customers and your corridors, and it is the one that should set the thresholds.
Run the same test by connection type. If a large share of a country's traffic arrives over mobile networks, the country level rule will behave completely differently from the one you tested on a fixed line population, and the mismatch volume will reflect the gateway placement rather than the risk.
What to ask a provider before you rely on it
Provider claims about accuracy are hard to compare because the test sets differ. Ask questions that produce an answer you can check against your own data.
- Is a network type field returned, and does it separate hosting, mobile and residential
- Are VPN, proxy, Tor and private relay reported as separate flags with a label
- Does the response include an ASN, so you can see the network owner behind the address
- How often is the database refreshed, and is the refresh documented anywhere public
- What happens on an address the database does not know, and is that visible in the response
A provider that answers those five with fields you can store will be easier to audit than one that answers with an accuracy percentage and no test conditions. The IP location intelligence service page lists the modules Greip returns, and the IP Lookup endpoint is available on the Standard plan and above.
The rule to keep
Use the IP address to find contradictions, not to establish a fact. Country level differences on fixed lines are worth a review. City level differences are worth almost nothing on a mobile connection, and the measured error above shows why. A proxy or hosting flag changes what the location field means, and the pairing of a country mismatch with a rented network is the combination that justifies a block.
Everything else is a queue decision that needs context, a reason string and a log.
FAQ
What is location verification
Location verification is the process of comparing the location a customer declares with evidence from their connection, usually an IP address lookup, and deciding whether the two agree closely enough to proceed.
How accurate is IP geolocation at city level
City level accuracy varies with the network. Measurement across four major providers found median errors of 3 to 16 km on fixed networks and 179 to 207 km on mobile networks, with much higher failure rates in Asia and Africa than in Europe.
Why does a mobile IP show the wrong city
Mobile carriers share address ranges across large areas and route traffic through regional gateways. The lookup returns the gateway location rather than the handset, and the address block can span more than a hundred kilometres.
Does a VPN country mismatch always mean fraud
No. Privacy tools, corporate VPNs and remote workers all produce mismatches. A mismatch on a residential network is a review signal, while a mismatch combined with a hosting or proxy network is the pattern that warrants a block.
Can IP geolocation be used for compliance checks
It can support a country control, but it is not a legal conclusion on its own. A proxy defeats a country check, so strict requirements need a step where the customer proves the location and a log that records what the check established.
What should I store from an IP location check
Store the looked up address, the returned country, region, city, ASN number and type, the security flags, the declared country, the decision with its reason, and the timestamp. The raw response is the strongest evidence if policy allows it.
Get started
Start protecting your business today
Our service is trusted by thousands of businesses worldwide.
- 1,000 requests during trial
- Cancel anytime