Cloudflare provides several HTTP request headers that include information about the visitor's location, IP, and network characteristics. These are automatically added to requests sent to your origin server (your backend) when traffic is proxied through Cloudflare.
List of available location headers:
| Header | Example | Description |
|---|---|---|
cf-ipcity |
San Francisco | City name of the visitor's IP address. |
cf-ipcontinent |
US, EU | Continent code (NA, EU, AS, etc.). |
cf-ipcountry |
US, DE, IN | Two-letter ISO 3166-1 alpha-2 country code of the visitor's location. |
cf-iplatitude |
37.7749 | Latitude of the visitor's IP. |
cf-iplongitude |
-122.4194 | Longitude of the visitor's IP. |
cf-postal-code |
94107 | ZIP or postal code of the visitor. |
cf-region-code |
CA | ISO subdivision code, e.g., CA for California. |
cf-region |
California | Region or state of the visitor's IP address. |
cf-timezone |
America/Los_Angeles | Timezone name based on the IP geolocation. |
Note: Besides the ISO-3166-1 alpha-2 codes, Cloudflare uses the following special country codes:
- XX: Used for clients without country code data.
- T1: Used for clients using the Tor network.