InBe Docs

Mode

Use this object to change the max search distance, and the search mode

The mode object controls how InBe searches for venues based on your specified locations and their weights. It determines whether to search in a radius around a central point or along a path between multiple locations.

Basic structure

Mode object structure
  : { mode: "POINT", : 1000 },
mode: "POINT" | "PATH"

Properties

mode (required)

Search behavior type. Either "POINT" for radius-based search or "PATH" for route-following search.

maxDistance (required)

Maximum search distance in meters. Controls how far from the search centre to look for venues.

Search modes

POINT mode

Traditional radius-based search around a central location. Perfect for:

  • Single user searches
  • Group meetups (finds venues near a calculated midpoint)
  • General area exploration
POINT mode example
const :  = {
  : [{ : 51.5072, : -0.1276 }],
  : { : "POINT", : 750 }, 
};

This searches for venues within 750m of the specified location.

PATH mode

Route-following search that finds venues along a path between multiple locations. Ideal for:

  • Travel planning
  • Journey-based discovery
  • Finding stops along a route
PATH mode example
const :  = {
  : [
    { : 51.5072, : -0.1276 },
    { : 51.5154, : -0.1419 },
    { : 51.5034, : -0.1195 },
  ],
  : { : "PATH", : 50 }, 
};

This finds venues within a 50m width of the route between the three points. Do not include weights in the locations array when using the PATH mode as they have no effect.

Distance considerations

POINT mode distances

  • Small (100-500m): Very local search, great for immediate needs
  • Medium (500m-2km): Neighborhood search - Caution for cities with limited travel options
  • Large (2km-5km): City area search, suitable for special occasions
  • Very large (5km+): Regional search - use sparingly

PATH mode distances

  • Small (10-50m): Venues very close to the route
  • Medium (50m-500m): Venues within walking distance of the route
  • Large (500m-1km): Venues that will require a detour
  • Very large (1km+): Venues that may require a long detour - use sparingly

Real-world examples

Coffee shop meetup (POINT mode)

Local coffee shop search
  : [
    { : 51.5072, : -0.1276 },
    { : 51.5154, : -0.1419 },
  ],
  : { : "POINT", : 500 },
  : { : ["cafe"] },
};

Road trip planning (PATH mode)

Highway rest stops
  : [
    { : 51.50551909513109, : -0.07535649999999514 }, //Tower Bridge
    { : 51.50598923951866, : -0.08904263858593335 }, //Borough Market
  ],
  : {
    : "PATH", 
    : 100, 
  },
  : {
    : ["family", "lunch"],
  },
};

Urban exploration (POINT mode)

City centre exploration
  : [
    { : 51.50551909513109, : -0.07535649999999514, : 90 }, //Tower Bridge
    { : 51.47388445543705, : -0.05767436098651599, : 10 }, //User's location
  ],
  : {
    : "POINT", 
    : 1000, 
  },
  : {
    : ["Indian", "Italian"],
    : ["vegetarian", "glutenFree"],
    : {
      : "OPEN",
      : "13:00",
    },
  },
};

This is an example of a user searching for a restaurant between their current location and an attraction they are visiting, perfering the attraction.

Default values

You are required to specify a mode object in your search request. If you don't specify a mode object, a 400 error will be returned.

Default mode behavior
  : { : "POINT", : 500 },
 

Best practice

  • Start with smaller distances and increase if you need more results
  • Consider user travel preferences - in cities users prefer walking distance up to 1km
  • Use PATH mode sparingly - for most, it will not provide desired results
  • Balance distance with result quality - smaller distances return more relevant venues
  • Tailor distances based on context - how are your users travelling, walking, public transport, car, etc

Distance conversion guide

DistanceWalking timeUse caseTravel method
100m1-2 minutesImmediate needs, very localWalking
500m5-7 minutesQuick meetups, coffee runsWalking
1km10-15 minutesCasual meetups, lunchWalking, Public transport
2km20-30 minutesPlanned meetups, dinnerPublic transport, Car
5km45-60 minutesSpecial occasions, eventsPublic transport, Car

Next steps