4

Is there any way to search for items within distance of a lat/long for multiple lat/longs simultaneously? E.g., to say "give me all results within 10 miles of 14.2342,-13.234234 AND 1.3234,4.56775"?

I currently only see the ability to search one set of coordinates at a time.

jdotjdot
  • 15,178
  • 11
  • 63
  • 112

1 Answers1

3

In its current version, the API only allows to pass one lat/long value at a time. Nevertheless, it allows to pass multiple bounding boxes at the same time. That means that you could easily calculate the bounding boxe coordinates (see How to calculate the bounding box for a given lat/lng location?), and pass those to the search parameters.

You can find here https://www.algolia.com/doc/tutorials/geo-search a guide (+ sample code) showing how Geoloc search works. And more detail about the boundingBox parameters at https://www.algolia.com/doc/rest#param-insideBoundingBox

Community
  • 1
  • 1
Alex C
  • 785
  • 3
  • 7