OSRM-Compatible Bike Routing API

High-performance offline routing powered by BRouter. Drop-in replacement for OSRM with bike-optimized routing, elevation awareness, and bridge/tunnel detection.

<1s
Route Response
OSRM
Compatible Format
Global
Coverage
Offline
No External APIs

Why Choose BRouter API?

OSRM-compatible routing API optimized for cycling with elevation awareness and structure detection.

🚴

Bike-Optimized Routing

BRouter's trekking profile considers bike-friendly roads, cycle paths, surface quality, and traffic.

⛰️

Elevation Aware

Routes consider elevation changes, preferring flatter paths when appropriate for cycling.

🌉

Bridge/Tunnel Detection

Returns bridge and tunnel locations along the route for better ride analysis.

🔌

OSRM Compatible

Drop-in replacement for OSRM. Same endpoint format, same response structure.

🌍

Worldwide Coverage

Full OpenStreetMap data coverage for routing anywhere in the world.

💰

No External API Costs

All routing is done locally - no per-request charges from external services.

Quick Start

GET /status

Check API health and BRouter server status. No authentication required.

curl https://bikerouter.enduranceplayground.com/status Response: { "status": "healthy", "service": "brouter-api", "version": "1.0.0", "brouter": "connected", "database": "connected" }
GET /route/v1/{profile}/{coordinates}

Calculate a route between waypoints. Returns OSRM-compatible response with geometry, distance, and duration.

curl "https://bikerouter.enduranceplayground.com/route/v1/cycling/-96.571,32.855;-96.580,32.860?api_key=YOUR_KEY&geometries=geojson&overview=full" Response: { "code": "Ok", "waypoints": [ {"name": "", "location": [-96.571, 32.855], "distance": 0}, {"name": "", "location": [-96.580, 32.860], "distance": 0} ], "routes": [{ "distance": 1523.5, "duration": 340, "geometry": { "type": "LineString", "coordinates": [[-96.571, 32.855], [-96.572, 32.856], ...] }, "structures": [ {"type": "bridge", "value": "yes", "location": [-96.575, 32.857], "surface": "concrete", "lit": "yes"} ], "legs": [...] }] }

Parameters:

ParameterValuesDescription
geometriesgeojson, polyline, polyline6Response geometry format
overviewfull, simplified, falseLevel of geometry detail
api_keystringYour API key (required)
GET /nearest/v1/{profile}/{lng},{lat}

Snap a coordinate to the nearest road. Uses PostGIS spatial queries against 137M+ roads.

curl "https://bikerouter.enduranceplayground.com/nearest/v1/cycling/-96.571,32.855?api_key=YOUR_KEY&number=3" Response: { "code": "Ok", "waypoints": [ {"name": "Main Street", "location": [-96.5712, 32.8551], "distance": 12.5}, {"name": "", "location": [-96.5708, 32.8549], "distance": 25.3}, {"name": "Oak Avenue", "location": [-96.5715, 32.8553], "distance": 38.1} ] }

Routing Profiles

OSRM Profile BRouter Profile Best For
cycling, bike, bicycle trekking General bike routing, balanced for safety and speed
driving, car car-fast Fallback for car routes
foot, walking, pedestrian hiking-mountain Fallback for walking routes

Bridge & Tunnel Detection

Routes include a structures array with bridge and tunnel locations and metadata extracted from OpenStreetMap data.

"structures": [
  {
    "type": "bridge",
    "value": "yes",
    "location": [lng, lat],
    "surface": "concrete",
    "smoothness": "excellent",
    "lit": "yes",
    "layer": "1"
  }
]

Structure Fields Reference

FieldDescriptionExample Values
typeStructure type (always present)bridge, tunnel
valueOSM tag value (always present)yes, viaduct, movable, cantilever, covered, building_passage, culvert
locationCoordinates [lng, lat] (always present)[-96.575, 32.857]
surfaceDeck/road surface materialasphalt, concrete, wood, metal, paved
smoothnessSurface quality for cyclingexcellent, good, intermediate, bad
litWhether structure is illuminatedyes, no
layerVertical layer position1, 2, -1
coveredWhether structure is coveredyes, no
maxweightWeight restriction (tons)3.5, 7.5
maxheightHeight clearance (meters)2.5, 4.0

Optional fields are only included when available in OpenStreetMap data.