Search within a radius
With locations in place, "near me" is a search from a point: give it where the visitor is and how far to look, and only what's inside the circle comes back — sorted by distance.
Search from a point
Add the visitor's position and a radius to a search. Search Stack returns only the records inside that circle, closest first, and stamps each result with its distance — so you can show "2.3 km away" without doing the maths yourself.
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 — it rides along with the rest of search. You can search text and filter by a facet and restrict to a radius in one query: "cinemas showing tonight, within 10 km, sorted by distance". The location is just one more thing the same search understands, which is exactly what the box at the top of this lesson does when you pick a city and a radius.
Go deeper: Radius search, distances, and combining with text and filters in the reference.