TransiCast - API Documentation
The TransiCast Web Service breaks down into six calls:
agency list,
stops,
routes,
route details,
next bus and train times and
service messages. The TransiCast Web Service is XML based, and uses REST GET method calls. Responses in JSON are provided on request.
Please contact TransiCast for an APi key. |
The current version of the TransiCast API is /V3.
General call format
The general call format of API calls consists of four parts:
- TransiCast web server address: http://<yourapp>.appspot.com/ws/V3
- The identifier of the servlet of an API call
- Required and optional request parameters such as WGS-84 coordinates (lat/lon), stop numbers and route numbers
- appid license key issued by TransiCast
http://transicast.appspot.com/ws/V3/agencies?ll=41.727122,-87.55947&appid=<api_key>
General response format
The responses of the TransiCast Web Service are in XML. They are wrapped in a <ResultSet> tag which contains the following two attributes:
- queryTime: Server time of the request
- ct: Number of records that the call returns without filters
<?xml version="1.0" encoding="UTF-8"> <resultSet queryTime="1319328820274" ct="2"> <agency region="NA" country="CA" name="GO Ontario" top="44.44" left="-80.55" bottom="43.09" right="-78.28" stopcodes="false"/> <agency region="NA" country="CA" common="Toronto" name="TTC" rt="true" top="43.92" left="-79.66" bottom="43.6" right="-79.11" stopcodes="true"/> </resultSet>
TransiCast uses the following formats and encodings:
- Requests are case sensitive
- Coordinates are WGS-84 decimal values
- Times are in elapsed milliseconds since midnight, January 1, 1970 UTC
- Special characters contained in result strings are HTML encoded
- Color values are RGB encoded, using hexadecimal values
- If a flag element is not included in a response, the default value of "false" is assumed. A return value of "" indicates an unknown flag value.
JSON
Responses in JSON can be requested with the optional parameter format=json.
http://transicast.appspot.com/ws/V3/agencies?ll=41.727122,-87.55947&format=json&appid=<api_key>
Error handling
TransiCast returns errors in XML, using the error tag to provide a description of the error. As an example, the following call is not well formatted, and will trigger a data format error:
http://transicast.appspot.com/ws/V3/stops?max=4&appid=<api_key>&meters=1300&ll=%5Bapp:user-lat%5D,%5Bapp:user-lon%5D
Contact
By email  
© 2011 - 2023 TransiCast |