Location

Retrieves the user's location properties based on their IP address.

📘

Location information is provided by Cloudflare's global network, and is based on IP address geolocation, not GPS or device location. Therefore, location properties returned may reflect the ISP/network location of the user, rather than an exact physical address. Country-level accuracy is very high, while other regional data is approximate and suitable for content localization, currency display, and regional customization purposes.

Description

Leverage this public endpoint to retrieve a structured JSON payload containing information about your current user's location. This information should be used for broad geographic targeting rather than precise location features.

Properties

ParameterTypeDescription
countryCodestringISO country code of the user's location (e.g., "US", "CA", "GB")
iso_codestringDEPRECATED - Same as countryCode, provided for backward compatibility
citystringCity name where the IP address is located
continentstringTwo-letter continent code (e.g., "NA" for North America, "EU" for Europe)
latitudestringApproximate latitude coordinate
longitudestringApproximate longitude coordinate
postalCodestringPostal/ZIP code for the general area (not exact address)
metroCodestringMetro area code for US locations (Nielsen DMA code)
regionstringState, province, or region name (e.g., "California", "Quebec")
regionCodestringState/province code (e.g., "CA" for California, "QC" for Quebec)
timezonestringIANA timezone identifier (e.g., "America/Toronto", "Europe/London"
isEUCountrybooleanWhether the country is part of the European Union for GDPR compliance
Language
Credentials
Query
Click Try It! to start a request and see the response here!