Locations

Location keys

A location key is a unique identifier for a precise geographic location. Use one of the Locations API endpoints to find a location key. It is required for most API endpoints, including:

Find a location key

To get a location key, 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

Try a city search to get started:

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

Response:

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

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

Use a location key

Use the location key we just found in other API endpoints:

Code
GET /currentconditions/v1/347629

This returns the current conditions for San Francisco, CA.

Last modified on