Stops
The stops call returns stops of all available agencies within a defined distance from a geodetic reference.
Call format
Part | Description | Optional | Example |
URL | TransiCast web server instance | http://transicast.appspot.com/ws/V3 | |
Servlet descriptor | stops | stops | |
Parameter: ll=<lat>,<lon> | Geodetic reference point coordinates (WGS-84) | ll=33.2241,-122.5198 | |
Parameter: meters=<value> | Distance (radius) from reference point to fetch stops | meters=1500 | |
Parameter: max=<value> | Filter for maximum number of distinct stops to return. Two or more stops are distinct if their stop descriptions differ. The sequence of the stops returned is ordered by distance from the request coordinates | max=7 | |
Parameter: types=<value[,value]> | List of route types to filter stops, in accordance with the GTFS definition | types=0,3 | |
Parameter: locIDs=<stop id, ...> | Request specific stops by stopIDs: Comma separated list of stop IDs | locIDs=2337 | |
Parameter: loccodes=<stop code, ...> | Request specific stops by stop codes: Comma separated list of stop codes, as published by the agency | loccodes=14505 |
http://transicast.appspot.com/ws/V3/stops?ll=37.794543,-122.394922&meters=350&max=4&appid=<api_key>
Response format
The <resultSet> tag of a stops call contains three attributes, the <queryLat> and <queryLon> coordinates of the call, and <ct>, which is the number of stops within the requested radius (parameter meters=<value>).
The stops are returned through the <location> tag. It contains the following attributes:
Attribute | Description | Key | Used in | Example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
desc | Stop description | desc="Market & Steuart" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
lat | Stop latitude (WGS-84) | lat="37.7944499"lng | Stop longitude (WGS-84) | lng="-122.39492" | locid | Stop ID | Next bus and train times | Route detail responses Service Messages locid="37227" | loccode | Traveler facing stop code. Stop codes are often printed on stop signage or included in handout schedules to make it easier for travelers to request a stop schedule or real-time arrival information for a particular stop. | loccode="137227" | parent | Stop ID of stop's parent, if it exists | parent="stoparea:11652" | URL | Stop URL | URL="http://hea.thebus.org/nextbus.asp?s=346" | location_type | Location type, in accordance with the GTFS definition | location_type="1" | dest | Routes and destinations, see below | desc2 | Alternative stop description, if provided by the agency | agency | Agency ID for the stop | Agencies, as key value | agency="SFMTA" | rt | Flag. true for stops that offer service messages and next bus and train times based on real-time estimates | rt="true" | type | Route type. Values are following the definition of route_type in GTFS | type="3" | dest | Tag: Routes and destinations that service the stop, see below | child | Tag: Child stop, see below | |
Routes and the destinations of the trips servicing a stop are provided through the <dest> tag, which is nested inside <location>:
Attribute | Description | Key | Used in | Example |
route | Route ID | Route, as provided in the route list | id="2" | |
desc | Destination | Destinations of the trips servicing the stop | desc="Inbound to Market & Steuart St." |
Where the original feeds provide stop parent/child relationships. Parent stops are included in the response as a collection of children stops. The <child> tag lists the children:
Attribute | Description | Key | Used in | Example |
locid | Stop ID of the child | Stop ID of the child stop | locid="33979" |
Parents do not have associated routes. This means that next bus and train times cannot be called using a stop ID of a parent.
<?xml version="1.0" encoding="UTF-8"?> <resultSet queryTime="1319338341769" ct="5" queryLat="37.794543" queryLng="-122.394922"> <location desc="Market & Steuart" dir="" lat="37.7944499" lng="-122.39492" locid="37227" loccode="137227" agency="SFMTA" rt="true"> <dest route="2" desc="Inbound to Market & Steuart St." type="3"/> </location> <location desc="Market & Steuart" dir="" lat="37.7944499" lng="-122.39492" locid="7227" loccode="71227" agency="SFMTA" rt="true"> <dest route ="2" desc="Outbound to Clement & 14 Ave" type="3"/> </location> <location desc="Market St & Steuart St" dir="" lat="37.7942599" lng="-122.39491" locid="5693" loccode="15693" agency="SFMTA" rt="true"> <dest route="N OWL" desc="Inbound to Townsend & 4th St." type="3"/> <dest route="N OWL" desc="Outbound to La Playa & Judah" type="3"/> <dest route="14L" desc="Inbound to Mission St. & Main" type="3"/> <dest route="T OWL" desc="Inbound to Visitacion Valley" type="3"/> <dest route="14X" desc="Inbound to Mission St. & Spear St." type="3"/> <dest route="14" desc="Inbound to Steuart & Mission" type="3"/> </location> </resultSet>
Notes
- When the max parameter is set, the number of stops returned is counted against the unique stop descriptions. In cases where multiple individual stops share a stop description, the number of <location> records returned may be greater than the value of the max parameter
- A maximum of 100 stops is returned
- The maximum radius considered in a request is 15000m
- Depending on agency data provisioning, stop codes may not by populated with content
Contact
By email  
© 2011 - 2023 TransiCast |