Transit Reliability API

You can use this API to query by date and return the number of runs that were observed on the system vs the number scheduled and calculated percentage of those completed runs.
Additionally, you can obtain a copy of the raw data being used by my PowerBi reports for your own analysis.

Authentication is required to use this API: Contact me via Twitter/LinkedIn or E-Mail to request an API key.

Base URL: https://brandonmcfadden.com/

Rate Limit: All API Endpoints have a 2 requests per second limit - please keep this in mind and be gentle :)

Daily Results

Returns back combined value calculations for each of the available lines comparing scheduled service values to actual service values.

Endpoint: /api/transit/get_daily_results/

Query Parameters:
Required:
• Agency - CTA, Metra, WMATA
Optional:
• Date - Today, Yesterday, or yyyy-mm-dd (2024-01-15)
• Availability - True/False (used to display what days have data available)
Example: https://brandonmcfadden.com/api/transit/get_daily_results/?agency=cta&date=yesterday
Example: https://brandonmcfadden.com/api/transit/get_daily_results/?agency=wmata&availability=True

Train Arrivals (by day)

Returns back the raw arrival data as a csv file. This file contains all of the arrivals being used in the PowerBi Reports.
Arrival data for the previous day is loaded at ~01:00 CST.

Endpoint: /api/transit/get_train_arrivals_by_day/

Query Parameters:
Required:
• Agency - CTA, Metra (WMATA not supported at this time)
Optional:
• Date - Yesterday, or yyyy-mm-dd (2024-01-15)
• Availability - True/False (used to display what days have data available)
Example: https://brandonmcfadden.com/api/transit/get_train_arrivals_by_day/?agency=cta&date=2023-12-12
Example: https://brandonmcfadden.com/api/transit/get_train_arrivals_by_day/?agency=cta&availability=True

Train Arrivals (by month)

Returns back the raw arrival data as a csv file. This file contains all of the arrivals being used in the PowerBi Reports.
Arrival data for the previous month is loaded at ~01:00 CST on the first day of the following month.

Endpoint: /api/transit/get_train_arrivals_by_month/
Example: https://brandonmcfadden.com/api/get_train_arrivals_by_month/?agency=cta&date=2023-12

Query Parameters:
Required:
• Agency - CTA, Metra (WMATA not supported at this time)
Optional:
• Date - yyyy-mm (2024-01)
• Availability - True/False (used to display what days have data available)

Note: All Endpoints also allow the options /today and /yesterday in lieu of the date (with the exception of 'get_train_arrivals_by_day', which does not include data for the current day)

Data Availability:

CTA: June 20, 2022 through Current Day
Metra: January 18, 2023 through Current Day
WMATA: December 01, 2023 through Current Day

Example cURL Request

    
    curl --location --request GET 
        'https://brandonmcfadden.com/api/transit/get_daily_results/?agency=cta&date=2024-01-15'
        --header 'Authorization: Basic {base64 encoded username:password}'

    Example:
    curl --location --request GET 
        'https://brandonmcfadden.com/api/transit/get_daily_results/?agency=cta&date=2024-01-15'
        --header 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ='