### Navitia API - Getting Started Source: https://doc.navitia.io/index Initial steps for using the Navitia API, including an overview, first steps, and information about data and help. ```APIDOC Getting Started: Overview: https://doc.navitia.io/#overview First step: https://doc.navitia.io/#first-step Second step: https://doc.navitia.io/#second-step Third step: https://doc.navitia.io/#third-step Navitia for humans: https://doc.navitia.io/#navitia-for-humans Wrappers: https://doc.navitia.io/#wrappers About the data: https://doc.navitia.io/#about-data Getting help: https://doc.navitia.io/#getting-help ``` -------------------------------- ### Navitia Departures Request Example Source: https://doc.navitia.io/index Provides an example of a GET request to the Navitia API for departures. It demonstrates how to specify the coverage, physical mode, stop area, and date/time parameters, including the 'data_freshness' parameter which defaults to 'realtime'. ```APIDOC GET /v1/coverage//physical_modes//stop_areas//departures?from_datetime=&data_freshness=realtime # Parameters: # - : Identifier for the geographical coverage area. # - : The physical mode of transport (e.g., 'bus', 'train'). # - : The unique identifier for the stop area. # - from_datetime: The starting date and time for departure queries. # - data_freshness: Controls the freshness of the data ('realtime' or 'base_schedule'). Defaults to 'realtime'. ``` -------------------------------- ### Navitia API - Shell Examples Source: https://doc.navitia.io/index Examples of using Navitia API commands in a shell environment. ```shell # Example shell commands would go here if provided in the content. ``` -------------------------------- ### Navitia API Request Example for Journeys Source: https://doc.navitia.io/index This snippet shows an example of a GET request to the Navitia API's /journeys endpoint. It demonstrates how to specify origin, destination, and data freshness for real-time journey planning. ```APIDOC https://api.navitia.io/v1/coverage//journeys?from=&to=&data_freshness=realtime ``` -------------------------------- ### Navitia Playground Example - Coverage Source: https://doc.navitia.io/index An example of how to use the Navitia playground to explore the Coverage API, listing regions covered by Navitia. ```JavaScript console.log('Explore Navitia Coverage API: https://playground.navitia.io/play.html?request=https%3A%2F%2Fapi.navitia.io%2Fv1%2Fcoverage%2Fsandbox%2Flines&token=3b036afe-0110-4202-b9ed-99718476c2e0'); ``` -------------------------------- ### Navitia Playground Example - Isochrones Source: https://doc.navitia.io/index An example of how to use the Navitia playground to explore the Isochrones API, calculating reachable places within specified time boundaries. ```JavaScript console.log('Explore Navitia Isochrones API: https://playground.navitia.io/play.html?request=https%3A%2F%2Fapi.navitia.io%2Fv1%2Fcoverage%2Fsandbox%2Fisochrones%3Ffrom%3D2.377097%253B48.846905%26boundary_duration%255B%255D%3D600%26boundary_duration%255B%255D%3D1200%26boundary_duration%255B%255D%3D1800%26boundary_duration%255B%255D%3D2400%26boundary_duration%255B%255D%3D3000%26&token=3b036afe-0110-4202-b9ed-99718476c2e0'); ``` -------------------------------- ### Navitia API - Journeys Request Example Source: https://doc.navitia.io/index Provides an example of a request to the Navitia API for retrieving journey information. It specifies the origin, destination, and data freshness preference. ```http https://api.navitia.io/v1/coverage//journeys?from=&to=&data_freshness=realtime ``` -------------------------------- ### Example Request for Terminus Schedules Source: https://doc.navitia.io/index Example cURL command to fetch terminus schedules from the Navitia API for a specific line. ```curl #request $ curl 'https://api.navitia.io/v1/coverage/sandbox/lines/line:RAT:M1/terminus_schedules' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` -------------------------------- ### API Request with Authorization Token Source: https://doc.navitia.io/index Shows how to authenticate with the Navitia API using a provided token. This example requests data from the 'sandbox' coverage. ```bash $ curl 'https://api.navitia.io/v1/coverage/sandbox/' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` -------------------------------- ### Navitia Departures API Example Source: https://doc.navitia.io/index An example JSON response structure for the /departures endpoint, illustrating key fields like commercial_mode, direction, and stop_date_time. It highlights how realtime data is represented. ```json { "display_informations": { "code": "", "color": "000000", "commercial_mode": "TGV INOUI", "description": "", "direction": "Nice Ville (Nice)", "equipments": [], "headsign": "847520", "label": "Paris - Nice", "links": [], "name": "Paris - Nice", "network": "SNCF", "physical_mode": "Train grande vitesse", "text_color": "" }, "links": [ // ... 6 items ], "route": { // ... 9 items }, "stop_date_time": { "additional_informations": [], "arrival_date_time": "20190605T193200", "base_arrival_date_time": "20190605T193200", "base_departure_date_time": "20190605T193400", "stop_date_time": "realtime", "departure_date_time": "20190605T193400", "links": [] }, "stop_point": { // ... 11 items } } ``` -------------------------------- ### Navitia Isochrones API Request and Response Example Source: https://doc.navitia.io/index Demonstrates how to request isochrone data from the Navitia API using curl and shows a typical JSON response structure. The request specifies a starting point and maximum duration, and the response contains GeoJSON data for the isochrone. ```shell # Request curl 'https://api.navitia.io/v1/coverage/sandbox/isochrones?from=stop_area:RAT:SA:GDLYO&max_duration=3600' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' # Response HTTP/1.1 200 OK { "isochrones":[ { "geojson":{ "type":"MultiPolygon", "coordinates":[ [ [ [ 2.3186837324, 48.9324437042 ], [ 2.3187241561, 48.9324771012 ], [ 2.3190737256, 48.9327557777 ], ["..."], ["..."], ["..."] ] ] ] } } ] } ``` -------------------------------- ### Explore Navitia API with JavaScript Source: https://doc.navitia.io/index Demonstrates how to interact with the Navitia API using JavaScript, likely for dynamic web applications. This example is provided via a JSFiddle link for interactive testing. ```javascript // See JSFiddle for implementation details: // https://jsfiddle.net/kisiodigital/vLugkLgw/ ``` -------------------------------- ### Example 404 API Request and Response Source: https://doc.navitia.io/index Demonstrates a typical API request that results in a 404 error and the corresponding JSON response from the Navitia API. This example shows how to request stop areas and the structure of the error object returned. ```shell #request $ curl 'https://api.navitia.io/v1/coverage/sandbox/stop_areas/wrong-one' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' #response HTTP/1.1 404 OK { "error": { "id": "bad_filter", "message": "ptref : Filters: Unable to find object" } } ``` -------------------------------- ### Navitia API - Departures Request Example Source: https://doc.navitia.io/index This snippet shows an example of how to request departure information from the Navitia API. It specifies the endpoint, required parameters like coverage, physical mode, stop area, and optional parameters like from_datetime and data_freshness. ```APIDOC https://api.navitia.io/v1/coverage//physical_modes//stop_areas//departures?from_datetime=&data_freshness=realtime ``` -------------------------------- ### Basic API Request with Curl Source: https://doc.navitia.io/index Demonstrates how to make a basic request to the Navitia API using curl. This example shows the endpoint for the API root. ```bash $ curl 'https://api.navitia.io/v1/' ``` -------------------------------- ### Example Request for Stop Schedules Source: https://doc.navitia.io/index This example demonstrates how to request stop schedules using `curl`. It targets a specific line within a coverage region and includes an authorization token. ```curl $ curl 'https://api.navitia.io/v1/coverage/sandbox/lines/line:RAT:M1/stop_schedules' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` -------------------------------- ### Navitia API Request Example: Stop Schedules Source: https://doc.navitia.io/index Example of a request to the Navitia API for stop schedules, specifying coverage, physical mode, line, stop area, and a date range. Data freshness defaults to realtime. ```APIDOC GET https://api.navitia.io/v1/coverage//physical_modes//lines//stop_areas//stop_schedules?from_datetime=&data_freshness=realtime ``` -------------------------------- ### Navitia API Request Example (cURL) Source: https://doc.navitia.io/index Demonstrates a basic API request to the Navitia service using cURL to fetch departure information. It highlights the structure of a Navitia API query, including the root URL, path, endpoint, and parameters. ```bash $ curl 'https://api.navitia.io/v1/coverage/sandbox/stop_areas/stop_area%3ARAT%3ASA%3ABASTI/lines/line%3ARAT%3AM5/departures?count=4&depth=2&' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` -------------------------------- ### Navitia Stop Schedules API Request Example Source: https://doc.navitia.io/index Example URL for requesting stop schedules from the Navitia API. It shows how to specify coverage, physical mode, line, stop area, and datetime parameters, with 'realtime' data freshness. ```APIDOC https://api.navitia.io/v1/coverage//physical_modes//lines//stop_areas//stop_schedules?from_datetime=&data_freshness=realtime ``` -------------------------------- ### Navitia Terminus Schedules API Request Example Source: https://doc.navitia.io/index Example URL for requesting terminus schedules from the Navitia API. It shows the endpoint structure and parameters, noting that 'data_freshness' defaults to 'base_schedule' but can be set to 'realtime'. ```APIDOC https://api.navitia.io/v1/coverage//physical_modes//lines//stop_areas//terminus_schedules?from_datetime=&data_freshness=realtime ``` -------------------------------- ### Navitia.io API Authentication Examples Source: https://doc.navitia.io/index Demonstrates different ways to authenticate API requests to Navitia.io using cURL. It covers using the Authorization header, basic HTTP authentication with username and password (where the password is empty), and embedding credentials directly in the URL. ```shell curl 'https://api.navitia.io/v1/coverage' -H 'Authorization: YOUR_AUTH_TOKEN' ``` ```shell curl https://api.navitia.io/v1/coverage -u YOUR_AUTH_TOKEN: ``` ```shell curl https://YOUR_AUTH_TOKEN@api.navitia.io/v1/coverage ``` -------------------------------- ### Navitia API - Filtering and Exploration Source: https://doc.navitia.io/index Provides examples of API requests for exploring Navitia data, including filtering by codes and retrieving lists of public transport objects. ```APIDOC Navitia API Filtering and Exploration: 1. **Filtering by `stop_area.has_code`**: * Purpose: Retrieve stop areas that possess a specific code. * Format: `filter={collection_name}.has_code({code_type},{code_value})` * Examples: * `https://api.navitia.io/v1/coverage/fr-sw/stop_points?filter=stop_point.has_code(source,5852)` * `https://api.navitia.io/v1/coverage/fr-sw/stop_areas?filter=stop_area.has_code(gtfs_stop_code,1303)` * `https://api.navitia.io/v1/coverage/fr-sw/lines?filter=line.has_code(source,11821949021891619)` * Note: External IDs (non-Navitia IDs) may not be unique. 2. **Filtering by `line.code`**: * Purpose: Request Navitia objects (lines, routes) referencing a line with a specific code. * Examples: * `https://api.navitia.io/v1/coverage/fr-idf/lines?filter=line.code=4` * `https://api.navitia.io/v1/coverage/fr-idf/routes?filter=line.code="métro 347"` 3. **General Exploration Examples**: * Requesting physical modes: `$ curl 'https://api.navitia.io/v1/coverage/sandbox/physical_modes' -H 'Authorization: ...'` * Retrieving network lists: `https://api.navitia.io/v1/coverage/fr-idf/networks` * Retrieving physical mode lists: `https://api.navitia.io/v1/coverage/fr-idf/physical_modes` * Retrieving line lists: `https://api.navitia.io/v1/coverage/fr-idf/lines` * Retrieving line lists for a specific mode: `https://api.navitia.io/v1/coverage/fr-idf/physical_modes/physical_mode:Metro/lines` 4. **Autocomplete on Public Transport Objects (`/pt_objects`)**: * Purpose: Search public transport objects by name, acting as an autocomplete feature. * Endpoint: `/pt_objects` * Usage: `https://api.navitia.io/v1/coverage/sandbox/pt_objects?q={search_term}&type[]={object_type}` * Example Search: Find 'metro 4' lines or routes. * Request: `$ curl 'https://api.navitia.io/v1/coverage/sandbox/pt_objects?q=metro%204&type[]=line&type[]=route' -H 'Authorization: ...'` * Returned Object Types (sorted): network, commercial_mode, line, route, stop_area, stop_point. ``` -------------------------------- ### Navitia Stop Schedules API Response Example Source: https://doc.navitia.io/index An example JSON response structure for the /stop_schedules endpoint. It details the 'date_times' array, highlighting 'data_freshness' and 'date_time' fields, and their relation to 'base_date_time'. ```json { "additional_informations": null, "date_times": [ { // ... 5 items }, { "additional_informations": [], "base_date_time": "20190605T193400", "data_freshness": "realtime", "date_time": "20190605T193400", "links": [] }, { // ... 5 items } ], "display_informations": { // ... 9 items }, "first_datetime": { // ... 5 items }, "last_datetime": { // ... 5 items }, "links": [ // ... 4 items ], "route": { // ... 8 items }, "stop_point": { // ... 11 items } } ``` -------------------------------- ### Navitia API Endpoint Exploration Source: https://doc.navitia.io/index Provides a series of examples for exploring different aspects of the Navitia API, including coordinates, services, networks, PT objects (like metro lines), and nearby places. ```APIDOC Navitia API Exploration: 1. **Root Endpoint**: Access the base URL to discover available interactions. * URL: `https://api.navitia.io/v1/` * Description: Provides a `links` section detailing possible API interactions. 2. **Coverage Details**: Retrieve information about a specific coverage area. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}` * Example: `https://api.navitia.io/v1/coverage/fr-idf` * Description: Shows services available within the specified coverage, with links to further details. 3. **Networks within Coverage**: List all public transport networks operating in a given coverage. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/networks` * Example: `https://api.navitia.io/v1/coverage/fr-idf/networks` * Description: Returns a list of networks, each with an ID and name. 4. **Physical Modes by Network**: Find the physical modes (e.g., Metro, Bus) managed by a specific network. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/networks/{network_id}/physical_modes` * Example: `https://api.navitia.io/v1/coverage/fr-idf/networks/network:OIF:439/physical_modes` * Description: Lists the physical modes associated with the network. 5. **Lines by Physical Mode**: Retrieve lines belonging to a specific physical mode within a network. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/networks/{network_id}/physical_modes/{physical_mode_id}/lines` * Example: `https://api.navitia.io/v1/coverage/fr-idf/networks/network:OIF:439/physical_modes/physical_mode:Metro/lines` * Description: Returns a list of lines for the specified mode and network. 6. **Public Transport Objects by Query**: Search for public transport objects (lines, modes, etc.) using a query parameter. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/pt_objects?q={query}` * Example: `https://api.navitia.io/v1/coverage/fr-idf/pt_objects?q=metro` * Description: Filters PT objects based on the provided query string. 7. **Coordinates Lookup**: Get information about a location based on WGS 84 coordinates. * URL: `https://api.navitia.io/v1/coord/{longitude};{latitude}` * Example: `https://api.navitia.io/v1/coord/2.377310;48.847002` * Description: Provides details about the location, including address and coverage area. 8. **Nearby Places**: Find places (stations, points of interest) close to a given coordinate. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/coords/{longitude};{latitude}/places_nearby` * Example: `https://api.navitia.io/v1/coverage/fr-idf/coords/2.377310;48.847002/places_nearby` * Description: Returns a list of nearby places with their details. 9. **Nearby Lines**: Find public transport lines passing near a given coordinate. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/coords/{longitude};{latitude}/lines` * Example: `https://api.navitia.io/v1/coverage/fr-idf/coords/2.377310;48.847002/lines` * Description: Returns a list of lines that are close to the specified coordinates. 10. **Nearby Stop Schedules**: Get schedule information for stops near a given coordinate. * URL: `https://api.navitia.io/v1/coverage/{coverage_id}/coords/{longitude};{latitude}/stop_schedules` * Example: `https://api.navitia.io/v1/coverage/fr-idf/coords/2.377310;48.847002/stop_schedules` * Description: Provides upcoming departures from stops near the specified coordinates. 11. **Templated Line Request**: Fetch lines for a specific region using a templated URL. * URL Pattern: `https://api.navitia.io/v1/coverage/{regions.id}/lines` * Example Usage: `https://api.navitia.io/v1/coverage/us-ny/lines` * Description: Requires a region ID (found in coverage responses) to be substituted into the URL to get lines for that region. ``` -------------------------------- ### Navitia API - Vehicle Journeys Request Example Source: https://doc.navitia.io/index Demonstrates a request to retrieve vehicle journeys from the Navitia API, specifying a time range and data freshness. ```http https://api.navitia.io/v1/coverage//vehicle_journeys?since=20191008T100000&until=20191008T200000&data_freshness=base_schedule ``` -------------------------------- ### Navitia API Departures Request and Response Example Source: https://doc.navitia.io/index This snippet demonstrates a typical curl request to the Navitia API for departures, along with a sample JSON response. It shows how to specify parameters like the line and departure time, and the structure of the returned departure information, including details about the route, stop point, and scheduled times. ```curl #Request $ curl 'https://api.navitia.io/v1/coverage/sandbox/lines/line:RAT:M1/departures?from_datetime=20160615T1337' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' #Response HTTP/1.1 200 OK { "departures":[ { "display_informations":{ "direction":"Ch\u00e2teau de Vincennes (Saint-Mand\u00e9)", "color":"F2C931", "physical_mode":"M?tro", "headsign":"Ch\u00e2teau de Vincennes", "commercial_mode":"Metro", "network":"RATP", "..." }, "stop_point":{ "name":"Esplanade de la D\u00e9fense", "physical_modes":[ { "name":"M?tro", "id":"physical_mode:Metro" } ], "coord":{ "lat":"48.887843", "lon":"2.250442" }, "label":"Esplanade de la D\u00e9fense (Puteaux)", "id":"stop_point:RAT:SP:ESDEN2", "..." }, "route":{ "id":"route:RAT:M1_R", "name":"Ch\u00e2teau de Vincennes - La D\u00e9fense", "..." }, "stop_date_time":{ "arrival_date_time":"20160615T133700", "departure_date_time":"20160615T133700", "base_arrival_date_time":"20160615T133700", "base_departure_date_time":"20160615T133700" } }, {"...":"..."}, {"...":"..."}, {"...":"..."} ] } ``` -------------------------------- ### Fetch Places Nearby using cURL Source: https://doc.navitia.io/index Example of how to use cURL to request places nearby from the Navitia API. This snippet demonstrates the request structure, including the endpoint URL and the necessary Authorization header. ```bash #request $ curl 'https://api.navitia.io/v1/coverage/sandbox/stop_areas/stop_area:RAT:SA:CAMPO/places_nearby' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' #response HTTP/1.1 200 OK { "places_nearby": [ { "embedded_type": "stop_point", "stop_point": {...}, "distance": "0", "quality": 0, "id": "stop_point:RAT:SP:CAMPO2", "name": "Campo-Formio (Paris)" }, .... } ``` -------------------------------- ### Get Coverage Information Source: https://doc.navitia.io/index Retrieves general information about the Navitia API's coverage, including production dates and status. This is a foundational call to understand the API's operational scope. ```shell $ curl 'https://api.navitia.io/v1/coverage' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` ```json { "start_production_date": "20140105", "status": "running", "shape": "POLYGON((-74.500997 40.344999,-74.500997 41.096999,-73.226 41.096999,-73.226 40.344999,-74.500997 40.344999))", "id": "sandbox", "end_production_date": "20140406" } ``` -------------------------------- ### Query Public Transportation Objects Source: https://doc.navitia.io/index Example of how to query for public transportation objects, such as metro lines, using the Navitia API with curl. This demonstrates fetching a collection of 'pt_objects' based on a query parameter. ```curl curl 'https://api.navitia.io/v1/coverage/sandbox/pt_objects?q=metro%201' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' ``` -------------------------------- ### Navitia API Paging Information and Navigation Source: https://doc.navitia.io/index Details how the Navitia API handles pagination for large result sets. It shows examples of 'pagination' objects containing counts and page numbers, as well as 'paging' links for navigating between pages (first, next, previous, last). ```bash #Retrieving lines collection $ curl 'https://api.navitia.io/v1/coverage/sandbox/lines' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' #You can find "paging" informations, as { "pagination": { "items_on_page": 25, "items_per_page": 25, "start_page": 1, "total_result": 1921, }, } #You can also find "paging" links, prebuilt in the link section { { "href": "https://api.navitia.io/v1/coverage/demo/lines?start_page=0", "templated": false, "type": "previous", }, { "href": "https://api.navitia.io/v1/coverage/demo/lines?start_page=2", "templated": false, "type": "next", }, { "href": "https://api.navitia.io/v1/coverage/demo/lines?start_page=76", "templated": false, "type": "last", }, { "href": "https://api.navitia.io/v1/coverage/demo/lines", "templated": false, "type": "first", } } The results are paginated to avoid too big response size. The parameters to get the next or previous page are within the `links` section of the result. Every Navitia response contains a paging object Key | Type | Description ---|---|--- items_per_page | int | Number of items per page items_on_page | int | Number of items on this page start_page | int | The page number total_result | int | Total number of items for this request You can navigate through a response using 2 parameters Parameter | Type | Description ---|---|--- start_page | int | The page number count | int | Number of items per page The number of objects returned for a request can **not be superior than 200**. If you request for more, Navitia will return the first 200, and you will have to paginate to get next 200. ``` -------------------------------- ### Navitia Interpreted Service Response Example Source: https://doc.navitia.io/index This JSON snippet illustrates how Navitia interprets and represents service data, including active periods, weekly patterns, and exceptions, as derived from GTFS calendar files. ```json { "calendars": [ { "active_periods": [ { "begin": "20200101", "end": "20200130" } ], "week_pattern": { "monday": false, "tuesday": false, "wednesday": false, "thursday": false, "friday": false, "saturday": true, "sunday": true }, "exceptions": [ { "type": "remove", "datetime": "20200127" } ] } ] } ``` -------------------------------- ### Navitia API - Disruption Impacted Stop Example Source: https://doc.navitia.io/index Illustrates the structure of an impacted stop within a disruption object in the Navitia API. It shows amended and base arrival/departure times, status, and cause of delay. ```json { "amended_arrival_time": "194700", "amended_departure_time": "194900", "arrival_status": "delayed", "base_arrival_time": "193200", "base_departure_time": "193400", "cause": "Panne d'un aiguillage", "departure_status": "delayed", "stop_point": { "type": "stop_point", "label": "Paris Gare de Lyon", "coord": { "type": "Point", "coordinates": [ 2.372523, 48.844043 ] }, "admin_uri": "", "uri": "/stop_points/700010001", "name": "Paris Gare de Lyon", "commercial_mode": { "type": "CommercialMode", "id": "1", "name": "Train" }, "physical_modes": [ { "type": "PhysicalMode", "id": "rail", "name": "Rail" } ], "links": [ { "type": "Link", "rel": "self", "href": "/stop_points/700010001" }, { "type": "Link", "rel": "stop_area", "href": "/stop_areas/700010001" } ] }, "stop_time_effect": "delayed" } ``` -------------------------------- ### Navitia API Endpoints Overview Source: https://doc.navitia.io/index Lists the main API endpoints available in Navitia, including Coverage, Public Transportation Objects, Places, and PT_objects. Each link provides further details on the respective API. ```APIDOC Coverage: Description: List of the region covered by navitia. Link: https://doc.navitia.io/#coverage Public transportation objects: Description: List of the public transport objects of a region. Link: https://doc.navitia.io/#pt-ref Places: Description: Search for data using autocomplete input. Link: https://doc.navitia.io/#places PT_objects: Description: Search for data using autocomplete input. Link: https://doc.navitia.io/#pt-objects ``` -------------------------------- ### Navitia Wrappers Source: https://doc.navitia.io/index Lists available wrappers for interacting with the Navitia API in different programming languages and frameworks, facilitating easier integration into projects. ```APIDOC Wrappers: - PHP5: https://github.com/hove-io/NavitiaComponent - Python: https://github.com/leonardbinet/navitia_client ``` -------------------------------- ### Search Places by Name Prefix Source: https://doc.navitia.io/index Finds places whose names start with a given prefix. This API is suitable for autocompletion features. ```HTTP GET /v1/coverage/{coverage_id}/places?q={query} Example: GET https://api.navitia.io/v1/coverage/fr-idf/places?q=eiff ``` -------------------------------- ### Navitia API Response Example: Reduced Service Disruption Source: https://doc.navitia.io/index An extract from the /disruptions endpoint showing an impacted stop with 'arrival_status' and 'departure_status' set to 'deleted', indicating a reduced service. ```json { "arrival_status": "deleted", "cause": "", "departure_status": "deleted", "stop_point": {}, "stop_time_effect": "deleted" } ``` -------------------------------- ### Navitia API Structure Explanation Source: https://doc.navitia.io/index Explains the four main components of a Navitia API request: the root URL, the path for filtering, the endpoint for specifying the requested information, and parameters for additional details. This provides a foundational understanding for constructing API calls. ```APIDOC Navitia API Request Structure: 1. Root URL: The base address of the API server. Example: https://api.navitia.io/v1/ 2. Path: Filters the request by specifying the region, stop area, and line. Example: /coverage/sandbox/stop_areas/stop_area:RAT:SA:BASTI/lines/line:RAT:M5/ 3. Endpoint: Specifies the type of information requested (e.g., departures, journeys). Example: /departures? 4. Parameters: Additional details to refine the request. Example: ?count=4&depth=2& ``` -------------------------------- ### Navitia API Response Example: No Service Disruption Source: https://doc.navitia.io/index An extract from the /disruptions endpoint detailing an impacted trip with 'NO_SERVICE' severity. It includes application periods and details about the affected trip. ```json { "application_periods": [ { "begin": "20191210T183100", "end": "20191210T194459" } ], "impacted_objects": [ { "pt_object": { "embedded_type": "trip", "id": "OCE:BOA017534OCESNF-20191210", "name": "OCE:BOA017534OCESNF-20191210", "trip": {} } } ], "severity": { "effect": "NO_SERVICE", "name": "trip canceled" } } ``` -------------------------------- ### Navitia OpenAPI/Swagger Documentation Link Source: https://doc.navitia.io/index Links to the OpenAPI/Swagger documentation for the Navitia API, which provides a comprehensive reference for all available functions, endpoints, parameters, and data schemas. ```APIDOC OpenAPI/Swagger Documentation: https://api.navitia.io/v1/schema ``` -------------------------------- ### Navitia.io API Documentation Source: https://doc.navitia.io/index Provides details on key Navitia.io API functionalities, including Places for geographical data autocompletion and Journeys for computing multi-modal routes. It outlines the purpose of each API and provides links to interactive playgrounds. ```APIDOC Places API: Purpose: Autocomplete on geographical data to find departure and destination points from an input text. Usage: Used in conjunction with the Journeys API. Link: https://doc.navitia.io/#places Journeys API: Purpose: Compute multi-modal itineraries from point A to point B using various transport modes (bus, train, subway, bike, walking, car, etc.). Functionality: Returns a roadmap with specific instructions, including departure/arrival times, journey duration, transport modes, and walking distance. Usage Example (Navitia Playground): https://playground.navitia.io/play.html?request=https%3A%2F%2Fapi.navitia.io%2Fv1%2Fcoverage%2Fsandbox%2Fjourneys%3Ffrom%3D2.3749036%3B48.8467927%26to%3D2.2922926%3B48.8583736&token=YOUR_AUTH_TOKEN Link: https://doc.navitia.io/#journeys ``` -------------------------------- ### Navitia API Response Example: Impacted Stop Schedules Source: https://doc.navitia.io/index An extract of a stop_schedules object from the Navitia API response, highlighting an impacted schedule. It shows fields like 'base_date_time' and 'date_time', and links to disruptions. ```json { "additional_informations": null, "date_times": [ { "additional_informations": [], "base_date_time": "20190605T193400", "data_freshness": "realtime", "date_time": "20190605T194900", "links": [ { "id": "b59bdab8-3560-4cfe-8009-b0461f74c417", "internal": true, "rel": "disruptions", "templated": false, "type": "disruption" } ] } ], "display_informations": {}, "first_datetime": {}, "last_datetime": {}, "links": [], "route": {}, "stop_point": {} } ``` -------------------------------- ### Navitia API Playground Link Source: https://doc.navitia.io/index Provides a direct link to the Navitia Playground, which allows users to interactively build and test API requests. This is a valuable tool for understanding API functionality and exploring data. ```APIDOC Navitia Playground: https://playground.navitia.io/play.html?request=https%3A%2F%2Fapi.navitia.io%2Fv1%2Fcoverage%2Fsandbox%2Fstop_areas%2Fstop_area%253ARAT%253ASA%253ABASTI%2Flines%2Fline%253ARAT%253AM5%2Fdepartures%3Fcount%3D4%26depth%3D2%26&token=3b036afe-0110-4202-b9ed-99718476c2e0 ``` -------------------------------- ### Authentication Methods Source: https://doc.navitia.io/index Mentions that there are four ways to request Navitia, implying different authentication or access methods, but does not detail them. ```APIDOC Authentication: - 4 ways to request Navitia ``` -------------------------------- ### Fetching Coverage Information Source: https://doc.navitia.io/index Shows how to use the identified coverage region (e.g., 'sandbox') to query for available local mobility services within that specific coverage area. ```shell #request $ curl 'https://api.navitia.io/v1/coverage/sandbox' -H 'Authorization: 3b036afe-0110-4202-b9ed-99718476c2e0' #response HTTP/1.1 200 OK { "regions": [{ "status": "running", "start_production_date": "20160101", "end_production_date": "20160831", "id": "sandbox" }], "links": [ {"href": "https://api.navitia.io/v1/coverage/sandbox/coords"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/places"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/networks"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/physical_modes"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/companies"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/commercial_modes"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/lines"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/routes"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/stop_areas"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/stop_points"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/line_groups"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/connections"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/vehicle_journeys"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/poi_types"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/pois"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/disruptions"}, {"href": "https://api.navitia.io.io/v1/coverage/sandbox/datasets"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/line_groups"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/trips"}, {"href": "https://api.navitia.io/v1/coverage/sandbox/"} ] } ``` -------------------------------- ### Navitia API - Interface and Objects Source: https://doc.navitia.io/index Details on API interface elements like templated URLs, inner references, paging, and object attributes, as well as different types of data objects. ```APIDOC Interface: Templated URL: https://doc.navitia.io/#templated-url Inner references: https://doc.navitia.io/#inner-references Paging: https://doc.navitia.io/#paging Objects order: https://doc.navitia.io/#objects-order Objects attributes: https://doc.navitia.io/#objects-attributes Lifetime of id: https://doc.navitia.io/#lifetime-of-id Objects: Standard Objects: https://doc.navitia.io/#standard-objects Public transport objects: https://doc.navitia.io/#public-transport-objects Real time and disruption objects: https://doc.navitia.io/#real-time-and-disruption-objects Street network objects: https://doc.navitia.io/#street-network-objects Other objects: https://doc.navitia.io/#other-objects Special Parameters: https://doc.navitia.io/#special-parameters ```