Skip to content

Rail Station Information API

by wmata.com

API keyHTTPSTransportation
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
Base URL
http://api.wmata.com/Rail.svc
Version
1.0
Endpoints
16
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/Rail.svc/Lines" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript
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);
Python
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

MethodPathWhat it does
GET/LinesXML - Lines
GET/PathXML - Path Between Stations
GET/SrcStationToDstStationInfoXML - Station to Station Information
GET/StationEntrancesXML - Station Entrances
GET/StationInfoXML - Station Information
GET/StationParkingXML - Parking Information
GET/StationTimesXML - Station Timings
GET/StationsXML - Station List
GET/json/jLinesJSON - Lines
GET/json/jPathJSON - Path Between Stations
GET/json/jSrcStationToDstStationInfoJSON - Station to Station Information
GET/json/jStationEntrancesJSON - Station Entrances
GET/json/jStationInfoJSON - Station Information
GET/json/jStationParkingJSON - Parking Information
GET/json/jStationTimesJSON - Station Timings
GET/json/jStationsJSON - 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.

Compare alternatives →

Listed from APIs.guru (CC0).