Search Query String Operators

Hello,

I’m looking to obtain all POIs for “Granite Fabricators” within a certain geo-range. If I utilize the following API search, I only receive Granite Fabricators that have the word “granite” included in their name. Some Granite Fabricators have the word “stone” in their name.

My Current Query:
https://api.tomtom.com/search/2/search/granite.json?countrySet=US&lat=40.44&lon=-79.99&radius=50000&idxSet=POI&categorySet=9361&limit=100&maxFuzzyLevel=2&key=

  1. Does the TomTom API accept operators within the query string itself?
    a. For example, can I use the OR operator || (“word||word”)
    b. https://api.tomtom.com/search/2/search/granite||stone.json?countrySet=US&lat=40.44&lon=-79.99&radius=50000&idxSet=POI&categorySet=9361&limit=100&maxFuzzyLevel=2&key=

  2. Referencing my current query; Would this be the correct / most efficient query I can use to obtain what I need? I also tried maxFuzzyLevel=4 which didn’t return the needed results.

  3. Is it possible to search using zip code instead of latitude and longitude?

  4. Is it possible to request only the Search parameters I need?
    a. For example: Lets say I utilize the above search but I only want the poi {name, phone, url }, address and position. Everything else can be excluded.

Thanks for the help!

v/r
Jason

Hi Jason,
It is not possible to use any operators for a query string. Instead of that I have several sugggestions that you can follow and might find useful.

  • you can perform 2 subsequent API calls and merge results on your end
  • this is rather a term matching behavior as we don`t have such categories in the API. It means that you can expect results having phrases ‘granite’ or ‘fabricators’ or ‘stone’ in the name rather than actual category that I assume you look for
  • based on the above I would consider checking the POI categories endpoint https://developer.tomtom.com/search-api/search-api-documentation-poi-categories/poi-categories to find categories that may fit your need (e.g. categorySet=9361042, which is “construction material equipment”)
  • you can than restrict your request using categorySet for specific categories only (you can pass a list). Providing query string is optional in such case - the category derives the results
  • you can also play around with geometry search if you are interested in a specific area rather than a radius. Geo spatial filters also include bounding box parameter that can be used
  • zip code can always be part of your query string
  • for now Search API always provides full response and no exclusion mechanism is supported

Let us know if the above helps a bit in your case

2 Likes

Thanks for the help.