Locations

Location Keys

A locationKey is a unique identifier to represent a specific geographic location. It is required for most API endpoints including:


How to Retrieve a locationKey

To get a locationKey, use one of the Location Search endpoints. Below are some examples:

Use CaseEndpoint
City name search/locations/v1/cities/search
Postal code search/locations/v1/postalcodes/search
Points of Interest search/locations/v1/poi/search
Cities by latitude/longitude/locations/v1/cities/geoposition/search
IP-based auto-detect/locations/v1/cities/ipaddress

Example

Code
GET /locations/v1/cities/search?q=San Francisco

Response:

Code(json)
[ { "Version": 1, "Key": "347629", "Type": "City", "Rank": 35, "LocalizedName": "San Francisco", "EnglishName": "San Francisco", "PrimaryPostalCode": "94103", ... } ]

➡️ 347629 is the locationKey for San Francisco, CA, US.


How to Use the locationKey

Once retrieved, use the key in other API endpoints:

Example

Code
GET /currentconditions/v1/347629

This returns the current conditions for San Francisco, CA.


Last modified on