A POI API for places along a route

Send the route, get back every stop near it in route order: where to fill a bottle, buy food, find a toilet or a bike shop, each with how far along the route it is and how far off it. The answer also marks the stretches of more than 40 km with no water or food, so an app can warn before the rider gets there.

The request

POST /v1/route-poi/corridor takes the route as points with their distance from the start in metres, the way a track recorder or a route planner already has them, and the categories you want.

{
  "sections": [[
    { "lat": 46.204, "lon": 6.143, "d": 0 },
    ...
    { "lat": 45.924, "lon": 6.869, "d": 64484 }
  ]],
  "categories": ["water", "food", "bike"]
}
Route
Up to 1,000 km and 1,000 points per request, in up to 64 sections
Categories
water, food, grocery, toilets, bike, fuel, and on request sleep, sights, charging, bench, picnic
Distance from the route
By default per category: 150 m for water and toilets, 200 m for food, shops, bike shops and fuel, up to 1 km for places to sleep and sights. maxDistanceM sets one distance for all categories and distancesM one per category, up to 5 km. A route searched 2 km wide may be up to 1,000 km long, 5 km wide up to 400 km.

The answer

{
  "routeLengthKm": 64.484,
  "totals": { "water": 40, "food": 117, "bike": 4, "grocery": 0, "fuel": 0, "toilets": 0 },
  "pois": [
    { "id": "node/1379366890", "category": "water", "subtype": "drinking_water", "name": null,
      "lat": 46.2047788, "lon": 6.1417476, "flags": { "hasWater": true },
      "tags": { "amenity": "fountain", "drinking_water": "yes" },
      "distanceAlongRouteKm": 0, "offsetFromRouteM": 130 },
    ...
  ],
  "gaps": []
}

Each stop keeps its OpenStreetMap tags, so opening hours, brand and payment details are there when mappers added them. Chain shops and fuel stations can be shown with their brand logos, served from the same API. A ride from Geneva to Chamonix, 64 km, came back with 161 stops.

For a short query, or your own tags

The Overpass endpoint takes around with a line, for any tag you need, and the examples show a union of toilets and drinking water along a ride.

Who uses it

Apps for long rides, bikepacking races, ultra runs and road trips, where the next water or the last shop before a night stage matters more than a map full of pins. The same key gives the weather along the route, its elevation profile and routing.

Credits: map data © OpenStreetMap contributors, available under the Open Database License.

The free plan gives 500 requests a day, for commercial apps too. Create an account with Google or your email and make your keys right away.