获取"Named Places" ID 类型的"Image Media Type"



我使用Discover API查找一个位置,如下所示:

https://discover.search.hereapi.com/v1/discover?apiKey=<API_KEY>&q=Bremerton Boardwalk&at=47.5634276,-122.6236087

以回应

{
"items": [
{
"title": "Bremerton, WA, United States",
"id": "here:cm:namedplace:21002017",
"resultType": "locality",
"localityType": "city",
"address": {
"label": "Bremerton, WA, United States",
"countryCode": "USA",
"countryName": "United States",
"stateCode": "WA",
"state": "Washington",
"county": "Kitsap",
"city": "Bremerton",
"postalCode": "98337"
},
"position": {
"lat": 47.565,
"lng": -122.62749
},
"distance": 339,
"mapView": {
"west": -122.86392,
"south": 47.46469,
"east": -122.59263,
"north": 47.66075
}
}
]
}

现在,当我试图取回";"图像媒体类型";对于使用此API的上述ID,如下所示:

https://places.ls.hereapi.com/places/v1/places/here:cm:namedplace:21002017/media/images?apiKey=<API_KEY>

https://places.ls.hereapi.com/places/v1/places/21002017/media/images?apiKey=<API_KEY>

然后它的响应是:

{
"status": 404,
"message": "Place with id '21002017' not found."
}

它适用于像here:pds:place:840c23nb-55907767fca8456382de39d4bcf6f5e7这样的ID。

  • here:cm:namedplace:*这样的ID有什么特别之处吗
  • 如何获取Discover API返回此类ID的这些地方的图像

请检查此请求,它可以完成以下任务-

使用发现API查找位置详细信息,如下所示-

https://discover.search.hereapi.com/v1/discover?apiKey=<API_KEY>&q=Bremerton Boardwalk&at=47.5634276,-122.6236087

为了通过HERE ID查找位置,API包括/lookup端点,如下所示-

https://lookup.search.hereapi.com/v1/lookup?id=here:cm:namedplace:21002017&apiKey=<API_KEY>

从发现端点返回的位置id。

请查看此处的文档。

https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-discover-brief.html

https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-lookup-brief.html