### Valhalla API Request Examples (GET vs POST) Source: https://www.transit.land/documentation/routing-platform/valhalla Examples demonstrating how to make requests to the Valhalla API using either GET or POST methods. For GET requests, the JSON payload is passed as a URL-encoded query parameter. For POST requests, it's sent in the request body. ```bash # GET curl --get "https://transit.land/api/v2/routing/valhalla/route" \ -H "apikey: YOUR_API_KEY" \ --data-urlencode 'json={...}' # POST curl -X POST "https://transit.land/api/v2/routing/valhalla/route" \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{...}' ``` -------------------------------- ### Example API Request with API Key Source: https://www.transit.land/documentation/index This example shows how to include your API key in a request to the Transitland API. Replace 'xxx' with your actual API key. ```http https://transit.land/api/v2/feeds?api_key=xxx ``` -------------------------------- ### Download Latest Dataset API Response Example Source: https://www.transit.land/documentation/datasets/downloading This is an example of the HTTP response when downloading the latest dataset. It indicates a successful redirect to the actual file location. ```http HTTP/1.1 302 Found Location: https://interline.blob.core.windows.net/transitland-datasets/US/stops-routes-with-schedule/tl-dataset-US-2025-07-27T04:00:30.zip?sp=r&sv=2018-11-09&sr=b ``` -------------------------------- ### Mapbox GL JS Example Source: https://www.transit.land/documentation/vector-tiles An example demonstrating how to use Mapbox GL JS to display Transitland v2 Vector Tiles. Ensure you have a Mapbox access token and a Transitland API key. ```javascript const map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v11', center: [-74.0060, 40.7128], // New York City zoom: 10 }); map.on('load', () => { map.addSource('transit-routes', { type: 'vector', tiles: [ // Replace with your Transitland API key `https://transit.land/api/v2/tiles/routes/tiles/{z}/{x}/{y}.pbf?apikey=YOUR_TRANSITLAND_API_KEY` ] }); map.addLayer({ id: 'transit-routes-layer', type: 'line', source: 'transit-routes', 'source-layer': 'routes', // The source-layer name depends on the tile source paint: { 'line-color': '#ff0000', 'line-width': 2 } }); }); ``` -------------------------------- ### List Available Datasets API Response Example Source: https://www.transit.land/documentation/datasets/downloading This is an example of the JSON response when listing available Transitland Datasets. It includes metadata such as bucket information and creation dates. ```json { "data": [ { "attributes": { "bucket_key": "US/stops-routes-with-schedule/tl-dataset-US-2025-07-27T04:00:30.zip", "bucket_name": "transitland-datasets", "bucket_provider": "azure", "created_at": "2025-07-28T12:52:54.466Z", "dataset_type": "stops-routes-with-schedule", "geography": "US", "updated_at": "2025-07-28T12:52:54.466Z" }, "id": "22", "type": "transitland_dataset" } ], "jsonapi": { "version": "1.0" } } ``` -------------------------------- ### Two-Part Onestop ID Example Source: https://www.transit.land/documentation/atlas An example of a two-part Onestop ID, which includes an entity prefix and a name. This variant is simpler for manual record creation. ```text f-banning~pass~transit ``` -------------------------------- ### Three-Part Onestop ID Example Source: https://www.transit.land/documentation/atlas An example of a three-part Onestop ID, which includes an entity prefix, a geohash, and a name. ```text f-9q9-bart ``` -------------------------------- ### Example Walking Leg Data Source: https://www.transit.land/documentation/routing-platform/transitland-routing-api This snippet illustrates the data structure for a walking leg within a transit route, including start and end points, distance, duration, and mode. ```json { "startTime": 1714786910000, "endTime": 1714787296000, "distance": 456.4860352225029, "duration": 386, "mode": "WALK", "transitLeg": false, "from": { "lat": 37.78427, "lon": -122.409402, "name": "Eddy St & Mason St", "departure": 1714786910000, "stopId": "14486", "stopCode": "14486", "stopOnestopId": "s-9q8yyw2jq4-eddyst~masonst" }, "to": { "lat": 37.78486164387391, "lon": -122.40791389999999, "name": "Union Square", "arrival": 1714787296000, "stopId": "14494", "stopCode": "14494", "stopOnestopId": "s-9q8yyx022c-unionsquare" } } ``` -------------------------------- ### Change Payload Example Source: https://www.transit.land/documentation/datastore/changesets.html An example of a change payload containing an action to create or update a stop with its Onestop ID and name. ```json { "change_payload": { "payload": { "changes": [ { "action": "createUpdate", "stop": { "onestopId": "s-9q8yt4b-1avhos", "name": "1st Ave. & Holloway Street" } } ] } } } ``` -------------------------------- ### Compute a Matrix (GET) Source: https://www.transit.land/documentation/routing-platform/valhalla Use this snippet to compute a time and distance matrix between specified source and target locations using the /sources_to_targets endpoint. The 'pedestrian' costing is used as an example. ```bash curl --get "https://transit.land/api/v2/routing/valhalla/sources_to_targets" \ -H "apikey: YOUR_API_KEY" \ --data-urlencode 'json={"sources":[{"lat":37.789,"lon":-122.401}],"targets":[{"lat":37.782,"lon":-122.447},{"lat":37.776,"lon":-122.418}],"costing":"pedestrian"}' ``` -------------------------------- ### Compute Isochrone Contours (GET) Source: https://www.transit.land/documentation/routing-platform/valhalla Use this snippet to compute isochrone (equal-travel-time) or isodistance contours around a location using the /isochrone endpoint. The example specifies a time contour of 10 minutes. ```bash curl --get "https://transit.land/api/v2/routing/valhalla/isochrone" \ -H "apikey: YOUR_API_KEY" \ --data-urlencode 'json={"locations":[{"lat":37.789,"lon":-122.401}],"costing":"pedestrian","contours":[{"time":10}]}" ``` -------------------------------- ### Example Two-Component Onestop ID Source: https://www.transit.land/documentation/concepts/onestop-id-scheme Illustrates a valid Onestop ID with two components, including a geohash. ```text f-galesburg~il~us ``` -------------------------------- ### Example UTF-8 Names in Onestop IDs Source: https://www.transit.land/documentation/concepts/onestop-id-scheme Demonstrates the use of UTF-8 characters and tildes for word breaks in Onestop ID names. ```text o-ezjm-informaciónoficial~consorcioregionaldetransportesdemadrid ``` ```text o-xn39-瑞浪市 ``` ```text r-xn39k-瑞浪市コミュニティバス釜戸大湫線 ``` -------------------------------- ### Example Route Response Source: https://www.transit.land/documentation/routing-platform/transitland-routing-api This snippet shows a portion of a typical response when querying for route information, detailing departure times and stop identifiers. ```json { "departure": 1714785035000, "stopId": "13046", "stopCode": "13046", "stopIndex": 15, "stopSequence": 15, "stopOnestopId": "s-9q8yuvn0hx-balboast~19thave" }, { "lat": 37.776626, "lon": -122.475987, "name": "Balboa St & 17th Ave", "departure": 1714785074000, "stopId": "13044", "stopCode": "13044", "stopIndex": 16, "stopSequence": 16, "stopOnestopId": "s-9q8yuvp8y9-balboast~17thave" }, { "lat": 37.776788, "lon": -122.472411, "name": "Balboa St & Park Presidio Blvd", "departure": 1714785140000, "stopId": "13071", "stopCode": "13071", "stopIndex": 17, "stopSequence": 17, "stopOnestopId": "s-9q8yvj439z-balboast~parkpresidioblvd" }, { "lat": 37.776868, "lon": -122.470531, "name": "Balboa St & 12th Ave", "departure": 1714785174000, "stopId": "13041", "stopCode": "13041", "stopIndex": 18, "stopSequence": 18, "stopOnestopId": "s-9q8yvj5djy-balboast~12thave" }, { "lat": 37.776967, "lon": -122.468388, "name": "Balboa St & 10th Ave", "departure": 1714785213000, "stopId": "13039", "stopCode": "13039", "stopIndex": 19, "stopSequence": 19, "stopOnestopId": "s-9q8yvjj4z9-balboast~10thave" }, { "lat": 37.777065, "lon": -122.466256, "name": "Balboa St & 8th Ave", "departure": 1714785252000, "stopId": "13037", "stopCode": "13037", "stopIndex": 20, "stopSequence": 20, "stopOnestopId": "s-9q8yvjng37-balboast~8thave" }, { "lat": 37.777173, "lon": -122.463849, "name": "Balboa St & 6th Ave", "departure": 1714785300000, "stopId": "13035", "stopCode": "13035", "stopIndex": 21, "stopSequence": 21, "stopOnestopId": "s-9q8yvm0ecr-balboast~6thave" }, { "lat": 37.777262, "lon": -122.461969, "name": "Balboa St & 4th Ave", "departure": 1714785341000, "stopId": "13033", "stopCode": "13033", "stopIndex": 22, "stopSequence": 22, "stopOnestopId": "s-9q8yvm1ut2-balboast~4thave" }, { "lat": 37.77715, "lon": -122.45818, "name": "Turk St & Arguello Blvd", "departure": 1714785425000, "stopId": "16709", "stopCode": "16709", "stopIndex": 23, "stopSequence": 23, "stopOnestopId": "s-9q8yvmheve-turkst~arguelloblvd" }, { "lat": 37.777557, "lon": -122.455035, "name": "Turk St & Stanyan St", "departure": 1714785495000, "stopId": "16732", "stopCode": "16732", "stopIndex": 24, "stopSequence": 24, "stopOnestopId": "s-9q8yvmnynz-turkst~stanyanst" }, { "lat": 37.777754, "lon": -122.453476, "name": "Turk St & Parker Ave", "departure": 1714785529000, "stopId": "16728", "stopCode": "16728", "stopIndex": 25, "stopSequence": 25, "stopOnestopId": "s-9q8yvt0p75-turkst~parkerave" }, { "lat": 37.778012, "lon": -122.451367, "name": "Turk St & Chabot Ter", "departure": 1714785576000, "stopId": "16715", "stopCode": "16715", "stopIndex": 26, "stopSequence": 26, "stopOnestopId": "s-9q8yvt38u7-turkst~chabotter" }, { "lat": 37.778235, "lon": -122.44959, "name": "Turk St & Roselyn Ter", "departure": 1714785615000, "stopId": "16729", ``` -------------------------------- ### Example Route and Trip Data Source: https://www.transit.land/documentation/routing-platform/transitland-routing-api This snippet shows the structure of a typical response when querying for route and trip information, including stop details, leg geometry, and agency information. ```json { "stops": [ { "lat": 37.782863, "lon": -122.42059, "name": "Eddy St & Van Ness Ave", "departure": 1714786380000, "stopId": "14495", "stopCode": "14495", "stopIndex": 40, "stopSequence": 40, "stopOnestopId": "s-9q8yyq0j1k-eddyst~vannessave" }, { "lat": 37.783059, "lon": -122.419019, "name": "Eddy St & Polk St", "departure": 1714786454000, "stopId": "14490", "stopCode": "14490", "stopIndex": 41, "stopSequence": 41, "stopOnestopId": "s-9q8yyq1nq0-eddyst~polkst" }, { "lat": 37.783273, "lon": -122.417357, "name": "Eddy St & Larkin St", "departure": 1714786533000, "stopId": "14482", "stopCode": "14482", "stopIndex": 42, "stopSequence": 42, "stopOnestopId": "s-9q8yyq4rsb-eddyst~larkinst" }, { "lat": 37.783478, "lon": -122.415718, "name": "Eddy St & Hyde St", "departure": 1714786610000, "stopId": "14479", "stopCode": "14479", "stopIndex": 43, "stopSequence": 43, "stopOnestopId": "s-9q8yyq78en-eddyst~hydest" }, { "lat": 37.783682, "lon": -122.413964, "name": "Eddy St & Leavenworth St", "departure": 1714786693000, "stopId": "14483", "stopCode": "14483", "stopIndex": 44, "stopSequence": 44, "stopOnestopId": "s-9q8yyqkcgu-eddyst~leavenworthst" }, { "lat": 37.783878, "lon": -122.412428, "name": "Eddy St & Jones St", "departure": 1714786766000, "stopId": "14480", "stopCode": "14480", "stopIndex": 45, "stopSequence": 45, "stopOnestopId": "s-9q8yyqmgp9-eddyst~jonesst" }, { "lat": 37.784101, "lon": -122.410789, "name": "Eddy St & Taylor St", "departure": 1714786844000, "stopId": "14493", "stopCode": "14493", "stopIndex": 46, "stopSequence": 46, "stopOnestopId": "s-9q8yyqrhmf-eddyst~taylorst" } ], "legGeometry": { "points": "afqeFv|pjV?CAMIuEEgECMIuEEgECOIuEI_FIaF?c@CeAEiBEgECMIwEEeEAMIwEGeEAMIyEIsE@c@KqDEeECOIuEGuEGqCVcAPOFo@A_@c@eGQcDSeDCe@SkCQkDCOU_EWoDAe@SkCUqDCe@QkCWoDQgDEWWgEMqBCWc@qHCWe@oHCWY{D@_@IyACUk@kIyDd@C]a@wGEWc@qHCUi@gIe@oHCYk@wIc@_HCYi@gIA]mA{QCWe@mHCYi@iICi@e@}GA[g@mHA]e@iHA]g@kHCq@SkCQiCA]g@kH?[c@sG?E", "length": 100 }, "agencyId": "SF", "agencyName": "San Francisco Municipal Transportation Agency", "routeShortName": "31", "routeLongName": "BALBOA", "routeType": 3, "routeId": "SF:31", "routeColor": "005B95", "routeTextColor": "FFFFFF", "routeOnestopId": "r-9q8yv-31", "tripId": "SF:11494605_M31", "headsign": "Caltrain", "feedId": "f-sf~bay~area~rg", "feedVersionSha1": "d0f9156ffe5dc02608da295b2f4e3fa538266f78" } ``` -------------------------------- ### Basic Routing Plan Request Source: https://www.transit.land/documentation/routing-api A fundamental example of a request to the OTP-compatible routing API endpoint. Ensure to replace 'xxx' with your actual API key. ```http https://transit.land/api/v2/routing/otp/plan?fromPlace=37.7757,-122.47996&toPlace=37.76845,-122.23508&date=2024-05-03&time=17%3A59&api_key=xxx ``` -------------------------------- ### Onestop ID with UTF-8 Characters (Japanese Route) Source: https://www.transit.land/documentation/onestop-id-scheme Example of a Onestop ID name component for a route, including Japanese UTF-8 characters. ```text r-xn39k-瑞浪市コミュニティバス釜戸大湫線 ``` -------------------------------- ### Onestop ID with UTF-8 Characters (Japanese) Source: https://www.transit.land/documentation/onestop-id-scheme Example of a Onestop ID name component that includes Japanese UTF-8 characters. ```text o-xn39-瑞浪市 ``` -------------------------------- ### Geohash and Neighbors Example Source: https://www.transit.land/documentation/onestop-id-scheme Illustrates a geohash and its eight neighboring geohashes, used to represent an operator's service area. ```text 9q9 ``` -------------------------------- ### Plan a Route (GET) Source: https://www.transit.land/documentation/routing-platform/valhalla Use this snippet to plan a turn-by-turn route between two or more locations using the /route endpoint. Specify locations and the desired costing model (e.g., 'bicycle'). ```bash curl --get "https://transit.land/api/v2/routing/valhalla/route" \ -H "apikey: YOUR_API_KEY" \ --data-urlencode 'json={"locations":[{"lat":37.789,"lon":-122.401},{"lat":37.782,"lon":-122.447}],"costing":"bicycle"}' ``` -------------------------------- ### Create an Empty Changeset Source: https://www.transit.land/documentation/datastore/changesets.html Initiates a new changeset. Include an API key in your request. ```bash POST /api/v1/changesets ``` -------------------------------- ### Configure Mapbox GL JS for Vector Tiles Source: https://www.transit.land/documentation/vector-tiles This snippet shows how to initialize Mapbox GL JS with a vector tile source for routes. Ensure you replace with your actual API key. ```javascript const apikey = const map = new mapboxgl.Map({ container: 'map', style: { version: 8, zoom: 12, center: [-87.628611, 41.860025], sources: { routes: { type: 'vector', tiles: [ `https://transit.land/api/v2/tiles/routes/tiles/{z}/{x}/{y}.pbf?apikey=${apikey}` ], maxzoom: 14 } }, layers: [{ id: 'routes', type: 'line', source: 'routes', 'source-layer': 'routes', layout: { 'line-cap': 'round', 'line-join': 'round' }, paint: { 'line-width': 3.0, 'line-color': '#ff0000' } }] } }) ``` -------------------------------- ### Programmatic Download Examples using curl Source: https://www.transit.land/documentation/datasets/downloading These curl commands demonstrate how to programmatically download Transitland Datasets, including listing available datasets, downloading the latest US or Canada dataset, and downloading a specific dataset by its ID. The -L flag follows redirects, and -o specifies the output file name. ```bash # List available datasets curl https://app.interline.io/transitland_datasets # Download latest US dataset curl -L "https://app.interline.io/transitland_datasets/download_latest?geography=US&dataset_type=stops-routes-with-schedule&api_token=YOUR_API_TOKEN" -o us-dataset.zip # Download latest Canada dataset curl -L "https://app.interline.io/transitland_datasets/download_latest?geography=CA&dataset_type=stops-routes-with-schedule&api_token=YOUR_API_TOKEN" -o ca-dataset.zip # Download specific dataset by ID curl -L "https://app.interline.io/transitland_datasets/22/download?api_token=YOUR_API_TOKEN" -o specific-dataset.zip ``` -------------------------------- ### Get Departures for a Stop Source: https://www.transit.land/documentation/rest-api/departures Retrieves a list of upcoming departures from a specified stop. This can be filtered by date and time to get specific departure schedules. If no feed version is specified, it defaults to active feed versions. ```APIDOC ## GET /stops/{stop_id}/departures ### Description Retrieves a list of upcoming departures from a specified stop. This can be filtered by date and time to get specific departure schedules. If no feed version is specified, it defaults to active feed versions. ### Method GET ### Endpoint /stops/{stop_id}/departures ### Parameters #### Query Parameters - **date** (string) - Optional - The GTFS service date for which to retrieve departures. Example: `2019-11-15` - **time** (string) - Optional - The time of day for which to retrieve departures. Example: `15:21:04` - **feed_version** (string) - Optional - Specifies a particular feed version to query departures from. ### Response #### Success Response (200) - **departures** (array: StopTime) - An array of departure objects, each containing details about a scheduled departure. - **stop_sequence** (integer) - GTFS stop_times.stop_sequence - **stop_headsign** (string) - GTFS stop_times.stop_headsign - **timepoint** (integer) - GTFS stop_times.timepoint - **pickup_type** (integer) - GTFS stop_times.pickup_type - **drop_off_type** (integer) - GTFS stop_times.drop_off_type - **continuous_pickup** (integer) - GTFS stop_times.continuous_pickup - **continuous_drop_off** (integer) - GTFS stop_times.continuous_drop_off - **interpolated** (integer) - Set if this arrival/departure time was interpolated during import - **arrival_time** (string) - GTFS stop_times.arrival_time. Example: `15:21:04` - **departure_time** (string) - GTFS stop_times.departure_time. Example: `15:21:04` - **shape_dist_traveled** (number) - GTFS stop_times.shape_dist_traveled - **schedule_relationship** (object: ScheduleRelationship) - A status flag for real-time information about this trip. - **service_date** (string) - If part of an arrival/departure query, the GTFS service date for this scheduled stop time. Example: `2019-11-15` - **date** (string) - If part of an arrival/departure query, the calendar date for this scheduled stop time. Example: `2019-11-15` - **arrival** (object: StopTimeEvent) - Detailed arrival information. - **departure** (object: StopTimeEvent) - Detailed departure information. - **trip** (object: Trip) - Trip associated with this stop time. ### Response Example ```json { "departures": [ { "stop_sequence": 1, "stop_headsign": "Downtown", "departure_time": "08:00:00", "trip": { "trip_id": "trip-123" } }, { "stop_sequence": 2, "stop_headsign": "Uptown", "departure_time": "08:15:00", "trip": { "trip_id": "trip-456" } } ] } ``` ``` -------------------------------- ### GET /api/v1/feeds/{feed_onestop_id} Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieve a specific feed by its Onestop ID. ```APIDOC ## GET /api/v1/feeds/{feed_onestop_id} ### Description Retrieve a specific feed by its Onestop ID. ### Method GET ### Endpoint /api/v1/feeds/{feed_onestop_id} #### Path Parameters - **feed_onestop_id** (string) - Required - The Onestop ID of the feed. ``` -------------------------------- ### OTP-Compatible Route Response Example Source: https://www.transit.land/documentation/routing-platform/transitland-routing-api This JSON object represents a typical response from the Transitland Routing API, detailing a planned route. It includes origin, destination, and itinerary information with various metrics like duration, distance, and timestamps. ```json { "plan": { "date": 1714719600000, // UNIX timestamp (milliseconds since the UNIX epoch) "from": { // the starting point "lat": 37.7757, "lon": -122.47996, "name": "Origin", "stopOnestopId": "" }, "to": { // the ending point "lat": 37.76845, "lon": -122.23508, "name": "Destination", "stopOnestopId": "" }, "itineraries": [ // each itinerary represents a different set of legs to travel from the origin to the destination { "duration": 5046, // duration of entire journey from origin to destination (in seconds) "distance": 25860.370696342565, // distance of entire journey from origin to destination (in meters) "startTime": 1714784876000, // UNIX timestamp departing origin (milliseconds since the UNIX epoch) "endTime": 1714789922000, // UNIX timestamp arriving at destination (milliseconds since the UNIX epoch) "walkTime": 676, // duration of portion of journey walking (in seconds) "walkDistance": 814.3349369408373, // distance of portion of journey walking (in meters) "transitTime": 3439, // duration of portion of journey on a transit vehicle (in seconds) "transitDistance": 25046.035759401726, // distance of portion of journey on a transit vehicle (in meters) "waitingTime": 931, // duration of portion of journey waiting for a transit vehicle (in seconds) "transfers": 2, // number of transfers between transit vehicles/routes "legs": [ // each leg represents a portion of the journey walking or on a transit vehicle/route { // the 1st leg represents walking to a transit stop "startTime": 1714784876000, // UNIX timestamp (milliseconds since the UNIX epoch) "endTime": 1714784996000, // UNIX timestamp (milliseconds since the UNIX epoch) "distance": 120.6845160365044, // meters "duration": 120, // seconds "mode": "WALK", // the travel mode of the leg "transitLeg": false, // is the travel mode a variety of transit? "from": { // the starting point of this leg "lat": 37.7757, "lon": -122.47996, "name": "", "departure": 1714784876000, // UNIX timestamp (milliseconds since the UNIX epoch) "stopOnestopId": "" }, "to": { // the ending point of this leg; in this case, boarding a bus "lat": 37.776429, "lon": -122.480273, "name": "Balboa St & 21st Ave", // name of the transit stop "departure": 1714784996000, // UNIX timestamp (milliseconds since the UNIX epoch) "stopId": "13048", // stop ID from the source feed (GTFS) "stopCode": "13048", // stop code as specified by the agency "stopOnestopId": "s-9q8yuuuxdu-balboast~21stave" // Onestop ID for the stop (for use in other Transitland APIs) }, "steps": [], "legGeometry": { "points": "caqeFvzpjV??@b@aDH???PLA??", // the geometric shape of this leg, in encoded polyline format. For more information about how to decode see https://developers.google.com/maps/documentation/utilities/polylinealgorithm "length": 8 } }, { "startTime": 1714784996000, "endTime": 1714786910000, "distance": 6333.086301709978, "duration": 1914, "mode": "BUS", "transitLeg": true, "from": { // stop to board the bus "lat": 37.776429, "lon": -122.480273, "name": "Balboa St & 21st Ave", "departure": 1714784996000, "stopId": "13048", "stopCode": "13048", "stopIndex": 14, "stopSequence": 14, "stopOnestopId": "s-9q8yuuuxdu-balboast~21stave" // Onestop ID for the stop (for use in other Transitland APIs) }, "to": { // stop to alight the bus "lat": 37.78427, "lon": -122.409402, "name": "Eddy St & Mason St", "departure": 1714786910000, "stopId": "14486", "stopCode": "14486", "stopIndex": 47, "stopSequence": 47, "stopOnestopId": "s-9q8yyw2jq4-eddyst~masonst" // Onestop ID for the stop (for use in other Transitland APIs) }, "steps": [], "intermediateStops": [ { "lat": 37.776528, "lon": -122.47813, "name": "Balboa St & 19th Ave", "arrival": 1714785056000, "departure": 1714785056000 } ] } ] } ] } } ``` -------------------------------- ### Issues - Get Specific Issue Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieves a specific issue by its ID. ```APIDOC ## GET /api/v1/issues/{issue_id} ### Description Retrieves a specific issue by its ID. ### Method GET ### Endpoint /api/v1/issues/{issue_id} ### Parameters #### Path Parameters - **issue_id** (integer) - Required - The ID of the issue. ``` -------------------------------- ### GET /api/v1/feed_versions/{feed_version_sha1} Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieve a specific feed version by its SHA1 hash. ```APIDOC ## GET /api/v1/feed_versions/{feed_version_sha1} ### Description Retrieve a specific feed version by its SHA1 hash. ### Method GET ### Endpoint /api/v1/feed_versions/{feed_version_sha1} #### Path Parameters - **feed_version_sha1** (string) - Required - The SHA1 hash of the feed version. ``` -------------------------------- ### Changeset Actions: CreateUpdate and Destroy Source: https://www.transit.land/documentation/datastore/changesets.html Illustrates a changeset payload with both 'createUpdate' and 'destroy' actions for stops, specifying their respective properties. ```json "changes": [ { "action": "createUpdate", "stop": { "onestopId": "s-9q8yt4b-1AvHoS", "name": "1st Ave. & Holloway Street" }, }, { "action": "destroy", "stop": { "onestopId": "s-9q8yt4b-2AvNo" } } ] ``` -------------------------------- ### GET /api/v1/feed_versions Source: https://www.transit.land/documentation/datastore/api-endpoints Filter feed versions based on feed Onestop ID. ```APIDOC ## GET /api/v1/feed_versions ### Description Filter feed versions based on feed Onestop ID. ### Method GET ### Endpoint /api/v1/feed_versions #### Query Parameters - **feed_onestop_id** (string) - Optional - Filter by one or more feed Onestop IDs, separated by commas. ``` -------------------------------- ### Create an empty changeset Source: https://www.transit.land/documentation/datastore/changesets.html Initiates a new changeset with optional notes. The response will contain a unique identifier for the changeset. ```APIDOC ## POST /api/v1/changesets ### Description Creates a new, empty changeset. You can provide notes to describe the purpose of the changeset. ### Method POST ### Endpoint /api/v1/changesets ### Parameters #### Request Body - **changeset** (object) - Required - An object containing changeset properties. - **notes** (string) - Optional - A description of the changes to be made in this changeset. ``` -------------------------------- ### GET /api/v1/feeds Source: https://www.transit.land/documentation/datastore/api-endpoints Find all feeds. Supports filtering by tags and bounding box. ```APIDOC ## GET /api/v1/feeds ### Description Find all feeds. Supports filtering by tags and bounding box. ### Method GET ### Endpoint /api/v1/feeds #### Query Parameters - **tag_key** (string) - Optional - Filter by tag key. - **tag_value** (string) - Optional - Filter by tag value. Used in conjunction with `tag_key`. - **bbox** (string) - Optional - Filter by a bounding box with southwest longitude, southwest latitude, northeast longitude, northeast latitude (separated by commas). ``` -------------------------------- ### GET /api/v1/feed_version_infos?type=FeedVersionInfoStatistics Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieves statistics for FeedVersionInfo entities based on the specified type. ```APIDOC ## GET /api/v1/feed_version_infos?type=FeedVersionInfoStatistics ### Description Retrieves statistics for FeedVersionInfo entities based on the specified type. ### Method GET ### Endpoint /api/v1/feed_version_infos ### Query Parameters - **type** (string) - Required - Specifies the type of statistics to retrieve, e.g., FeedVersionInfoStatistics. ``` -------------------------------- ### GET /api/v1/feed_version_imports/{import_id} Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieve a specific feed version import record by its ID. ```APIDOC ## GET /api/v1/feed_version_imports/{import_id} ### Description Retrieve a specific feed version import record by its ID. ### Method GET ### Endpoint /api/v1/feed_version_imports/{import_id} #### Path Parameters - **import_id** (integer) - Required - The ID of the feed version import record. ``` -------------------------------- ### Verify Changeset Application Source: https://www.transit.land/documentation/datastore/changesets.html Checks if a changeset can be applied cleanly to the database before actual application. ```bash POST /api/v1/changesets/143/check ``` -------------------------------- ### Changesets - Get Change Payloads Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieves the change payloads associated with a specific changeset. ```APIDOC ## GET /api/v1/changesets/{changeset_id}/change_payloads ### Description Retrieves the change payloads associated with a specific changeset. ### Method GET ### Endpoint /api/v1/changesets/{changeset_id}/change_payloads ### Parameters #### Path Parameters - **changeset_id** (integer) - Required - The ID of the changeset. ``` -------------------------------- ### Routes - List All Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieves a list of all routes. No parameters are required. ```APIDOC ## GET /api/v1/routes ### Description Retrieves a list of all routes. ### Method GET ### Endpoint /api/v1/routes ``` -------------------------------- ### Changesets - Get Specific Change Payload Source: https://www.transit.land/documentation/datastore/api-endpoints Retrieves a specific change payload within a changeset. ```APIDOC ## GET /api/v1/changesets/{changeset_id}/change_payloads/{payload_id} ### Description Retrieves a specific change payload within a changeset. ### Method GET ### Endpoint /api/v1/changesets/{changeset_id}/change_payloads/{payload_id} ### Parameters #### Path Parameters - **changeset_id** (integer) - Required - The ID of the changeset. - **payload_id** (integer) - Required - The ID of the change payload. ``` -------------------------------- ### Route (/route) Source: https://www.transit.land/documentation/routing-platform/valhalla Plans a turn-by-turn route between two or more specified locations. Supports both GET and POST requests. ```APIDOC ## Route (/route) ### Description Plans a turn-by-turn route between two or more locations. ### Method GET, POST ### Endpoint `https://transit.land/api/v2/routing/valhalla/route` ### Parameters #### Query Parameters (for GET requests) - **apikey** (string) - Required - Your API key. - **json** (object) - Required - A JSON string containing the request parameters. See Valhalla API documentation for full details. #### Request Body (for POST requests) - **Content-Type**: `application/json` - **apikey** (string) - Required - Your API key (can also be passed as a header). - **json** (object) - Required - The request parameters. See Valhalla API documentation for full details. ### Request Example (GET) ``` curl --get "https://transit.land/api/v2/routing/valhalla/route" \ -H "apikey: YOUR_API_KEY" \ --data-urlencode 'json={"locations":[{"lat":37.789,"lon":-122.401},{"lat":37.782,"lon":-122.447}],"costing":"bicycle"}' ``` ### Request Example (POST) ``` curl -X POST "https://transit.land/api/v2/routing/valhalla/route" \ -H "apikey: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"locations":[{"lat":37.789,"lon":-122.401},{"lat":37.782,"lon":-122.447}],"costing":"bicycle"}' ``` ### Response Refer to the Valhalla turn-by-turn API reference for detailed response formats. ``` -------------------------------- ### Map Matching (`/trace_route`) Source: https://www.transit.land/documentation/routing-platform/valhalla Matches a sequence of GPS coordinates to the road network and returns a route with turn-by-turn instructions. ```APIDOC ## POST /trace_route ### Description Matches a sequence of GPS coordinates to the road network and returns a route with turn-by-turn instructions. ### Method POST ### Endpoint /api/v2/routing/valhalla/trace_route ### Parameters #### Request Body - **shape** (array) - Required - An array of coordinate objects, each with 'lat' and 'lon'. - **costing** (string) - Required - The costing model to use (e.g., 'pedestrian'). - **shape_match** (string) - Required - The shape matching method (e.g., 'map_snap'). ### Request Example ```json { "shape": [{"lat":37.789,"lon":-122.401},{"lat":37.787,"lon":-122.408},{"lat":37.785,"lon":-122.415}], "costing": "pedestrian", "shape_match": "map_snap" } ``` ### Response #### Success Response (200) - **type** (string) - The GeoJSON type of the response. - **features** (array) - An array of GeoJSON features representing the route. - **properties** (object) - Properties of the route, including turn-by-turn instructions. ``` -------------------------------- ### Apply Changeset Source: https://www.transit.land/documentation/datastore/changesets.html Executes the changes defined in a changeset against the database. ```bash POST /api/v1/changesets/143/apply ```