Find an API

Search public APIs with auth details & Postman guides

← All APIs

Rail Station Information

wmata · Company

Company No Auth Free & Open transport

Rail line and station information, including locations, fares, times, and parking.

Authentication

No authentication requiredFree to use with no key needed.

Sample Requests

GET XML - Path Between Stations

Description Returns a set of ordered stations and distances between two stations on the same line . Note that this method is not suitable on its own as a pathfinding solution between stations. Response Elements</

https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path?ToStationCode=G05&FromStationCode=N06

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path?ToStationCode=G05&FromStationCode=N06"
import requests
params = {
    "ToStationCode": "G05",
    "FromStationCode": "N06"
}
response = requests.get(
    "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path",
    params=params,
)
print(response.json())
const url = new URL('https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path');
url.searchParams.set('ToStationCode', 'G05');
url.searchParams.set('FromStationCode', 'N06');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path")
	q := baseURL.Query()
	q.Set("ToStationCode", "G05")
	q.Set("FromStationCode", "N06")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path")
uri.query = URI.encode_www_form({
  "ToStationCode" => "G05",
  "FromStationCode" => "N06"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/Path?" . http_build_query([
    "ToStationCode" => "G05",
    "FromStationCode" => "N06"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET XML - Station to Station Information

Description Returns a distance, fare information, and estimated travel time between any two stations, including those on different lines. Omit both parameters to retrieve data for all stations. Response Elements <table class="tabl

https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo?ToStationCode=J03&FromStationCode=E10

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo?ToStationCode=J03&FromStationCode=E10"
import requests
params = {
    "ToStationCode": "J03",
    "FromStationCode": "E10"
}
response = requests.get(
    "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo",
    params=params,
)
print(response.json())
const url = new URL('https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo');
url.searchParams.set('ToStationCode', 'J03');
url.searchParams.set('FromStationCode', 'E10');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo")
	q := baseURL.Query()
	q.Set("ToStationCode", "J03")
	q.Set("FromStationCode", "E10")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo")
uri.query = URI.encode_www_form({
  "ToStationCode" => "J03",
  "FromStationCode" => "E10"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/SrcStationToDstStationInfo?" . http_build_query([
    "ToStationCode" => "J03",
    "FromStationCode" => "E10"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));
GET XML - Station Entrances

Description Returns a list of nearby station entrances based on latitude, longitude, and radius (meters). Omit search parameters to return all station entrances. Response Elements <table class="table table-condensed table-h

https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances?Lat=38.8978168&Lon=-77.0404246&Radius=500

Hover any highlighted part to learn what it does

curl -X GET "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances?Lat=38.8978168&Lon=-77.0404246&Radius=500"
import requests
params = {
    "Lat": "38.8978168",
    "Lon": "-77.0404246",
    "Radius": "500"
}
response = requests.get(
    "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances",
    params=params,
)
print(response.json())
const url = new URL('https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances');
url.searchParams.set('Lat', '38.8978168');
url.searchParams.set('Lon', '-77.0404246');
url.searchParams.set('Radius', '500');

const response = await fetch(url); 
const data = await response.json();
console.log(data);
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances")
	q := baseURL.Query()
	q.Set("Lat", "38.8978168")
	q.Set("Lon", "-77.0404246")
	q.Set("Radius", "500")
	baseURL.RawQuery = q.Encode()
	targetURL := baseURL.String()
	req, _ := http.NewRequest("GET", targetURL, nil)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
require "net/http"
require "json"

uri = URI("https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances")
uri.query = URI.encode_www_form({
  "Lat" => "38.8978168",
  "Lon" => "-77.0404246",
  "Radius" => "500"
})

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"

req = Net::HTTP::Get.new(uri)

res = http.request(req)
puts JSON.parse(res.body)
<?php
$url = "https://api.apis.guru/v2/specs/wmata.com/rail-station/1.0/StationEntrances?" . http_build_query([
    "Lat" => "38.8978168",
    "Lon" => "-77.0404246",
    "Radius" => "500"
]);
$opts = ["http" => [
    "method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));

Postman Setup Guide

Get Postman ↗
  1. See official documentation for authentication and setup.

What can you build with Rail Station Information?

Rail Station Information is a Company API. Developers commonly use company APIs for:

  • enriching CRM records with company firmographics
  • building lead-generation and prospecting tools
  • verifying business identity and registration details
  • monitoring competitors and market intelligence
  • powering B2B data enrichment pipelines

No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. Rail Station Information is free to use, making it a low-risk choice to experiment with.

New to APIs? Read our beginner's guide

Open documentation ↗