Transport for United States API
Overview
Transport for United States (NextBus API) provides real-time public transit predictions for buses and light rail in various US cities. You can get live arrival predictions, route lists, stop locations, and vehicle positions for agencies like San Francisco Muni. No authentication is required — just specify the agency and route in your XML-based request.
Beginner Tip
Start with the agencyList command to see all supported agencies, then use routeList to get routes for a specific agency. The predictions command gives you live arrival times for a specific stop.
Available Data
The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.
Example Response
Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.
{
"route": "Line 1",
"origin": "Station A",
"destination": "Station B",
"departure": "08:30",
"arrival": "09:15",
"status": "On Time",
"delays_min": 0
} Field Reference
body.predictions.direction Directional group containing a list of arrival predictions. body.predictions.direction.prediction Array of individual arrival predictions for the stop. prediction.seconds Seconds until the vehicle arrives at the stop. prediction.minutes Minutes until the vehicle arrives, rounded down. prediction.vehicle Vehicle ID of the incoming transit vehicle. body.predictions.routeTitle Human-readable name of the transit route. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://retro.umoiq.com/xmlFeedDocs/";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Metadata Score Breakdown
Estimated from metadata — endpoint not independently tested
Metadata estimate · endpoint not independently tested
Technical Specifications
Related Tags
Similar APIs
View All →ADS-B Exchange
⭐ Beginner's PickADS-B Exchange is a community-driven API that provides real-time and historical position data for aircraft around the world.
airportsapi
⭐ Beginner's PickThe airportsapi lets you look up airport names and official website URLs by providing an ICAO code.
BC Ferries
⭐ Beginner's PickThe BC Ferries API is a free, open API providing real-time sailing schedules, capacity, and current conditions for BC Ferries routes in British Columbia, Canada.
Community Transit
⭐ Beginner's PickCommunity Transit (Transitland) is a free, open API that aggregates public transit data from hundreds of agencies worldwide including routes, stops, and schedules.
Transport for Sweden
Transport for Sweden (Trafiklab) is a developer platform providing access to public transport data across all of Sweden.