Skip to content

Incidents API

by wmata.com

API keyHTTPSTransportation
Open documentation ↗

Overview

Rail, bus, and elevator disruptions/outages.

Incidents is a transportation API from wmata.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 6 endpoints.

At a glance

Authentication
API key
HTTPS
Yes
CORS
Unknown
Base URL
http://api.wmata.com/Incidents.svc
Version
1.0
Endpoints
6
Spec updated
2021-06-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "http://api.wmata.com/Incidents.svc/BusIncidents" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
const response = await fetch("http://api.wmata.com/Incidents.svc/BusIncidents", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "http://api.wmata.com/Incidents.svc/BusIncidents",
    headers={
    "Accept": "application/json",
    "X-API-Key": "YOUR_API_KEY",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/BusIncidentsXML - Bus Incidents
GET/ElevatorIncidentsXML - Elevator/Escalator Outages
GET/IncidentsXML - Rail Incidents
GET/json/BusIncidentsJSON - Bus Incidents
GET/json/ElevatorIncidentsJSON - Elevator/Escalator Outages
GET/json/IncidentsJSON - Rail Incidents

Questions

Does the Incidents API need an API key?

Yes. The Incidents API uses API key authentication; the documentation explains how to get credentials.

Does the Incidents API support HTTPS?

Yes, the Incidents API is served over HTTPS.

How many endpoints does the Incidents API have?

Its OpenAPI description lists 6 endpoints in version 1.0. All of them are shown on this page.

What are alternatives to the Incidents API?

Other Transportation APIs include airportsapi, Transport for London, England, Uber, Transport for Spain, Amadeus for Developers.

Compare alternatives →

Listed from APIs.guru (CC0).