Loading...

Search within a radius

“Near me” is a search from a point: where the visitor is, and how far to look.

Search from a point

Add the visitor's position and a radius to a search. What comes back:

  • Only the records inside that circle, closest first.
  • Each result stamped with its distance, so you can show “2.3 km away” without doing the maths.
The near-me demo: San Francisco selected with a 150-mile radius, and the four airports inside the circle listed closest first, each stamped with its distance

The call behind it is one request — the point, the radius, the ranked results back:

GET https://api.searchstack.dev/search/Demo/places/1?lat=51.4545&lon=-2.5879&radius=10
X-API-Key: {your key}
{
  "results": [
    { "name": "Riverside Cinema", "@distance": 0.4 },
    { "name": "Old Market Screen", "@distance": 3.1 }
  ]
}

Combine it with everything else

Distance isn't a separate mode. One query can search text and filter by a facet and restrict to a radius: “cinemas showing tonight, within 10 km, sorted by distance”.

Go deeper: Radius search, distances, and combining with text and filters in the reference.

Top