Mass Transit Proximity API Reference

The RESTful Mass Transit Proximity API enables users to enhance existing spatial databases, enrich location-based applications and promote alternative transportation options. This API exposes a subset of the extensive normalized data set maintained by Urban Mapping. Review existing coverage and contact us for more information.

Please direct technical questions to support[at]urbanmapping[dot]com.

This API exposes two search methods:

Given a set of search results via the search methods, additional detail is available by resource:

API Calls

An API call is structured as follows:

http://tapi1.urbanmapping.com/{resource_path|method}.{result_format}?apikey={API key}&sig={encrypted_key}&{method parameters}

Sample calls:

Example 1, find nearby stations (result in JSON):
http://tapi1.urbanmapping.com/find/stations/near_point.json?lat=37.0&lng=-121&searchrange=1000&apikey=ABCDEFG
Example 2, requesting a resource (result in XML): 
http://tapi1.urbanmapping.com/authority/100002.xml?apikey=ABCDEFG

You must use a valid API key and provide it with every request. Please complete a request form regarding pricing and terms for this service.

The REST API supports HTTP-GET queries. All methods accept the following parameters.

Universal Parameters (* = required)

apikey (GET Request Parameter) *
Developer API Key

format (Resource specifier)
The desired response format in lowercase. Supported formats are: html, json, xml. This parameter modifies the requested resource path: i.e. /authority/10002.json, /find/stations/near_point.xml

Searching by Location

Find Station Stops Near Point

Returns a list of stations ordered by distance to the point.

Resource Location: /find/stations/near_point

Request Parameters

lat (Float)
A WGS-84 latitude, in degrees.

lng (Float)
A WGS-84 longitude, in degrees.

searchrange (Integer)
Maximum search range in meters. Defaults to 1000.  Max is 15000.

transit_system_id (Integer)
Limit results to the specified transit system.

Example

http://tapi1.urbanmapping.com/find/stations/near_point.xml?apikey=...&lat=37.75&lng=-122.45&searchrange=1500

Response Object

View sample JSON or XML output.

Find Station Stops Near Address

The requested address is first geocoded to a latitude and longitude, which are then used to perform a search by point. Returns a list of ordered stations by distance to the address.  Requires address_street and either address_city + address_state, or address_postalcode.  This is technically executed as a single request, but, for the purposes of account administration, a single invocation is counted as two calls.

Resource Location: /find/stations/near_address

Request Parameters

address_street (String)*
The street portion of the address; supports intersections (i.e. 5th St and Townsend)

address_city (String)
The city portion of the address

address_state (String)
The state portion of the address

address_postalcode (String)
The postal (zip) code portion of the address.

address_country (String)
The country of the address; either USA or CAN.  Defaults to USA. Uses 3 character ISO code

searchrange (Integer)
Maximum search range in meters.  Defaults to 1000.  Max is 15000.

transit_system_id (Integer)
Limit results to the specified transit system.

Example

http://tapi1.urbanmapping.com/find/stations/near_address.xml?apikey=...&searchrange=1000&address_street=81+Lundys+Lane&address_city=San+Francisco&address_state=CA

Response Object (XML)

<?xml version="1.0" encoding="UTF-8"?>
<StationStopCollection count="1">
    <StationStopSummary>
      <ss_id>881383</ss_id
      <transit_system_id>100005</transit_system_id>
      <name>Forest Hill</name>
    </StationStopSummary>
</StationStopCollection>

Response Object (JSON)

{"type":"StationStopCollection", 
 "count":1,
 "objects":[
    {"type":"StationStopSummary",
    "ss_id":"881383",
    "transit_system_id":"100005",
    "name":"Forest Hill"}]}

View Resources

Station Stop Details

Provides basic information about a Station Stop including lines serviced and parent Transit System (eg, BART, Montreal Metro).

Resource Location: /station/{station_id}

Example

http://tapi1.urbanmapping.com/station/400005.xml?apikey=...

Response Object (XML)

<?xml version="1.0" encoding="UTF-8"?>
<StationStopCollection count="1">
    <StationStop>
      <ss_id>400005</ss_id>
      <transit_system_id>100002</transit_system_id>
      <name>Ashby Station</name>
      <lines>
        <linename>Fremont - Richmond</linename>
        <linename>Richmond - Millbrae</linename>
      </lines>
    </StationStop>
</StationStopCollection>

Response Object (JSON)

{"type":"StationStopCollection", 
 "count":1,
 "objects":[
    {"type":"StationStop",
    "ss_id": "400005",
    "transit_system_id": "100002",
    "name": "Ashby Station",
    "lines": ["Fremont-Richmond","Richmond - Millbrae"]}]}

Transit System Details

Provides basic information about a Transit System.

Resource Location: /system/{transit_system_id}

Example

http://tapi1.urbanmapping.com/system/100002.xml?apikey=...

Response Object (XML)

<?xml version="1.0" encoding="UTF-8"?>
<TransitSystemCollection count="1">
    <TransitSystem>
      <country_iso3>USA</country_iso3>
      <coverage_type>Regional</coverage_type>
      <coverage_value>San Francisco Bay Area</coverage_value>
      <name>Bay Area Rapid Transit</name>
      <ts_id>100002</ts_id>
      <timezone>America/Los_Angeles</timezone>
      <bicycle_hours>Bicycles are restricted in San Francisco during commute; but not elsewhere on line.  
      Refer to the schedule.</bicycle_hours>
      <bicycles_allowed>True</bicycles_allowed>
      <fare_notes>BART has a point-to-point fare system.</fare_notes>
      <name_informal></name_informal>
      <notes></notes>
</TransitSystem>

Response Object (JSON)

{"type":"TransitSystemCollection", 
 "count":1,
 "objects":[
    {"type":"TransitSystem",
    "country_iso3": "USA",
    "coverage_type": "Regional",
    "coverage_value": "San Francisco Bay Area",
    "name": "Bay Area Rapid Transit",
    "ta_id": "",
    "timezone": "America/Los_Angeles",
    "bicycle_hours": "Bicycles are restricted in San Francisco during commute; but not elsewhere on line.  Refer to the schedule.",
    "bicycles_allowed": "True",
    "fare_notes": "BART has a point-to-point fare system.",
    "name_informal": "",
    "notes": ""}]}

List Transit Systems

Lists all Transit Systems with complete line/station coverage in the UMI Mass Transit database.

Resource Location: /systems

Example

http://tapi1.urbanmapping.com/systems.xml?apikey=...

Response Object (XML)

<?xml version="1.0" encoding="UTF-8"?>
<TransitSystemCollection count="60">
    <TransitSystemSummary>
      <ts_id>100219</ts_id>
      <name>Airtrain</name>
    </TransitSystemSummary>
    ...
</TransitSystemCollection>

Response Object (JSON)

{"type":"TransitSystemCollection", 
 "count":60,
 "objects":[
    {"type":"TransitSystemSummary",
    "ts_id":"100219",
    "name":"Airtrain"},
    ...
}