Transitland API
transit.land · Location
Open transit data aggregator — 2,000+ transit agencies worldwide, GTFS feeds, stop locations, routes, schedules, and operators. Free, no API key for basic access.
Authentication
Sample Requests
Find transit stops within 500m of a NYC location.
Hover any highlighted part to learn what it does
curl -X GET "https://transit.land/api/v2/rest/stops?lat=40.733&lon=-73.989&radius=500"
import requests
params = {
"lat": "40.733",
"lon": "-73.989",
"radius": "500"
}
response = requests.get(
"https://transit.land/api/v2/rest/stops",
params=params,
)
print(response.json())const url = new URL('https://transit.land/api/v2/rest/stops');
url.searchParams.set('lat', '40.733');
url.searchParams.set('lon', '-73.989');
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://transit.land/api/v2/rest/stops")
q := baseURL.Query()
q.Set("lat", "40.733")
q.Set("lon", "-73.989")
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://transit.land/api/v2/rest/stops")
uri.query = URI.encode_www_form({
"lat" => "40.733",
"lon" => "-73.989",
"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://transit.land/api/v2/rest/stops?" . http_build_query([
"lat" => "40.733",
"lon" => "-73.989",
"radius" => "500"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Search for transit agencies in New York.
Hover any highlighted part to learn what it does
curl -X GET "https://transit.land/api/v2/rest/agencies?search=NYC&per_page=3"
import requests
params = {
"search": "NYC",
"per_page": "3"
}
response = requests.get(
"https://transit.land/api/v2/rest/agencies",
params=params,
)
print(response.json())const url = new URL('https://transit.land/api/v2/rest/agencies');
url.searchParams.set('search', 'NYC');
url.searchParams.set('per_page', '3');
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://transit.land/api/v2/rest/agencies")
q := baseURL.Query()
q.Set("search", "NYC")
q.Set("per_page", "3")
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://transit.land/api/v2/rest/agencies")
uri.query = URI.encode_www_form({
"search" => "NYC",
"per_page" => "3"
})
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://transit.land/api/v2/rest/agencies?" . http_build_query([
"search" => "NYC",
"per_page" => "3"
]);
$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
- No API key needed for basic use
- Nearby stops: GET /stops?lon=LON&lat=LAT&radius=500
- Routes: GET /routes?agency_key=f-dr5r7-newyorkcitytransit
- Schedules: GET /stop_times?stop_onestop_id=STOP_ID
- Register at transit.land for a free API key for higher limits
What can you build with Transitland API?
Transitland API is a Location API. Developers commonly use location APIs for:
- tracking assets and vehicles in real time
- building delivery and logistics apps
- finding nearby businesses or services
- geo-fencing and location-based notifications
- address validation and autocomplete
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. Transitland API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide