Skip to content

Instantly share code, notes, and snippets.

@grahamb
Created July 18, 2012 19:23
Show Gist options
  • Select an option

  • Save grahamb/3138256 to your computer and use it in GitHub Desktop.

Select an option

Save grahamb/3138256 to your computer and use it in GitHub Desktop.
Translink API presentaiton notes - July 18, 2012

API

  • REST, HTTP GET
  • default XML, can return JSON w/ conent-type:application/JSON header
  • API key required
  • versioned
  • 100 req/min per IP, max 10000 req/day -- open for discussion
  • services
    • stops
    • buses
    • stop estimates
    • route details
  • http://api.translink.ca

Queries

  • ID queries (valid stop id) - /v1/RTTIAPI/Stops/55612
  • queries can be filtered

Stops

  • 5-digit stop number
  • filters
    • lat/long
    • radius (up to 2000m)
    • route numbers (comma-delim list of route numbers)

Busses

  • retrieve vehicle info for filtered set of busses
  • query by bus number
  • filter by stop # or/or route #
    • find all the busses for a specific stop and/or route
  • includes reference to the KML file for the route & pattern (deviation from normal route)

Stop Estimates

  • gets next bus estimates for a given stop ID
  • filter by route, count (default 6) and timeframe (minutes)

Routes

  • query for a specific 3-character route number (004, N16, C97, 145)
  • useful when querying for route patterns
  • filter based on stop number

Random Notes

  • bus GPS updates:
    • when exiting a stop within 20-45 m
    • when passing by a stop without stopping
    • or every two minutes if not otherwise updated by the above
  • WV Blue Bus, Langley CommShuttle & Tsawassen CS not yet availble -- no GPS capabilities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment