TransitroutingoperationId journeys
GET/v1/journeys
Transit directions (RAPTOR): the fastest journey for each number of transfers, with walking to, between and from the stops, live delays applied when a realtime feed is.
Send Authorization: Bearer sk_live_…. The key's plan must include therouting product; which plans do.
Explained in Journey planning.
Example
Embarcadero to downtown Oakland.
curl -G "https://api.oslew.com/v1/journeys" \
-H "Authorization: Bearer $GEO_API_KEY" \
--data-urlencode 'from=37.7928,-122.3971' \
--data-urlencode 'to=37.8035,-122.2716' \
--data-urlencode 'time=1787756400' \
--data-urlencode 'limit=2'from oslew import Client
# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")
answer = client.journeys(
"37.7928,-122.3971",
"37.8035,-122.2716",
time=1787756400,
limit=2,
)import { Client } from "@oslew/client";
// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.journeys("37.7928,-122.3971", "37.8035,-122.2716", { time: 1787756400, limit: 2 });HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 291
ratelimit-reset: 1
{
"from": [
37.7928,
-122.3971
],
"to": [
37.8035,
-122.2716
],
"time": 1787756400,
"timezone": "America/Los_Angeles",
"live": null,
"journeys": [
{
"depart": 1787756445,
"arrive": 1787757604,
"duration_s": 1159,
"transfers": 0,
"walk_m": 568.7634161971366,
"legs": [
{
"mode": "walk",
"from": [
37.7928,
-122.3971
],
"to": [
37.789143,
-122.401558
],
"distance_m": 564.6342163085938,
"duration_s": 435
},
{
"mode": "ride",
"route": 7,
"route_short_name": "Red-N",
"headsign": "SFO / SF / Richmond",
"trip_id": "1965673",
"from_stop": 61,
"to_stop": 40,
"board": 1787756880,
"alight": 1787757600,
"stops": 3
},
{
"mode": "walk",
"from": [
37.803463,
-122.271596
],
"to": [
37.8035,
-122.2716
],
"distance_m": 4.129199888542818,
"duration_s": 4
}
]
}
],
"provenance": {
"name": "bart",
"release": "2026-08-19.0",
"license": "BART developer terms"
},
"took_us": 579
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.
Query
| Name | Type | Description |
|---|---|---|
fromqueryrequired | string | lat,lon. |
toqueryrequired | string | lat,lon. |
timequery | integer | Leave at or after, unix seconds; now when absent. |
max_transfersquery | integer ≤ 6 default 3 | |
walk_mquery | number ≤ 2000 default 800 | |
limitquery | integer ≤ 10 default 5 |
Responses
200 — The journeys; empty when none leaves in the feed's service day.
fromnumber[]requiredjourneysobject[]requiredarriveintegerrequireddepartintegerrequiredduration_sintegerrequiredlegs(WalkLeg | RideLeg[])requiredIn order: a walk to the first stop, rides with any walks between them, and a walk to the destination.- One of 1
distance_mnumberrequiredduration_sintegerrequiredAt the walking speed, 1.3 m/s.fromnumber[]required2 items(lat, lon).modestringrequiredwalktonumber[]required2 items(lat, lon).
- One of 2
alightintegerrequiredArrival atto_stop, unix seconds; live when delays apply.boardintegerrequiredDeparture fromfrom_stop, unix seconds; live when delays apply.from_stopintegerrequiredIndex of the stop boarded at, in the feed's stops.headsignstringrequiredmodestringrequiredriderouteintegerrequiredIndex into the feed's routes.route_short_namestringrequiredstopsintegerrequiredStops travelled.to_stopintegerrequiredIndex of the stop alighted at.trip_idstringrequired
- One of 1
transfersintegerrequiredwalk_mnumberrequired
liveinteger | nullrequiredprovenanceSourcerequiredlicensestringrequirednamestringrequiredreleasestringrequired
timeintegerrequiredtimezonestringrequiredtonumber[]requiredtook_usintegerrequired
With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.
Refusals
Every refusal is a JSON object with an error string, except where noted.
| 400 | Bad request, or no feed covers both ends. |
| 401 | No key, or one that is unknown, revoked or suspended. |
| 403 | The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does. |
| 429 | This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After. |
| 503 | The pod cannot reach the control plane and its entitlements are too old to trust. Retry. |
A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.
Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.