oslew docs
Console
Menu

OperatoroperatoroperationId post_transit_rt

POST/v1/transit_rt

Apply a GTFS-Realtime FeedMessage (protobuf body): trip updates become delays and skipped calls that departures apply on top of the schedule, for the feed whose trips it names.

Send Authorization: Bearer sk_live_…. The key's plan must include theoperator product; which plans do.

Explained in Operator feeds.

Example

One trip five minutes late.

curl
curl -X POST "https://api.oslew.com/v1/transit_rt" \
  -H "Authorization: Bearer $GEO_API_KEY" \
  -H "Content-Type: application/x-protobuf" \
  --data-binary @tripupdates.pb
Python
from oslew import Client

# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")

answer = client.post_transit_rt(open("tripupdates.pb", "rb").read())
TypeScript
import { readFile } from "node:fs/promises";
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.post_transit_rt(new Uint8Array(await readFile("tripupdates.pb")));
Response
HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 10
ratelimit-remaining: 16
ratelimit-reset: 1

{
  "applied": true,
  "feed": "bart",
  "feed_time": 1787756100,
  "trip_updates": 1,
  "matched_trips": 1,
  "unknown_trips": 0,
  "stop_updates": 1,
  "unknown_stops": 0,
  "skipped": 0,
  "applied_at": 1790259566,
  "took_us": 123
}

A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.

Body

application/x-protobuf, required.

binary

Responses

200 — What the feed did.

  • appliedbooleanrequired
  • applied_atinteger | nullrequired
  • feedstringrequired
  • feed_timeinteger | nullrequired
  • matched_tripsintegerrequired
  • skippedintegerrequired
  • stop_updatesintegerrequired
  • took_usintegerrequired
  • trip_updatesintegerrequired
  • unknown_stopsintegerrequired
  • unknown_tripsintegerrequired

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.

400Not a FeedMessage, or no loaded feed knows its trips.
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.