Bike Route Safety API
One POST, one number. Send a GPX file or a list of coordinates, get back a 0–100 safety confidence score describing the cycling infrastructure along that route — no map, no UI, no user account.
Brakeaway's scoring API exposes the same engine that powers the public route analyzer and the Strava integration. If your product has a bike route in it — a planner, a fleet tool, a real-estate or urban-analytics dashboard, a delivery router — this turns that route into a number you can sort, filter, threshold, or display, grounded in real OpenStreetMap cycling infrastructure rather than a guess.
Request an API keyEndpoint
Authorization: Bearer <your API key>
Sending a route
Two accepted body formats. Raw GPX, with any content type:
curl -X POST https://brakeaway.bike/api/v1/score \
-H "Authorization: Bearer bk_live_..." \
--data-binary @route.gpx
Or JSON coordinates as [lat, lon] pairs, with an optional matching
elevations array in meters:
curl -X POST https://brakeaway.bike/api/v1/score \
-H "Authorization: Bearer bk_live_..." \
-H "Content-Type: application/json" \
-d '{"coordinates": [[41.878, -87.63], [41.882, -87.63]]}'
Routes may carry 2 to 50,000 points and span 0.02 to 300 miles.
What comes back
{
"score": 46,
"band": "Caution",
"distance_miles": 21.42,
"segments_analyzed": 21,
"protected_pct": 0,
"painted_pct": 10,
"busy_road_pct": 67,
"partial": false,
"disclosure": "Informational only — not a substitute for local judgment. Verify conditions before you ride.",
"terms": "https://brakeaway.bike/liability#8-api-and-third-party-integrations"
}
| Field | Meaning |
|---|---|
score | 0–100, higher is better. The average of per-mile segment scores, minus a busy-road penalty. |
band | The human-readable label for the score. See the band table below. |
distance_miles | Total route distance as measured from the submitted geometry. |
segments_analyzed | How many per-mile segments contributed to the score. |
protected_pct | Share of the route on physically separated paths. |
painted_pct | Share on painted bike lanes with no physical separation. |
busy_road_pct | Share on roads classified as busy, with no cycling provision. |
partial | If true, OpenStreetMap was unreachable and the score fell back to defaults. Treat the score as unusable and retry later. |
disclosure | Required display string — see below. Always present. |
terms | Link to the governing terms for API use. Always present. |
usage | Optional. {used, limit} for this key in the current UTC calendar month. Omitted entirely when metering is unavailable — usage metering fails open so a counter outage never blocks scoring. Guard your access: body.usage?.used. |
Score bands
| Score | Band |
|---|---|
| 90–100 | Very High Confidence |
| 75–89 | High Confidence |
| 60–74 | Moderate |
| 45–59 | Caution |
| 30–44 | Risky |
| 15–29 | Unsafe |
| 0–14 | Extremely Dangerous |
Treat band as a closed set of exactly these seven strings. Parse defensively:
new bands are not added without notice to existing partners, but an unrecognized value should
degrade to displaying the numeric score rather than failing.
Display requirement. The disclosure string ships inside every
response and must be shown at or near wherever you display the score, per
Liability Disclosure §8.4.
Scores are informational estimates about infrastructure. They are not recommendations, and
they do not assert that any route is safe to ride.
Checking usage without spending a call
Authorization: Bearer <your API key>
Returns {"used": 412, "limit": 1000, "month": "2026-09"} for your own key, and
does not increment the counter.
Errors
| Status | Meaning |
|---|---|
401 | Missing or invalid Authorization: Bearer key. |
400 | Unreadable or unrecognized body. |
422 | Route invalid — too few points, out-of-range coordinates, too long or too short. |
429 | Monthly call limit reached for this key. Resets the 1st, UTC. |
502 | Scoring failed server-side. Retry. |
Latency
Latency scales with route length, because scoring issues roughly one OpenStreetMap query per 40 route miles. A 20-mile route typically returns in a few seconds; a century-length route can take a minute or more. If you are scoring very long routes or batch-processing a catalog, say so when you request a key — asynchronous scoring is on the roadmap and gets prioritized by real demand.
How scoring works
Every segment of the submitted route is matched against OpenStreetMap cycling infrastructure: physically protected paths, painted lanes, road classification, and surface quality. Segments are scored per mile and averaged, then a penalty is applied for distance spent on busy roads with no cycling provision. The engine is shared — the API, the website, and the Strava integration all import the same module, so a route scored through the API returns the same number the website shows.
For the full methodology, see What is a bike route safety score?
Getting a key
Keys are issued per organization. Evaluation keys include 1,000 calls per calendar month at no cost — enough to prototype and benchmark the scores against routes you already know. Higher volumes are quoted per partner.
Email with your use case and rough monthly volume, and mention whether your routes run long (50+ miles) or arrive in batches:
Request an API keySee the scores first
Every city page runs the same engine the API does — a fast way to sanity-check the output against streets you know before you write any code.
API version v1 · Last updated September 24, 2026