IP geolocation tutorials
Short guides with code you can copy and run. Each one uses the IPIDB API or a database file and explains the choices on the way.
IP geolocation in PHP
Look up the country, city, ISP and time zone of an IP address in PHP with cURL and the IPIDB API, with caching, error handling and the real client IP.
IP geolocation in Python
Get the location, network and time zone of any IPv4 or IPv6 address in Python with requests: a reusable client, retries on 429, batch lookups and caching.
IP geolocation in Node.js
Find the country, city and ISP of a visitor in Node.js 18+ with the built-in fetch, an Express middleware for the client address and an in-memory cache.
IP geolocation in Go
A small Go client for IP geolocation with net/http and encoding/json: typed response structs, timeouts, error codes and a lookup of many addresses in one batch.
Block countries in nginx with an MMDB database
Block or allow traffic by country in nginx with the geoip2 module and an MMDB country database: install, map country codes, exceptions and testing.
Detect VPN and proxy logins
Check a login against VPN, proxy, Tor, hosting and blacklist flags with the IPIDB API in PHP, score the risk and ask for a second factor instead of blocking.
Looking for the reference instead? The API documentation lists every endpoint, field and error code, and the FAQ answers questions about limits and plans.