Geo Search
Filter search results based on geographical distance from the user's current location.
Filtering by Distance
To restrict results to a specific radius, use the geo_range filter in the f[] parameter.
Key Requirements:
- Context: You must provide the user's location using the
context[geo_location]parameter (e.g.,49.0448,18.5530). - Indexing: Your product data must contain a field with coordinates (default:
geo_location).
See context[geo_location] in the API reference.
Example Request: f[]=geo_range:|50km&context[geo_location]=49.0448,18.5530
Filter Syntax
The geo_range filter value follows the pattern lower_range|upper_range. Use numbers followed by km. You can leave one side empty for an open interval.
| Pattern | Meaning | Example |
|---|---|---|
| |Xkm | Less than X km | |50km |
| Xkm| | More than X km | 10km| |
| Xkm|Ykm | Between X and Y km | 10km|50km |