Transit
Trip planning via MOTIS plus live GTFS-RT data — vehicle positions, departures, stops, route detail, and station geometry.
Get transit route between two points
Queries the MOTIS transit router for itineraries between two coordinates. Returns transit legs with boarding/alighting stops, route info, and geometry. Walking legs are straight-line estimates — the Parchment server replaces them with actual GraphHopper walking routes.
Request Body
application/jsonRequiredfromRequiredobjecttoRequiredobjecttimestringarriveBybooleannumItinerariesnumber1Maximum: 10searchWindownumber1transitModesarray<string>maxWalkDistancenumber0maxTransfersnumber0wheelchairbooleanResponse Body
curl -X POST "https://example.com/transit/route" \
-H "Content-Type: application/json" \
-d '{
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true
}'const body = JSON.stringify({
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true
})
fetch("https://example.com/transit/route", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/transit/route"
body := strings.NewReader(`{
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/route"
body = {
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Intermodal routing with mode selection
Coordinate-based intermodal routing via MOTIS. Supports pre/post-transit mode selection (WALK, BIKE, CAR_PARKING, RENTAL) and direct non-transit modes. Requires MOTIS to have OSM street data loaded. Returns legs with real OSM geometry for walk/bike/car segments.
Request Body
application/jsonRequiredfromRequiredobjecttoRequiredobjecttimestringarriveBybooleannumItinerariesnumber1Maximum: 10searchWindownumber1transitModesarray<string>maxWalkDistancenumber0maxTransfersnumber0wheelchairbooleanpreTransitModesarray<string>postTransitModesarray<string>directModesarray<string>maxDirectTimenumber0maxPreTransitTimenumber0maxPostTransitTimenumber0preTransitRentalFormFactorsarray<string>postTransitRentalFormFactorsarray<string>Response Body
curl -X POST "https://example.com/transit/intermodal-route" \
-H "Content-Type: application/json" \
-d '{
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true,
"preTransitModes": [
"string"
],
"postTransitModes": [
"string"
],
"directModes": [
"string"
],
"maxDirectTime": 0,
"maxPreTransitTime": 0,
"maxPostTransitTime": 0,
"preTransitRentalFormFactors": [
"string"
],
"postTransitRentalFormFactors": [
"string"
]
}'const body = JSON.stringify({
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true,
"preTransitModes": [
"string"
],
"postTransitModes": [
"string"
],
"directModes": [
"string"
],
"maxDirectTime": 0,
"maxPreTransitTime": 0,
"maxPostTransitTime": 0,
"preTransitRentalFormFactors": [
"string"
],
"postTransitRentalFormFactors": [
"string"
]
})
fetch("https://example.com/transit/intermodal-route", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/transit/intermodal-route"
body := strings.NewReader(`{
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true,
"preTransitModes": [
"string"
],
"postTransitModes": [
"string"
],
"directModes": [
"string"
],
"maxDirectTime": 0,
"maxPreTransitTime": 0,
"maxPostTransitTime": 0,
"preTransitRentalFormFactors": [
"string"
],
"postTransitRentalFormFactors": [
"string"
]
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/intermodal-route"
body = {
"from": {
"lat": -90,
"lng": -180
},
"to": {
"lat": -90,
"lng": -180
},
"time": "string",
"arriveBy": true,
"numItineraries": 1,
"searchWindow": 1,
"transitModes": [
"string"
],
"maxWalkDistance": 0,
"maxTransfers": 0,
"wheelchair": true,
"preTransitModes": [
"string"
],
"postTransitModes": [
"string"
],
"directModes": [
"string"
],
"maxDirectTime": 0,
"maxPreTransitTime": 0,
"maxPostTransitTime": 0,
"preTransitRentalFormFactors": [
"string"
],
"postTransitRentalFormFactors": [
"string"
]
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Find nearby transit stops
Returns transit stops within a radius of the given coordinates, ordered by distance. Uses PostGIS spatial index for efficient radius queries. Only returns stops (location_type=0), not stations or entrances.
Query Parameters
latRequiredstringlngRequiredstringradiusstringlimitstringResponse Body
curl -X GET "https://example.com/transit/stops?lat=string&lng=string&radius=string&limit=string"fetch("https://example.com/transit/stops?lat=string&lng=string&radius=string&limit=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/stops?lat=string&lng=string&radius=string&limit=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/stops?lat=string&lng=string&radius=string&limit=string"
response = requests.request("GET", url)
print(response.text)Get routes serving a stop
Returns all transit routes that pass through the specified stop, including route name, color, type, and agency information.
Query Parameters
feedIdRequiredstringstopIdRequiredstringResponse Body
curl -X GET "https://example.com/transit/routes?feedId=string&stopId=string"fetch("https://example.com/transit/routes?feedId=string&stopId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/routes?feedId=string&stopId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/routes?feedId=string&stopId=string"
response = requests.request("GET", url)
print(response.text)Get upcoming departures at nearby stops
Returns upcoming departures from transit stops near the given coordinates. Queries the MOTIS timetable and enriches results with route colors from the GTFS database. Supports direct stop queries via feedId/stopId, or spatial search via lat/lng/radius.
Query Parameters
latstringlngstringradiusstringtimestringnstringfeedIdstringstopIdstringrouteShortNamesstringdirectionIdstringResponse Body
curl -X GET "https://example.com/transit/departures?lat=string&lng=string&radius=string&time=string&n=string&feedId=string&stopId=string&routeShortNames=string&directionId=string"fetch("https://example.com/transit/departures?lat=string&lng=string&radius=string&time=string&n=string&feedId=string&stopId=string&routeShortNames=string&directionId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/departures?lat=string&lng=string&radius=string&time=string&n=string&feedId=string&stopId=string&routeShortNames=string&directionId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/departures?lat=string&lng=string&radius=string&time=string&n=string&feedId=string&stopId=string&routeShortNames=string&directionId=string"
response = requests.request("GET", url)
print(response.text)Get live vehicle positions within a bounding box
Fetches GTFS-RT VehiclePosition data from all configured feeds and returns vehicles within the specified bounding box. Results are enriched with route colors and short names. Responses are cached for 10 seconds per feed.
Query Parameters
northRequiredstringsouthRequiredstringeastRequiredstringwestRequiredstringfeedIdstringrouteIdstringResponse Body
curl -X GET "https://example.com/transit/vehicles?north=string&south=string&east=string&west=string&feedId=string&routeId=string"fetch("https://example.com/transit/vehicles?north=string&south=string&east=string&west=string&feedId=string&routeId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/vehicles?north=string&south=string&east=string&west=string&feedId=string&routeId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/vehicles?north=string&south=string&east=string&west=string&feedId=string&routeId=string"
response = requests.request("GET", url)
print(response.text)Get route shape geometry
Returns the GTFS shape coordinates for a specific route, used for snapping live vehicle positions to the actual route geometry on the map. Coordinates are in [lng, lat] order. Responses are cached for 24 hours (shapes are static GTFS data).
Query Parameters
feedIdRequiredstringrouteIdRequiredstringResponse Body
curl -X GET "https://example.com/transit/shapes?feedId=string&routeId=string"fetch("https://example.com/transit/shapes?feedId=string&routeId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/shapes?feedId=string&routeId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/shapes?feedId=string&routeId=string"
response = requests.request("GET", url)
print(response.text)Get route detail with ordered stops and shape
Returns route metadata, geographically ordered stops, shape geometry, and related route IDs (same trunk line) for rendering an isolated route detail view.
Query Parameters
feedIdRequiredstringrouteIdRequiredstringResponse Body
curl -X GET "https://example.com/transit/route-detail?feedId=string&routeId=string"fetch("https://example.com/transit/route-detail?feedId=string&routeId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/route-detail?feedId=string&routeId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/route-detail?feedId=string&routeId=string"
response = requests.request("GET", url)
print(response.text)Get all vehicles on specific routes (no bounding box)
Query Parameters
routeIdsRequiredstringfeedIdstringResponse Body
curl -X GET "https://example.com/transit/route-vehicles?routeIds=string&feedId=string"fetch("https://example.com/transit/route-vehicles?routeIds=string&feedId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/route-vehicles?routeIds=string&feedId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/route-vehicles?routeIds=string&feedId=string"
response = requests.request("GET", url)
print(response.text)Get real-time stop times for a specific trip
Query Parameters
feedIdRequiredstringtripIdRequiredstringResponse Body
curl -X GET "https://example.com/transit/trip-stops?feedId=string&tripId=string"fetch("https://example.com/transit/trip-stops?feedId=string&tripId=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/trip-stops?feedId=string&tripId=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/trip-stops?feedId=string&tripId=string"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/bikes-allowed?routes=string"fetch("https://example.com/transit/bikes-allowed?routes=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/bikes-allowed?routes=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/bikes-allowed?routes=string"
response = requests.request("GET", url)
print(response.text)Discover GTFS-RT feed URLs
Queries Transitland to discover GTFS-RT feed URLs (vehicle positions, trip updates, alerts) for existing feeds. If feedId is provided, only discovers for that feed; otherwise discovers for all feeds missing RT URLs.
Request Body
application/jsonRequiredfeedIdstringResponse Body
curl -X POST "https://example.com/transit/discover-rt-urls" \
-H "Content-Type: application/json" \
-d '{
"feedId": "string"
}'const body = JSON.stringify({
"feedId": "string"
})
fetch("https://example.com/transit/discover-rt-urls", {
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://example.com/transit/discover-rt-urls"
body := strings.NewReader(`{
"feedId": "string"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/discover-rt-urls"
body = {
"feedId": "string"
}
response = requests.request("POST", url, json = body, headers = {
"Content-Type": "application/json"
})
print(response.text)Get station detail with entrances and building geometry
Returns a GTFS station with its OSM-linked entrances (subway/train station entrances within 200m) and building polygon geometry. Entrances include descriptions, wheelchair accessibility, and level information.
Path Parameters
feedIdRequiredstringstopIdRequiredstringResponse Body
curl -X GET "https://example.com/transit/station/string/string"fetch("https://example.com/transit/station/string/string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/station/string/string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/station/string/string"
response = requests.request("GET", url)
print(response.text)Find nearest station entrance to a coordinate
Returns the closest subway or train station entrance to the given coordinate, within maxDistance meters (default 500m). Pass wheelchair=true for accessible access points only: entrances tagged wheelchair=no are excluded, vertical access requires elevators instead of stairs, and confirmed-accessible entrances are preferred.
Query Parameters
latRequiredstringlonRequiredstringmaxDistancestringwheelchairstringResponse Body
curl -X GET "https://example.com/transit/nearest-entrance?lat=string&lon=string&maxDistance=string&wheelchair=string"fetch("https://example.com/transit/nearest-entrance?lat=string&lon=string&maxDistance=string&wheelchair=string")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/nearest-entrance?lat=string&lon=string&maxDistance=string&wheelchair=string"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://example.com/transit/nearest-entrance?lat=string&lon=string&maxDistance=string&wheelchair=string"
response = requests.request("GET", url)
print(response.text)