IP geolocation guides
Practical guides on blocking or redirecting by country, verifying crawlers, detecting VPN users and using IP geolocation in JavaScript, Python and PHP.
Tutorial
IP geolocation in JavaScript, Python and PHP
Get the country, city and ISP of a visitor's IP address in Node.js, Python and PHP: finding the real client IP behind proxies, calling the API and caching.
Guide · bots
Verify Googlebot, Bingbot and GPTBot
Fake crawlers pretend to be Googlebot or GPTBot to bypass bot protection. Verify real crawlers with the official IP lists or reverse DNS, with nginx, Cloudflare and code examples.
Guide · fraud prevention
Detect VPN, proxy and Tor users
How VPN and proxy detection works, what to do with flagged users and how to add it to sign-up and checkout flows with an IP security API. With code.
Guide · geo-blocking
Block or redirect visitors by country
Geo-block or geo-redirect visitors by country with Cloudflare rules, nginx and GeoIP2, Next.js middleware or an IP geolocation API in Express. Copy-paste configs.
Comparison
Best IP geolocation APIs in 2026
ipbase, IPinfo, MaxMind GeoIP2, ipstack and ip-api compared: data, free tiers, pricing model and when to use a local database instead of an API.
IP geolocation API
Get this data in your app
ipbase returns location, ISP, ASN, time zone and security flags (VPN, proxy, Tor, data center) for any IPv4 or IPv6 address, up to 100 addresses per request.
150 free requests every month. No credit card required.
GET https://api.ipbase.com/v2/info?ip=1.1.1.1
{
"data": {
"ip": "1.1.1.1",
"type": "v4",
"connection": {
"asn": 13335,
"organization": "APNIC and Cloudflare DNS Resolver project",
"isp": "Cloudflare, Inc",
"range": "1.1.1.0/24"
},
"location": {
"country": { "alpha2": "AU", "name": "Australia" },
"zip": "4000"
},
"security": { "is_vpn": false, "is_tor": false, "threat_score": 0 }
}
}