Open documentation ↗Overview
Real-time rail prediction methods.
Real-Time Rail Predictions is a transportation API from wmata.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 2 endpoints.
At a glance
- Authentication
- API key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Transportation
- Base URL
http://api.wmata.com/StationPrediction.svc- Version
- 1.0
- Endpoints
- 2
- OpenAPI
- Specification ↗
- Spec updated
- 2021-06-21
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "http://api.wmata.com/StationPrediction.svc/GetPrediction/STATIONCODES" \
-H "Accept: application/json" \
-H "X-API-Key: YOUR_API_KEY"const response = await fetch("http://api.wmata.com/StationPrediction.svc/GetPrediction/STATIONCODES", {
method: "GET",
headers: {
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"http://api.wmata.com/StationPrediction.svc/GetPrediction/STATIONCODES",
headers={
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /GetPrediction/{StationCodes} | XML - Next Trains |
| GET | /json/GetPrediction/{StationCodes} | JSON - Next Trains |
Questions
Does the Real-Time Rail Predictions API need an API key?
Yes. The Real-Time Rail Predictions API uses API key authentication; the documentation explains how to get credentials.
Does the Real-Time Rail Predictions API support HTTPS?
Yes, the Real-Time Rail Predictions API is served over HTTPS.
How many endpoints does the Real-Time Rail Predictions API have?
Its OpenAPI description lists 2 endpoints in version 1.0. All of them are shown on this page.
What are alternatives to the Real-Time Rail Predictions API?
Other Transportation APIs include airportsapi, Transport for London, England, Uber, Transport for Spain, Amadeus for Developers.
Similar transportation APIs
Compare alternatives →airportsapi
TransportationGet name and website-URL for airports by ICAO code
Transport for London, England
TransportationDiscover TFL APIs
Uber
TransportationUber ride requests and price estimation
Transport for Spain
TransportationPublic trains of Spain
Amadeus for Developers
TransportationTravel Search - Limited usage
Boston MBTA Transit
TransportationStations and predicted arrivals for MBTA
Listed from APIs.guru (CC0).