Routes

By default output format is set to xml. JSON and PHP are native array formats.

Usage

# REQUIRED PARAMETERS: carrier id, apikey
http://developer.metro.net/tm/routes.php?apikey=1-2-3-4-5&carrier=63

# OPTIONAL: SPECIFY FORMAT 
http://developer.metro.net/tm/routes.php?apikey=1-2-3-4-5&carrier=63&format=xml 
http://developer.metro.net/tm/routes.php?apikey=1-2-3-4-5&carrier=63&format=json 
http://developer.metro.net/tm/routes.php?apikey=1-2-3-4-5&carrier=63&format=php

Returns

Route will return a list of all routes names, direction and route ids associated with passed carrier id.

JSON Format

{'metadata': {'query_time': '0.0028269290924072 seconds',
	'records_found': 2,
	'request': 'Routes: Carrier ID: 1',
	'request_uri': '\\/tm\\/routes.php?carrier=1&format=json'},
	'routes': {'item': [{'direction': 'N',
		  'id': '1108',
		  'text': 'AMTRAK PACIFIC SURFLINER'},
		 {'direction': 'S',
		  'id': '1109',
		  'text': 'AMTRAK PACIFIC SURFLINER'}]}}


XML format

Special characters in the output will be encoded. An index attribute will be returned for any ‘arrayed’ objects.