Mode
The mode object chooses between a midpoint search (POINT) and a route search (PATH), and sets the search distance.
"mode": {
"mode": "POINT",
"maxDistance": 500
}Prop
Type
mode is required
If mode is missing or misspelt (for example "point"), no location filter
is applied and results can come from anywhere. The same happens with PATH
and fewer than two locations.
POINT mode
InBe works out the weighted midpoint of all your locations, then searches within maxDistance metres of it. Use it for meetups, "near me" searches and anything centred on one spot.
{
"locations": [
{ "lat": 51.5072, "lon": -0.1276 },
{ "lat": 51.5154, "lon": -0.1419 }
],
"mode": { "mode": "POINT", "maxDistance": 750 }
}The response includes centerPoint (the midpoint) and each venue's distanceMeters from it.
PATH mode
InBe joins your locations, in order, into a route made of straight lines, then searches within maxDistance metres either side of it. Use it for walks, tours and "somewhere on the way". You need at least two locations, and weights are ignored.
{
"locations": [
{ "lat": 51.5007, "lon": -0.1246 },
{ "lat": 51.5045, "lon": -0.0865 },
{ "lat": 51.5081, "lon": -0.0759 }
],
"mode": { "mode": "PATH", "maxDistance": 150 },
"preferences": { "establishmentFilters": ["serves_coffee"] }
}The route is a series of straight lines between your points, not a road or walking route. For a route that follows streets, get a polyline from a navigation provider and send a selection of points along it as locations.
In PATH mode, centerPoint is null and venues have no distanceMeters.
Choosing maxDistance
maxDistance is a straight-line distance. Walking routes are usually 20-40% longer.
| Use case | POINT radius | PATH corridor |
|---|---|---|
| Dense city centre | 300-800 m | 50-150 m |
| Suburbs or a small town | 1,000-3,000 m | 200-500 m |
| Rural or by car | 5,000 m and up | 1,000 m and up |
| Walk time | About |
|---|---|
| 5 min | 400 m |
| 10 min | 800 m |
| 15 min | 1,200 m |
If you get too few results, increase maxDistance before you remove preferences. If you get too many, tighten it or add filters.