Ocasionally I get asked by developers whether they can provide multiple terms when performing a places API search with CityGrid.
The “what” parameter is best when applied a single keyword or key phrase and does not work with multiple keywords.
I recommend using the tag parameter:
- tag (Restricts search to listings with the given tag id) - Tag ids are internal CityGrid identifiers and subject to change. This parameter should only be used in queries that are obtained as “refinement urls” from previous searches
You can find tag IDs via previous searches or turning on historgrams which will break your search into groups and categories, returning tags.
Here are some examples:
<tag id=”11238″ primary=”false”>Bar Scene</tag>
<tag id=”11204″ primary=”false”>Brazilian</tag>
<tag id=”11256″ primary=”false”>Date Spot</tag>
<tag id=”11269″ primary=”false”>Group Dining</tag>
<tag id=”11367″ primary=”false”>Open 7 Days</tag>
<tag id=”11298″ primary=”false”>People Watching</tag>
Take any Tag ID and append to your search: &tag=1722
You can also apply multiple tags to a places search: &tag=1722&tag=11256&tag=11333
Tags provide a powerful way you can further filter a places search for your user and allow them to filter by specific tags such as food type, payment method or the thousands of other tags CitiyGrid uses.
Right now you will have to build a dynamic way of collecting the tags provided within the places searches you perform and return to users via your web or mobile app interface–until CityGrid is able to provide a set of meta APIs that provide publishers with access to all tags and corresponding IDs.Categories / Filtering / Places Search / Related Search / Tags