Top City
Get a list of popular cities around the world.
Top City
Interface Code | Interface | Class |
---|---|---|
getGeoTopCity | Top city | GeoBean |
Parameter
-
range
Set 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
-
number
Number of the results in response, from 1 to 20, 10 is the default. -
lang
Multi-language, default Chinese, if data does not match the language you set, it will return in English or its native language. Language parameter please refer to Language
Sample Code
QWeather.getGeoTopCity(Context context, int number, Range range, Lang lang, final QWeather.OnResultGeoBeansListener listener);
QWeather.getGeoTopCity(Context context, final QWeather.OnResultGeoBeansListener listener);
Properties
Properties of GeoBean
Property | Description | Example |
---|---|---|
getCode | See Status Code | 200 |
getLocationBean | City data | List<LocationBean> |
Refer
Property | Description | Example |
---|---|---|
getSourcesList | Data source and other statements | QWeather |
getLicenseList | Data license | QWeather Developers License |
LocationBean Basic Information
Property | Description | Example |
---|---|---|
getName | Location Name | Zhuozi |
getId | Location ID | 101080402 |
getLon | Longitude of the location | 112.577702 |
getLat | Latitude of the location | 40.89576 |
getAdm2 | Name of the superior administrative division of the location | Ulan Qab |
getAdm1 | The first-level administrative region of the location | Inner Mongolia |
getCountry | Country name of the location | China |
getTz | Location Timezone | Asia/Shanghai |
getUtcOffset | The number of hours offset between local time and UTC time, refer to UTC-Offset | +08:00 |
getIsDst | Is the location currently observing Daylight Saving time1 in daylight saving time 0 not in daylight saving time |
0 |
getType | Type of the location | city |
getRank | Location Rank | 10 |
getFxLink | Responsive web page of this location, easy to embed in your website or APP | https://www.qweather.com/weather/zhuozi-101080402.html |