Docs
← Back to site

Visitor location

2 min readUpdated November 21, 2026

Country, region and city come from Cloudflare first, which is the most exact. When Cloudflare cannot place a visit (an ad blocker sent it through the website, or it came through an unusual proxy), Settings › Data & API › Visitor location can fall back to:

  • A MaxMind GeoLite2 City database in your Cloudflare account. Free with a MaxMind account: in your MaxMind account, open Manage license keys, generate a key, and paste your MaxMind account ID and License key. No address leaves your Cloudflare account. It updates weekly.
  • An online lookup (ip2location.io, ipapi.co or freeipapi.com), with or without an API key. The page shows how many lookups were made this month.

Choosing an online lookup#

ServiceWithout an API keyWith an API key
ip2location.io1,000 lookups a day50,000 a month with a free key; paid plans from $49 a month for 150,000
ipapi.co1,000 lookups a dayPaid plans from $15 a month for 60,000
freeipapi.com60 lookups a minute on a shared serverPaid plans, with a regional server (United States, Germany, Singapore or Australia)

Choose one under Online lookup, paste its API key if you have one, and click Save. The key is kept encrypted, one per service, so switching back keeps it; Forget the saved key goes back to the free limit. Each service is asked only about visits Cloudflare could not place, and each answer is cached for 30 days per address block. Without a key the platform stays under the free limit; when a service is over its limit or has no answer, the MaxMind database answers instead.

Visitor location step 2, Online lookup, with ipapi.co chosen and its optional API key

The chosen service receives the visitor’s IP address for the lookup. Name it in your privacy policy; About lists it for you. ipapi.co (Kloudend, Inc., United States) says it keeps lookups in its server logs for a limited time.

For websites on someone else’s Cloudflare account that forward visits through their own server, turn on Add visitor location headers in that account (Rules › Settings › Managed Transforms) to keep region and city.

Was this helpful?