Open documentation ↗Overview
Rail line and station information, including locations, fares, times, and parking.
Rail Station Information is a transportation API from wmata.com. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 16 endpoints.
At a glance
- Authentication
- API key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Transportation
- Base URL
http://api.wmata.com/Rail.svc- Version
- 1.0
- Endpoints
- 16
- 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/Rail.svc/Lines" \
-H "Accept: application/json" \
-H "X-API-Key: YOUR_API_KEY"const response = await fetch("http://api.wmata.com/Rail.svc/Lines", {
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/Rail.svc/Lines",
headers={
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /Lines | XML - Lines |
| GET | /Path | XML - Path Between Stations |
| GET | /SrcStationToDstStationInfo | XML - Station to Station Information |
| GET | /StationEntrances | XML - Station Entrances |
| GET | /StationInfo | XML - Station Information |
| GET | /StationParking | XML - Parking Information |
| GET | /StationTimes | XML - Station Timings |
| GET | /Stations | XML - Station List |
| GET | /json/jLines | JSON - Lines |
| GET | /json/jPath | JSON - Path Between Stations |
| GET | /json/jSrcStationToDstStationInfo | JSON - Station to Station Information |
| GET | /json/jStationEntrances | JSON - Station Entrances |
| GET | /json/jStationInfo | JSON - Station Information |
| GET | /json/jStationParking | JSON - Parking Information |
| GET | /json/jStationTimes | JSON - Station Timings |
| GET | /json/jStations | JSON - Station List |
Questions
Does the Rail Station Information API need an API key?
Yes. The Rail Station Information API uses API key authentication; the documentation explains how to get credentials.
Does the Rail Station Information API support HTTPS?
Yes, the Rail Station Information API is served over HTTPS.
How many endpoints does the Rail Station Information API have?
Its OpenAPI description lists 16 endpoints in version 1.0. All of them are shown on this page.
What are alternatives to the Rail Station Information 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).