oslew docs
Console
Menu

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
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'
Python
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,
)
TypeScript
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 });
Response
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

NameTypeDescription
from
queryrequired
string
lat,lon.
to
queryrequired
string
lat,lon.
time
query
integer
Leave at or after, unix seconds; now when absent.
max_transfers
query
integer
≤ 6
default 3
walk_m
query
number
≤ 2000
default 800
limit
query
integer
≤ 10
default 5

Responses

200 — The journeys; empty when none leaves in the feed's service day.

  • fromnumber[]required
  • journeysobject[]required
    • arriveintegerrequired
    • departintegerrequired
    • duration_sintegerrequired
    • legs(WalkLeg | RideLeg[])required
      In order: a walk to the first stop, rides with any walks between them, and a walk to the destination.
      • One of 1
        • distance_mnumberrequired
        • duration_sintegerrequired
          At the walking speed, 1.3 m/s.
        • fromnumber[]required2 items
          (lat, lon).
        • modestringrequired
          walk
        • tonumber[]required2 items
          (lat, lon).
      • One of 2
        • alightintegerrequired
          Arrival at to_stop, unix seconds; live when delays apply.
        • boardintegerrequired
          Departure from from_stop, unix seconds; live when delays apply.
        • from_stopintegerrequired
          Index of the stop boarded at, in the feed's stops.
        • headsignstringrequired
        • modestringrequired
          ride
        • routeintegerrequired
          Index into the feed's routes.
        • route_short_namestringrequired
        • stopsintegerrequired
          Stops travelled.
        • to_stopintegerrequired
          Index of the stop alighted at.
        • trip_idstringrequired
    • transfersintegerrequired
    • walk_mnumberrequired
  • liveinteger | nullrequired
  • provenanceSourcerequired
    • licensestringrequired
    • namestringrequired
    • releasestringrequired
  • timeintegerrequired
  • timezonestringrequired
  • tonumber[]required
  • took_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.

400Bad request, or no feed covers both ends.
401No key, or one that is unknown, revoked or suspended.
403The 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.
429This 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.
503The 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.