Transit
Transit vehicles, routes, and stops
curl -X GET "https://example.com/transit/vehicles"fetch("https://example.com/transit/vehicles")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/vehicles"
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"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/shapes"fetch("https://example.com/transit/shapes")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/shapes"
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"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/route-vehicles"fetch("https://example.com/transit/route-vehicles")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/route-vehicles"
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"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/trip-stops"fetch("https://example.com/transit/trip-stops")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/trip-stops"
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"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/service-at-stops"fetch("https://example.com/transit/service-at-stops")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/service-at-stops"
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/service-at-stops"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/route-detail"fetch("https://example.com/transit/route-detail")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/route-detail"
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"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/resolve-route"fetch("https://example.com/transit/resolve-route")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/resolve-route"
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/resolve-route"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/departures"fetch("https://example.com/transit/departures")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/departures"
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"
response = requests.request("GET", url)
print(response.text)Runs a rider may have boarded in place of the planned one
Runs leaving the boarding stop from 10 minutes before to 20 minutes after departure (widened by earliest and latest): any run of routes in the leg's direction, and runs of other routes that also call at the alighting stop. Each lists the given later stops it calls at (calls, at most ten sampled, the alighting stop always kept), so an express can be told from a local, and carries its live position when the feed publishes vehicle positions. stops names the later stops whose boards could be read: a run missing from one of those does not call there.
Query Parameters
stopIdRequiredstringTimetable stop id ({feed}_{stop}) where the leg boards
3stopsRequiredstringComma-separated stop ids after boarding, in ride order, the alighting stop last
3departureRequiredstringPlanned departure from the boarding stop
"date-time"arrivalRequiredstringPlanned arrival at the alighting stop
"date-time"routesstringComma-separated short names of the leg's interchangeable routes, its own included
directionIdstringearlieststringSoonest the rider can be at the boarding stop; widens the search for earlier runs (up to 30 min before the planned one)
"date-time"lateststringLatest a run may leave; widens the search for later runs (up to 60 min after the planned one) and returns up to 16
"date-time"Response Body
curl -X GET "https://example.com/transit/boarding-candidates?stopId=string&stops=string&departure=2019-08-24T14%3A15%3A22Z&arrival=2019-08-24T14%3A15%3A22Z&routes=string&directionId=string&earliest=2019-08-24T14%3A15%3A22Z&latest=2019-08-24T14%3A15%3A22Z"fetch("https://example.com/transit/boarding-candidates?stopId=string&stops=string&departure=2019-08-24T14%3A15%3A22Z&arrival=2019-08-24T14%3A15%3A22Z&routes=string&directionId=string&earliest=2019-08-24T14%3A15%3A22Z&latest=2019-08-24T14%3A15%3A22Z")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/boarding-candidates?stopId=string&stops=string&departure=2019-08-24T14%3A15%3A22Z&arrival=2019-08-24T14%3A15%3A22Z&routes=string&directionId=string&earliest=2019-08-24T14%3A15%3A22Z&latest=2019-08-24T14%3A15%3A22Z"
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/boarding-candidates?stopId=string&stops=string&departure=2019-08-24T14%3A15%3A22Z&arrival=2019-08-24T14%3A15%3A22Z&routes=string&directionId=string&earliest=2019-08-24T14%3A15%3A22Z&latest=2019-08-24T14%3A15%3A22Z"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/alerts"fetch("https://example.com/transit/alerts")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/alerts"
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/alerts"
response = requests.request("GET", url)
print(response.text)curl -X GET "https://example.com/transit/bikes-allowed"fetch("https://example.com/transit/bikes-allowed")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/bikes-allowed"
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"
response = requests.request("GET", url)
print(response.text)Station detail with entrances and buildings
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)curl -X GET "https://example.com/transit/nearest-entrance"fetch("https://example.com/transit/nearest-entrance")package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/transit/nearest-entrance"
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"
response = requests.request("GET", url)
print(response.text)