get https://www.pelcro.com/api/v1/sdk/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
Parameter | Type | Description |
---|---|---|
countryCode | string | ISO country code of the user's location (e.g., "US", "CA", "GB") |
iso_code | string | DEPRECATED - Same as countryCode, provided for backward compatibility |
city | string | City name where the IP address is located |
continent | string | Two-letter continent code (e.g., "NA" for North America, "EU" for Europe) |
latitude | string | Approximate latitude coordinate |
longitude | string | Approximate longitude coordinate |
postalCode | string | Postal/ZIP code for the general area (not exact address) |
metroCode | string | Metro area code for US locations (Nielsen DMA code) |
region | string | State, province, or region name (e.g., "California", "Quebec") |
regionCode | string | State/province code (e.g., "CA" for California, "QC" for Quebec) |
timezone | string | IANA timezone identifier (e.g., "America/Toronto", "Europe/London" |
isEUCountry | boolean | Whether the country is part of the European Union for GDPR compliance |