Parchment Docs

Transit

Transit vehicles, routes, and stops

GTFS-RT vehicle positions

GET
/transit/vehicles

Response Body

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)
Empty

Route shape geometry

GET
/transit/shapes

Response Body

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)
Empty

Route-specific vehicle positions

GET
/transit/route-vehicles

Response Body

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)
Empty

Trip stop times

GET
/transit/trip-stops

Response Body

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)
Empty

Route ids with a departure at each of several stops

GET
/transit/service-at-stops

Response Body

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)
Empty

Route detail with stops and shape

GET
/transit/route-detail

Response Body

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)
Empty

Resolve a bare GTFS route id at a location

GET
/transit/resolve-route

Response Body

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)
Empty

Upcoming departures at a stop

GET
/transit/departures

Response Body

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)
Empty

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.

GET
/transit/boarding-candidates

Query Parameters

stopIdRequiredstring

Timetable stop id ({feed}_{stop}) where the leg boards

Minimum length: 3
stopsRequiredstring

Comma-separated stop ids after boarding, in ride order, the alighting stop last

Minimum length: 3
departureRequiredstring

Planned departure from the boarding stop

Format: "date-time"
arrivalRequiredstring

Planned arrival at the alighting stop

Format: "date-time"
routesstring

Comma-separated short names of the leg's interchangeable routes, its own included

directionIdstring
earlieststring

Soonest the rider can be at the boarding stop; widens the search for earlier runs (up to 30 min before the planned one)

Format: "date-time"
lateststring

Latest a run may leave; widens the search for later runs (up to 60 min after the planned one) and returns up to 16

Format: "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)
Empty
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)
Empty

Batch check bikes_allowed for routes

GET
/transit/bikes-allowed

Response Body

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)
Empty

Station detail with entrances and buildings

GET
/transit/station/{feedId}/{stopId}

Path Parameters

feedIdRequiredstring
stopIdRequiredstring

Response 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)
Empty

Nearest station entrance lookup

GET
/transit/nearest-entrance

Response Body

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)
Empty