Transport for Sao Paulo, Brazil API
Overview
The SPTrans Olho Vivo API provides real-time bus tracking data for São Paulo's massive municipal bus system in Brazil, one of the largest in the world. Authentication uses OAuth and requires registering on the SPTrans developer portal to receive credentials. Once authenticated, you can track bus positions, find arrivals at stops, and query route information.
Beginner Tip
Start by calling the authentication endpoint with your credentials to obtain a session token, then use that token in a cookie for all subsequent requests. The API documentation (in Portuguese) is available at sptrans.com.br and explains all available endpoints with parameter details.
Available Data
Example Response
{
"route": "Line 1",
"origin": "Station A",
"destination": "Station B",
"departure": "08:30",
"arrival": "09:15",
"status": "On Time",
"delays_min": 0
} Field Reference
hr Timestamp of the data snapshot in HH:MM format, indicating when the position data was last captured. l List of active bus lines, each containing the line code, destination, and list of vehicle positions. c Line code identifier for the bus route, such as 8000-10. lt0 Primary destination sign text for the bus line, indicating the main terminus. vs Array of vehicles (buses) currently active on the line, each with GPS coordinates and prefix ID. py Latitude coordinate of the bus vehicle in decimal degrees, used to plot it on a map. Implementation Example
const url = "http://www.sptrans.com.br/desenvolvedores/api-do-olho-vivo-guia-de-referencia/documentacao-api/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"Authorization": "Bearer YOUR_API_KEY"
}
});
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
Matrix Score Breakdown
Partially tested on Apr 5, 2026
Technical Specifications
Related Tags
Similar APIs
View All →Amadeus for Developers
Amadeus for Developers is an OAuth2-protected travel API offering flight search, hotel availability, airport information, and more from one of the largest global distribution systems.
apilayer aviationstack
Aviationstack by apilayer provides real-time flight status, schedules, and global aviation data including airports and airlines.
BIC-Boxtech
BIC-Boxtech provides technical specifications for shipping containers in the global fleet, including dimensions, tare weight, and capacity details.
Grab
The Grab API allows developers to integrate Grab services — including ride-hailing, food delivery, and payments — into their own applications across Southeast Asia.
Transport for Sweden
Transport for Sweden (Trafiklab) is a developer platform providing access to public transport data across all of Sweden.