POI Lookup
POI Lookup API provides basic information of POI(scenic spot, tide stations, currents stations, etc.)
| Interface code | Interface | Class |
|---|---|---|
| geoPoiLookup | POI Lookup | GeoPoiResponse |
Parameters
GeoPoiLookupParameter
-
location(required)The location to be queried, support text, LocationID, comma-separated longitude and latitude (decimal, up to 2 decimal places), Adcode(Chinese cities only). For example:location=beijingorlocation=116.41,39.92 -
type(required)Choose to search for a certain type of POI.scenicScenic SpotCSTACurrents StationTSTATide Station
-
citySearch for POI within a given city. The city name can be text or the city’s LocationID.The city name is an exact match. It is recommended to use LocaitonID. If the text cannot be matched, the data returned will be empty.
-
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.
Sample code
Swift
Task{
do {
let response = try await QWeather.instance
.geoPoiLookup(.init(location: "116.41,39.92", type: .SCENIC))
} catch QWeatherError.errorResponse(let error) {
print(error)
} catch {
print(error)
}
}
Objective-C
GeoPoiLookupParameter *parameter = [GeoPoiLookupParameter instanceWithLocation:@"116.41,39.92" type:PoiSCENIC city:nil number:@(10) lang:@(LangZH_HANS)];
[QWeatherObjc geoPoiLookup: parameter completionHandler:^(GeoPoiResponse * _Nullable response, NSError * _Nullable error) {
if (response) {
NSLog(@"%@", response.description);
}
if (error) {
NSLog(@"%@", error.localizedDescription);
}
}];
Response
GeoPoiResponse
-
codeSee Status Code -
poi.namePOI Name -
poi.idPOI ID -
poi.latLatitude of the POI -
poi.lonLongitude of the POI -
poi.adm2Name of the superior administrative division of the POI -
poi.adm1The first-level administrative area of the POI -
poi.countryCountry name of the POI -
poi.tzPOI timezone -
poi.utcOffsetThe number of hours offset between local time and UTC time, refer to UTC Offset -
poi.isDstIs the POI currently on daylight saving time.1for daylight saving time and0for not in daylight saving time. -
poi.typePOI type -
poi.rankPOI Rank -
poi.fxLinkResponsive web page of this location, easy to embed in your website or APP -
refer.sourcesData source and other statements, may be null -
refer.licenseData license, may be null