Transport for Chicago, US API

Transportation / API Key Intermediate HTTP
Varies by plan (check documentation)

Overview

The Chicago Transit Authority (CTA) API provides real-time train tracking and bus arrival predictions for Chicago's public transit network. An API key is required and can be requested for free from the CTA developer site. It is a solid choice for building transit apps focused on the Chicago metro area.

💡

Beginner Tip

Request a free API key from the CTA developer portal and include it as the key parameter in every request. Start with the Train Tracker API using a known station stop ID such as 40380 (Chicago/Red Line).

Available Data

book title and author
ISBN and publisher
cover image URL
page count
publication date
match scores and results

Example Response

JSON Response
{
  "route": "Line 1",
  "origin": "Station A",
  "destination": "Station B",
  "departure": "08:30",
  "arrival": "09:15",
  "status": "On Time",
  "delays_min": 0
}

Field Reference

ctatt.tmst Timestamp of when the API response was generated
ctatt.errCd Error code; "0" means success
ctatt.eta Array of upcoming train arrival predictions
eta.staNm Name of the station for this arrival prediction
eta.arrT Predicted arrival time in YYYYMMDD HH:mm:ss format
eta.isDly Flag indicating if the train is delayed ("1" = delayed)

Implementation Example

const url = "http://www.transitchicago.com/developers/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "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

Invalid key error in response API key is missing, expired, or not yet approved
Apply for a key at transitchicago.com/developers and wait for approval email before using it
No arrivals returned The station or stop ID is incorrect
Use the CTA GTFS data to look up valid map IDs (station IDs) or stop IDs for the route you want
XML response instead of JSON Missing outputType=JSON parameter
Always append outputType=JSON to your query string since XML is the default output format

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 15/20
🔒 Security 0/15
🛠 Developer XP 12/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS NO
CORS UNKNOWN
Category Transportation
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →