Skip to content

AWS Location Service v2 Places API /suggest - is it possible to filter out certain POIs?

0

I am trying to upgrade from v0 places apis to v2. The v0 /suggest api with the use of Esri place index used to take FilterCategories as input and I used to use that to only bring back certain types of POIs such as school and park.

According to https://docs.aws.amazon.com/location/latest/developerguide/places-filtering.html, v2 no longer supports that. I can see an alternative to filter the response at the client end. But this is non-ideal as "Core" additional features have to be turned on which is heavier weight and more costly. Also with the MaxResults set, there could be no results returned from the desired categories.

Is there other alternative ? Or should I stay on using v0 - will it be deprecated?

asked a year ago202 views
1 Answer
0

You're correct that the Amazon Location Service v2 Places API's /suggest endpoint no longer supports filtering categories in the request. This is a change from the v0 API that you were previously using with the Esri place index.

In the v2 API, the Suggest operation does not have a direct equivalent to the FilterCategories parameter. However, there are a few alternatives you can consider:

  1. Client-side filtering: As you mentioned, you can filter the results on the client side. This approach requires enabling the "Core" additional features, which does indeed increase the cost and data payload. It's not ideal, especially with the MaxResults limit, as you pointed out.

  2. Use the SearchNearby or SearchPlaceIndex APIs: If your use case allows, you could consider using these APIs instead. They support filtering by categories in the request using the Filter parameter. For example, with SearchNearby, you can use the IncludeCategories filter to specify categories like schools and parks.

  3. Two-step approach: You could use the Suggest API to get initial results, and then use those results to make a subsequent call to SearchPlaceIndex or GetPlace to retrieve more detailed information, including categories. This would allow you to filter at that stage.

  4. Provide feedback to AWS: Since this is a significant change that affects your use case, it would be valuable to provide feedback to AWS about the need for category filtering in the Suggest API.

Regarding the v0 API, AWS typically maintains backwards compatibility for a considerable time. However, it's generally recommended to migrate to the latest version when possible. AWS hasn't announced any immediate plans to deprecate v0, but it's always a good idea to stay updated with the latest versions for long-term support and new features.

If the category filtering in Suggest is crucial for your application and the alternatives don't meet your needs, you might need to continue using the v0 API for now. However, you should plan for eventual migration and keep an eye on AWS announcements regarding the v0 API's lifecycle.
Sources
Filtering - Amazon Location Service
Suggest - Amazon Location Service
SearchPlaceIndexForSuggestions - Amazon Location Service

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.