City Lookup
City Lookup provides reverse geocoding, geolocation lookup services, supports multi-language, fuzzy search and other functions.
With the City Lookup, you can get the basic information of the city, including the Location ID of the city (you need this ID to get the weather), multilingual name, latitude and longitude, time zone, altitude, rank, administrative, etc.
In addition, GeoAPI - City Lookup can also help you to implement fuzzy search in your APP, users only need to type 1 or 2 words to get results.
Endpoint#
GET /geo/v2/city/lookupParameters#
Query parameters
-
location(required) The location to be queried, support LocationID or comma-separated longitude and latitude (decimal, up to 2 decimal places), LocationID can be obtained by GeoAPI. Example:location=101010100orlocation=116.41,39.92 -
admSuperior administrative divisions of a city, useful for excluding cities with similar names or for filtering results. Exampleadm = beijing -
rangeSet to search only within a certain country or region. The country and region name needs to use country code ISO 3166. If this parameter is not set, the search range will be all cities. Example:range=cn -
numberNumber of the results in response, from 1 to 20, 10 is the default. -
langMulti-language setting, please see Language to find out how our multi-language works and how to set up.
Request example#
curl -X GET --compressed \
-H 'Authorization: Bearer your_token' \
'https://your-api-host/geo/v2/city/lookup?location=116.41%2C39.92&adm=beijing&range=cn&number=10&lang=en'
Replace your_token and your_api_host with your JWT Authentication and API Host
Response#
{
"code": "200",
"location": [
{
"name": "Dongcheng",
"id": "101011600",
"lat": "39.91755",
"lon": "116.41876",
"adm2": "Beijing",
"adm1": "Beijing",
"country": "China",
"tz": "Asia/Shanghai",
"utcOffset": "+08:00",
"isDst": "0",
"type": "city",
"rank": "35",
"fxLink": "https://www.qweather.com/weather/dongcheng-101011600.html"
}
],
"refer": {
"sources": [
"https://developer.qweather.com/attribution.html"
],
"license": [
"QWeather Developers License"
]
}
}-
locationarray Location information list-
namestring Location Name -
idstring Location ID -
latstring Latitude -
lonstring Longitude -
adm2string Name of the superior administrative division of the location -
adm1string The first-level administrative area of the location -
countrystring Country name -
isDststring Is the location currently on daylight saving time.1for daylight saving time and0for not in daylight saving time -
typestring Location type -
fxLinkuri Responsive web page of this location, easy to embed in your website or APP
-
-
referobject Data sources and licensing information-
sourcesarray Data source and other statements, may be null -
licensearray Data license, may be null
-