### Response Example for webGetLinesWithMLInfo Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetLinesWithMLInfo.rst Example JSON response structure for the webGetLinesWithMLInfo API endpoint, showing the data fields returned for each line. ```python [ { "ml_code":"9", "sdc_code":"86", "line_code":"815", "line_id":"021", "line_descr":"\u03a0\u039b\u0391\u03a4\u0395\u0399\u0391 \u039a\u0391\u039d\u0399\u0393\u0393\u039f\u03a3 - \u0393\u039a\u03a5\u0396\u0397", "line_descr_eng":"PLATEIA KANIGKOS - GKIZI" }, .... ] ``` -------------------------------- ### Install Requirements Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/README.md Command to install all necessary Python packages from a requirements file. ```shell pip install -r requirements.txt ``` -------------------------------- ### Get Lines and Routes for ML (BASH) Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/index.rst This BASH code snippet shows how to fetch lines and routes from the OASA Telematics API using 'curl' and process the output with 'jq'. It assumes 'curl' and 'jq' are installed and demonstrates retrieving the line description for a specific ML identifier. ```bash curl -s "telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9" | jq '.[].line_descr' ``` -------------------------------- ### Python Example: Fetching Lines and Routes Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getLinesAndRoutesForMl.rst Demonstrates how to make a request to the getLinesAndRoutesForMl API endpoint using Python and process the JSON response. This example shows the structure of the data returned for lines associated with a master line. ```python import requests # Define the API endpoint and parameters base_url = "http://telematics.oasa.gr/api/" params = { "act": "getLinesAndRoutesForMl", "p1": "163" # Example mlcode } # Make the GET request response = requests.get(base_url, params=params) # Check if the request was successful if response.status_code == 200: data = response.json() # Process the returned data for line_info in data: print(f"Line ID: {line_info['line_id']}, Description: {line_info['line_descr']}, Start: {line_info['afetiria']}, End: {line_info['terma']}") else: print(f"Error: {response.status_code}") print(response.text) ``` -------------------------------- ### Example Response for getDailyScheduleMobile Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getDailyScheduleMobile.rst An example of the JSON response structure returned by the getDailyScheduleMobile API endpoint, showing scheduled 'come' and 'go' times. ```python { "come": [ {"time": "05:00", "msg": null} ], "go": [ {"time": "05:00", "msg": null} ] } ``` -------------------------------- ### Example Response for getRoutesForLine Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getRoutesForLine.rst Example JSON response for the getRoutesForLine API endpoint, illustrating the structure of returned route data. ```python [ { "route_code":"2045", "route_id":"01", "route_descr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u0392\u039f\u03a5\u039b\u0391", "route_active":"1", "route_descr_eng":"PEIRAIAS - VOULA" }, { "route_code":"2046", "route_id":"02", "route_descr":"\u0392\u039f\u03a5\u039b\u0391 - \u03a0\u0395\u0399\u03a1\u0391\u0391\u03a3", "route_active":"1", "route_descr_eng":"VOULA - PEIRAIAS" } ] ``` -------------------------------- ### webGetLines API Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetLines.rst This is an example of the JSON response returned by the webGetLines API endpoint. It shows the structure and data format for a single bus line entry. ```python [ { "LineCode":"815", "LineID":"021", "LineDescr":"\u03a0\u039b\u0391\u03a4\u0395\u0399\u0391 \u039a\u0391\u039d\u0399\u0393\u0393\u039f\u03a3 - \u0393\u039a\u03a5\u0396H", "LineDescrEng":"PLATEIA KANIGKOS - GKIZI" }, .... ] ``` -------------------------------- ### Python Virtual Environment Setup Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/README.md Commands to create and activate a Python virtual environment for development. ```shell python -m venv venv ``` -------------------------------- ### Web Route Details Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webRouteDetails.rst Example JSON response structure for the webRouteDetails API endpoint, showing the coordinates and order for each stop on a route. ```python [ {"routed_x":"23.63272","routed_y":"37.93851","routed_order":"1"}, {"routed_x":"23.6326","routed_y":"37.93851","routed_order":"2"}, {"routed_x":"23.63233","routed_y":"37.93833","routed_order":"3"}, .... ] ``` -------------------------------- ### Example Bus Location Response Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getBusLocation.rst An example of the JSON response received from the getBusLocation API endpoint, showing the location data for buses on a specific route. ```python [ { "VEH_NO":"40860", "CS_DATE":"Jul 13 2016 11:05:32:000PM", "CS_LAT":"37.9018570", "CS_LNG":"23.7197450", "ROUTE_CODE":"2045" }, { "VEH_NO":"40875", "CS_DATE":"Jul 13 2016 11:05:36:000PM", "CS_LAT":"37.9364170", "CS_LNG":"23.6405150", "ROUTE_CODE":"2045" } ] ``` -------------------------------- ### getSchedLines Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getSchedLines.rst An example JSON response from the `getSchedLines` API endpoint, illustrating the structure of 'come' and 'go' schedules for a given bus line. ```python { "come":[ { "line_id":"11", "sde_code":"816784", "sdc_code":"93", "sds_code":"1292", "sde_aa":"7", "sde_line1":"1079", "sde_kp1":"0", "sde_start1":"1900-01-01 23:15:00", "sde_end1":"1900-01-02 00:00:00", "sde_line2":"1079", "sde_kp2":"0", "sde_start2":"1900-01-02 00:00:00", "sde_end2":"1900-01-02 00:45:00", "sde_sort":"980", "sde_descr2":null, "line_circle":"0", "line_descr":"\u0391\u039d\u03a9 \u03a0\u0391\u03a4\u0397\u03a3\u0399\u0391 - \u039d. \u03a0\u0391\u0393\u039a\u03a1\u0391\u03a4\u0399 - \u039d. \u0395\u039b\u0392\u0395\u03a4\u0399\u0391", "line_descr_eng":"ANO PATISIA - N. PAGKRATI - N. ELVETIA" },... ], "go":[ { "line_id":"11", "sde_code":"816763", "sdc_code":"93", "sds_code":"1290", "sde_aa":"13", "sde_line1":"1079", "sde_kp1":"0", "sde_start1":"1900-01-02 00:35:00", "sde_end1":"1900-01-02 01:20:00", "sde_line2":"1079", "sde_kp2":"0", "sde_start2":"1900-01-02 01:20:00", "sde_end2":"1900-01-02 02:05:00", "sde_sort":"1", "sde_descr1":null, "line_circle":"0", "line_descr":"\u0391\u039d\u03a9 \u03a0\u0391\u03a4\u0397\u03a3\u0399\u0391 - \u039d. \u03a0\u0391\u0393\u039a\u03a1\u0391\u03a4\u0399 - \u039d. \u0395\u039b\u0392\u0395\u03a4\u0399\u0391", "line_descr_eng":"ANO PATISIA - N. PAGKRATI - N. ELVETIA" },... ] } ``` -------------------------------- ### getMLName API Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getMLName.rst Example of the JSON response received from the getMLName API endpoint. It shows the structure with ml_descr and ml_descr_eng fields. ```python [ { "ml_descr":"ΠΕΙΡΑΙΑΣ - ΒΟΥΛΑ", "ml_descr_eng":null } ] ``` -------------------------------- ### webGetRoutes API Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetRoutes.rst Example JSON response from the webGetRoutes API endpoint, detailing the routes for a given line. Each object in the array represents a specific route with its associated codes, descriptions, and physical characteristics. ```python [ { "RouteCode":"2045", "LineCode":"962", "RouteDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u0392\u039f\u03a5\u039b\u0391", "RouteDescrEng":"PEIRAIAS - VOULA", "RouteType":"1", "RouteDistance":"22385.44" }, { "RouteCode":"2046", "LineCode":"962", "RouteDescr":"\u0392\u039f\u03a5\u039b\u0391 - \u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3", "RouteDescrEng":"VOULA - PEIRAIAS", "RouteType":"2", "RouteDistance":"22644.61" } ] ``` -------------------------------- ### webGetStops API Response Example Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetStops.rst This is an example of the JSON response returned by the webGetStops API endpoint. It includes an array of stop objects, each containing details like StopCode, StopID, descriptions, coordinates, and route order. ```python [ { "StopCode":"10183", "StopID":"25", "StopDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3", "StopDescrEng":"PEIRAIAS", "StopStreet":null, "StopStreetEng":null, "StopHeading":"93", "StopLat":"37.938246", "StopLng":"23.6320605", "RouteStopOrder":"1", "StopType":"0", "StopAmea":"0" }, .... ] ``` -------------------------------- ### Get Bus Location API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getBusLocation.rst Retrieves the location of buses for a specific route. Requires the 'routecode' parameter, which is the code for a particular route. The example shows the response for the route PIRAEUS-VOULA (routecode = 2045). ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getBusLocation&p1=routecode Parameters: - act: Specifies the action to perform, should be 'getBusLocation'. - p1: The route code for which to retrieve bus locations. Response: An array of objects, where each object represents a bus and contains: - VEH_NO: Vehicle number. - CS_DATE: Timestamp of the bus's current location. - CS_LAT: Latitude of the bus. - CS_LNG: Longitude of the bus. - ROUTE_CODE: The route code associated with the bus. ``` -------------------------------- ### webGetMasterLines API Response Structure Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetMasterLines.rst This is an example of the JSON response returned by the `webGetMasterLines` API endpoint. It details the structure and fields for master line data, including identifiers, descriptions, and line-specific codes. ```python [ { "ml_code":"9", "ml_descr":"\u039a\u0391\u039d\u0399\u0393\u0393\u039f\u03a3 - \u0393\u039a\u03a5\u0396\u0397", "ml_descr_eng":null, "ml_id":"021", "sdc_code":"54", "line_code":"1151", "is_complex":"2" } .... ] ``` -------------------------------- ### Sample Response for getClosestStops Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getClosestStops.rst This is a sample JSON response for the getClosestStops API endpoint, illustrating the structure and data format for the nearest bus stops. ```python [ { "StopCode":"400058","StopID":"400058","StopDescr":"\u0392\u0395\u039d\u0399\u0396\u0395\u039b\u039f\u03a5", "StopDescrEng":"VENIZELOY","StopStreet":"\u0393\u03a1.\u039b\u0391\u039c\u03a0\u03a1\u0391\u039a\u0397", "StopStreetEng":null,"StopHeading":"42","StopLat":"37.9432677","StopLng":"23.6520113", "distance":"0.001443313361679744" }, { "StopCode":"400036","StopID":"400036","StopDescr":"\u0392\u0395\u039d\u0399\u0396\u0395\u039b\u039f\u03a5", "StopDescrEng":"VENIZELOY","StopStreet":"\u0393\u03a1.\u039b\u0391\u039c\u03a0\u03a1\u0391\u039a\u0397", "StopStreetEng":null,"StopHeading":"42","StopLat":"37.9433851","StopLng":"23.6521018", "distance":"0.001541670123601801" }, ... ] ``` -------------------------------- ### API Endpoint for webGetLines Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetLines.rst This section details the API endpoint for retrieving all bus line information. It specifies the URL and the expected HTTP method (GET). ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=webGetLines Method: GET Description: Retrieves information about all bus lines. Parameters: act: "webGetLines" (required) Response: An array of objects, where each object represents a bus line with the following properties: LineCode: string - The unique software identifier for the bus line. LineID: string - The Unicode formatted line number. LineDescr: string - The Unicode formatted title of the line. LineDescrEng: string - The ASCII formatted title of the line. ``` -------------------------------- ### Get Lines and Routes for ML (Python) Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/index.rst This Python code snippet demonstrates how to use the 'requests' library to make a POST request to the OASA Telematics API to retrieve lines and routes for a given ML identifier. It shows how to send the request and parse the JSON response to extract the line description. ```python import requests response = requests.post("http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9") json_response = response.json() print(json_response[0]["line_descr"]) ``` -------------------------------- ### Get Route Details and Stops Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetRoutesDetailsAndStops.rst Fetches detailed information for a given route, including stop sequences and locations. Requires a `routecode` parameter to specify the route. The response includes `details` (coordinates and order) and `stops` (stop codes, descriptions, and geographical data). ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=webGetRoutesDetailsAndStops&p1=routecode Description: Returns the route details and specifically the stops, the order in which they appear, and their location. Requires a parameter that is the **routecode**, i.e., the code of a route. Parameters: - act: 'webGetRoutesDetailsAndStops' (fixed value) - p1 (routecode): The code of the route for which to retrieve details. Response: The response is a JSON object containing two main keys: - details: An array of objects, where each object represents a point on the route with 'routed_x' (longitude), 'routed_y' (latitude), and 'routed_order' (sequence number). - stops: An array of objects, where each object represents a bus stop with 'StopCode', 'StopID', 'StopDescr' (Greek description), 'StopDescrEng' (English description), 'StopStreet', 'StopStreetEng', 'StopHeading', 'StopLat' (latitude), 'StopLng' (longitude), 'RouteStopOrder' (sequence on the route), 'StopType', and 'StopAmea'. Example Usage: Calling the endpoint with routecode=2045 (for the route PEIRAIAS-VOULA) will return the details and stops for that specific route. ``` ```python { "details": [ {"routed_x":"23.63272","routed_y":"37.93851","routed_order":"1"}, {"routed_x":"23.6326","routed_y":"37.93851","routed_order":"2"}, .... ], "stops": [ { "StopCode":"10183","StopID":"25","StopDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3", "StopDescrEng":"PEIRAIAS","StopStreet":null,"StopStreetEng":null,"StopHeading":"93","StopLat":"37.938246", "StopLng":"23.6320605","RouteStopOrder":"1","StopType":"0","StopAmea":"0" }, { "StopCode":"400191","StopID":"400191","StopDescr":"\u039a\u039b\u0395\u0399\u03a3\u039f\u0392\u0397\u03a3", "StopDescrEng":"KLEISOVIS","StopStreet":"\u039a\u039b\u0395\u0399\u03a3\u039f\u0392\u0397\u03a3", "StopStreetEng":null,"StopHeading":"165","StopLat":"37.9361702","StopLng":"23.6328014", "RouteStopOrder":"2","StopType":"0","StopAmea":"0" }, .... ] } ``` -------------------------------- ### getDailySchedule API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getDailySchedule.rst This section details the `getDailySchedule` API endpoint. It requires a `lineCode` parameter to fetch the daily schedule times for a specific bus line, including 'come' and 'go' routes. The endpoint URL and an example response are provided. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getDailySchedule&line_code=lineCode Parameters: - line_code: The code of the bus line for which to retrieve the daily schedule. Response Example: (for http://telematics.oasa.gr/api/?act=getDailySchedule&line_code=1079) { "come": [ { "line_id": "218", "sdd_code": "15743899", "sdc_code": "54", "sds_code": "3285", "sdd_aa": "2", "sdd_line1": null, "sdd_kp1": "0", "sdd_start1": null, "sde_start1": null, "sde_end1": null, "sdd_line2": "1035", "sdd_kp2": "0", "sde_start2": "1900-01-01 05:00:00", "sde_end2": "1900-01-01 05:45:00", "sdd_sort": "1", "line_circle": "0", "line_descr": "ΠΕΙΡΑΙΑΣ - ΣΤ. ΔΑΦΝΗ", "line_descr_eng": "PEIRAIAS - ST. DAFNI", "remarks": null }, ... ], "go": [ { "line_id": "218", "sdd_code": "15743895", "sdc_code": "54", "sds_code": "3284", "sdd_aa": "2", "sdd_line1": "1035", "sdd_kp1": "0", "sdd_start1": "Jan 1 1900 05:00:00:000AM", "sde_start1": "1900-01-01 05:00:00", "sde_end1": "1900-01-01 05:50:00", "sdd_line2": "1035", "sdd_kp2": "0", "sde_start2": "1900-01-01 05:55:00", "sde_end2": "1900-01-01 06:44:00", "sdd_sort": "1", "line_circle": "0", "line_descr": "ΠΕΙΡΑΙΑΣ - ΣΤ. ΔΑΦΝΗ", "line_descr_eng": "PEIRAIAS - ST. DAFNI", "remarks": null }, ... ] } ``` -------------------------------- ### Get Lines and Routes for ML (PowerShell) Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/index.rst This PowerShell code snippet illustrates how to access the OASA Telematics API using 'Invoke-RestMethod'. It retrieves lines and routes for a specified ML identifier and directly accesses the 'line_descr' property from the JSON response. ```powershell (Invoke-RestMethod "http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=9").line_descr ``` -------------------------------- ### Get Lines and Routes by ML Code Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getLinesAndRoutesForMl.rst Retrieves all routes and lines associated with a given master line code (mlcode). This is useful for identifying all child routes belonging to a single master line, which may have different line IDs but share the same mlcode. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=mlcode Parameters: - act: The API action to perform, fixed to 'getLinesAndRoutesForMl'. - p1: The master line code (mlcode) to filter by. This identifier can be obtained by filtering bus numbers from the webGetLinesWithMLInfo action. Returns: A JSON array of objects, where each object represents a line/route and contains details such as: - afetiria: Starting point of the route (Greek). - afetiria_en: Starting point of the route (English). - line_code: The code for the specific line. - line_descr: Description of the line (Greek). - line_descr_eng: Description of the line (English). - line_id: The unique identifier for the line. - line_id_gr: The Greek unique identifier for the line. - sdc_code: A code related to the service. - terma: Ending point of the route (Greek). - terma_en: Ending point of the route (English). Example Usage: Request: http://telematics.oasa.gr/api/?act=getLinesAndRoutesForMl&p1=163 Response: [ { 'afetiria': 'ΑΝΩ ΝΕΑ ΣΜΥΡΝΗ ', 'afetiria_en': 'ANO NEA SMIRNI', 'line_code': '1030', 'line_descr': 'ΑΝΩ Ν. ΣΜΥΡΝΗ Α - ΣΤ. ΣΥΓΓΡΟΥ ΦΙΞ (ΚΥΚΛΙΚΗ)', 'line_descr_eng': 'ANO N. SMYRNI A - ST. SYGGROY FIX ', 'line_id': '137', 'line_id_gr': '137', 'sdc_code': '97', 'terma': 'ΑΝΩ ΝΕΑ ΣΜΥΡΝΗ ', 'terma_en': 'ANO NEA SMIRNI' }, { 'afetiria': 'ΑΝΩ ΝΕΑ ΣΜΥΡΝΗ ', 'afetiria_en': 'ANO NEA SMIRNI', 'line_code': '1031', 'line_descr': 'ΑΝΩ Ν. ΣΜΥΡΝΗ Β - ΣΤ. ΣΥΓΓΡΟΥ ΦΙΞ (ΚΥΚΛΙΚΗ)', 'line_descr_eng': 'ANO N. SMYRNI V - ST. SYGGROY FIX ', 'line_id': '136', 'line_id_gr': '136', 'sdc_code': '97', 'terma': 'ΑΝΩ ΝΕΑ ΣΜΥΡΝΗ ', 'terma_en': 'ANO NEA SMIRNI' } ] ``` -------------------------------- ### Get Daily Schedule Mobile API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getDailyScheduleMobile.rst Retrieves the daily schedule times (come and go) for a specific bus line in a simplified format as displayed in the mobile application. This is useful for displaying real-time bus arrival information. ```APIDOC Api Endpoint: http://telematics.oasa.gr/api/?act=getDailyScheduleMobile&line_code=line_code Parameters: act: Specifies the API action, should be 'getDailyScheduleMobile'. line_code: The unique identifier for the bus line (e.g., 1058 for A5 line). Response Format: The API returns a JSON object containing two arrays: 'come' and 'go'. Each object within these arrays represents a scheduled departure time and a message. Example Response: { "come": [ {"time": "05:00", "msg": null}, ... ], "go": [ {"time": "05:00", "msg": null}, ... ] } Related Endpoints: This endpoint is part of the OASA Telematics API for retrieving schedule information. ``` -------------------------------- ### Get Routes for Line Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getRoutesForLine.rst Retrieves the routes associated with a specific bus line. Requires the 'linecode' parameter, which can be obtained from webGetLines or webGetLinesWithMLInfo by filtering the bus number. The response includes route details such as route code, ID, description (in Greek and English), and active status. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getRoutesForLine&p1=linecode Parameters: - linecode: The unique code for the bus line. Response: An array of route objects, each containing: - route_code: The code of the route. - route_id: The ID of the route. - route_descr: The description of the route in Greek. - route_active: Indicates if the route is active ('1' for active). - route_descr_eng: The description of the route in English. ``` -------------------------------- ### Get Stop Arrivals API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getStopArrivals.rst This API endpoint retrieves real-time bus arrival information for a specified bus stop. It requires a 'stopcode' parameter to identify the bus stop. The response is a list of bus arrivals, each containing route code, vehicle code, and estimated arrival time in minutes. ```APIDOC Api Endpoint ------------ ``http://telematics.oasa.gr/api/?act=getStopArrivals&p1=stopcode`` Response -------- .. code-block:: python [ { "route_code":"2033", "veh_code":"50328", "btime2":"5" }, { "route_code":"2005", "veh_code":"20521", "btime2":"5" } ] ``` -------------------------------- ### Get Closest Stops API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getClosestStops.rst This API endpoint retrieves the nearest bus stops based on provided latitude (p1) and longitude (p2) coordinates. The response is a JSON array of stop objects, each containing details like StopCode, StopID, descriptions, coordinates, and distance. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getClosestStops&p1=x&p2=y Parameters: act: 'getClosestStops' (fixed value) p1: Latitude coordinate (x) p2: Longitude coordinate (y) Response: A JSON array of stop objects. Each object contains: - StopCode: The code of the stop. - StopID: The ID of the stop. - StopDescr: Description of the stop in Greek. - StopDescrEng: Description of the stop in English. - StopStreet: Street name in Greek. - StopStreetEng: Street name in English (can be null). - StopHeading: Heading information. - StopLat: Latitude of the stop. - StopLng: Longitude of the stop. - distance: The distance from the provided coordinates to the stop. ``` -------------------------------- ### Get Stop Name and Coordinates Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getStopNameAndXY.rst Retrieves the name and geographical coordinates (latitude and longitude) of a bus stop. Requires the 'stopcode' as a parameter, which can be obtained using the webGetStops function. The response includes the stop description in Greek and English, latitude, longitude, heading, and stop ID. ```APIDOC Api Endpoint: http://telematics.oasa.gr/api/?act=getStopNameAndXY&p1=stopcode Response: [ { "stop_descr":"ΗΣΑΠ Ν.ΦΑΛΗΡΟΥ", "stop_descr_matrix_eng":"ISAP.N.FALIROY", "stop_lat":"37.9445913", "stop_lng":"23.6671421", "stop_heading":"88", "stop_id":"400075" } ] ``` ```python [ { "stop_descr":"\u0397\u03a3\u0391\u03a0 \u039d.\u03a6\u0391\u039b\u0397\u03a1\u039f\u03a5", "stop_descr_matrix_eng":"ISAP.N.FALIROY", "stop_lat":"37.9445913", "stop_lng":"23.6671421", "stop_heading":"88", "stop_id":"400075" } ] ``` -------------------------------- ### Get Line Name API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getLineName.rst This API endpoint retrieves the name of a specific bus line. It requires the `linecode` as a parameter, which identifies the line. The response is a JSON array containing the line description in Greek and English. ```APIDOC http://telematics.oasa.gr/api/?act=getLineName&p1=linecode Parameters: - p1 (linecode): The code of the line for which to retrieve the name. This code can be obtained from other API calls like webGetLines. Response: A JSON array containing objects with line descriptions. Example: [ { "line_descr":"ΠΕΙΡΑΙΑΣ - ΒΟΥΛΑ", "line_descr_eng":"PEIRAIAS - VOYLA" } ] ``` ```python [ { "line_descr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u0392\u039f\u03a5\u039b\u0391", "line_descr_eng":"PEIRAIAS - VOYLA" } ] ``` -------------------------------- ### Build and View Documentation Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/README.md Commands to build the project documentation and instructions on how to view it. ```shell cd docs/ make html ``` ```shell Open the index.html located at docs/build/html ``` -------------------------------- ### Sample Response for webRoutesForStop Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webRoutesForStop.rst This is a sample JSON response from the `webRoutesForStop` API endpoint, illustrating the structure and data returned for a specific bus stop. ```python [ { "RouteCode":"1867", "LineCode":"851", "RouteDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u039d. \u03a3\u039c\u03a5\u03a1\u039d\u0397", "RouteDescrEng":"PEIRAIAS - NEA SMYRNI", "RouteType":"1", "RouteDistance":"22205.03", "LineID":"130", "LineDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u039d. \u03a3\u039c\u03a5\u03a1\u039d\u0397 (\u039a\u03a5\u039a\u039b\u0399\u039a\u0397)", "LineDescrEng":"PEIRAIAS - NEA SMIRNI", "MasterLineCode":"202" }, { "RouteCode":"1881", "LineCode":"871", "RouteDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u0391\u039d\u03a9 \u0393\u039b\u03a5\u03a6\u0391\u0394\u0391", "RouteDescrEng":"PEIRAIAS - ANO GLYFADA", "RouteType":"1", "RouteDistance":"21369.72", "LineID":"\u03921", "LineDescr":"\u03a0\u0395\u0399\u03a1\u0391\u0399\u0391\u03a3 - \u0391\u039d\u03a9 \u0393\u039b\u03a5\u03a6\u0391\u0394\u0391", "LineDescrEng":"PEIRAIAS - ANO GLYFADA", "MasterLineCode":"59" }, .... ] ``` -------------------------------- ### Clean Documentation Build Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/README.md Command to remove all generated documentation files. ```shell make clean ``` -------------------------------- ### API Endpoint: webGetLinesWithMLInfo Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetLinesWithMLInfo.rst Retrieves line information including ML and SDC codes. This endpoint is similar to webGetLines but includes two additional parameters: ml_code and sdc_code. ```APIDOC http://telematics.oasa.gr/api/?act=webGetLinesWithMLInfo Response Breakdown: - ml_code: Identifier related to the starting area. Possibly corresponds to MasterLine. - sdc_code: Identifier for the timetable followed by the line. Refer to getSchedLines and getScheduleDaysMasterLine. - Line_Code: The unique number defining the telematics software for each line. Used for all associations in the OASA database. Appears to be a URI. - line_ID: Unicode formatted string representing the line number. - line_descr: Unicode formatted string with the line title. - line_descr_eng: Same as line_descr but ASCII formatted. ``` -------------------------------- ### API Endpoint for webGetStops Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetStops.rst This section details the API endpoint for the webGetStops function. It specifies the URL structure and the required parameter 'routecode' to retrieve bus stops for a particular route. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=webGetStops&p1=routecode Parameters: - routecode: The code of the route for which to retrieve stops. Description: Returns the stops of a route. Requires the 'routecode' parameter, which is the code of a route. The example shows the first stop of the route PIRAEUS-VOULA (routecode = 2045). ``` -------------------------------- ### webGetLangs API Endpoint and Response Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetLangs.rst This snippet documents the webGetLangs API endpoint, which retrieves localization strings for the OASA web page. It shows the API endpoint URL and a sample JSON response structure, including fields for language ID, Greek text, and English text. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=webGetLangs Response: [ { "lang_id":"1", "el":"Πληροφορίες Γραμμής", "en":"Line Information" } .... ] Response Breakdown: * lang_id : The ID of the string * el : The string with Greek characters (unicode) * en : The string with English characters (ascii) ``` ```python [ { "lang_id":"1", "el":"\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u0393\u03c1\u03b1\u03bc\u03bc\u03ae\u03c2", "en":"Line Information" } .... ] ``` -------------------------------- ### Web Route Details API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webRouteDetails.rst Retrieves the details of a route, including the location and order of stops. Requires a 'routecode' parameter. Used for displaying routes on Google Maps. ```APIDOC http://telematics.oasa.gr/api/?act=webRouteDetails&p1=routecode Parameters: - act: Specifies the API action, set to 'webRouteDetails'. - p1: The routecode (e.g., 2045 for PEIRAIA-VOULA route). ``` -------------------------------- ### OASA Telematics API - webRoutesForStop Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webRoutesForStop.rst Retrieves route information for a given bus stop using its stop code. The stop code can be obtained from the `webGetStops` function. The response is a JSON array of route objects. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=webRoutesForStop&p1=stopcode Parameters: - act: 'webRoutesForStop' (fixed value) - p1: The stopcode (integer) of the bus stop. Response: A JSON array containing route details for the specified stop. Each object in the array includes: - RouteCode: Code of the route. - LineCode: Code of the line. - RouteDescr: Description of the route in Greek. - RouteDescrEng: Description of the route in English. - RouteType: Type of the route. - RouteDistance: Distance of the route. - LineID: ID of the line. - LineDescr: Description of the line in Greek. - LineDescrEng: Description of the line in English. - MasterLineCode: Master code of the line. Example Usage: To get routes for stop code 400075 (ΗΣΑΠ Ν.ΦΑΛΗΡΟΥ): http://telematics.oasa.gr/api/?act=webRoutesForStop&p1=400075 ``` -------------------------------- ### getPlaces API Endpoint Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/getPlaces.rst This section details the 'getPlaces' API endpoint. It specifies the URL structure, required parameters, and the expected response format. Currently, the endpoint is non-functional and always returns null. ```APIDOC API Endpoint: http://telematics.oasa.gr/api/?act=getPlaces&p1=catCode Parameters: act: Specifies the action to perform, set to 'getPlaces'. p1: Represents the category code for filtering places. Response: The API currently returns 'null' for this endpoint, indicating it is not yet implemented. Example Usage: GET http://telematics.oasa.gr/api/?act=getPlaces&p1=1 Note: This functionality is not yet implemented and will always return null. ``` -------------------------------- ### API Endpoint for Master Lines Source: https://github.com/gph03n1x/oasa-telematics-api-documentation/blob/master/docs/source/webGetMasterLines.rst This snippet shows the API endpoint URL to retrieve master line information. It is used to fetch data about all primary lines within the telematics system. ```APIDOC http://telematics.oasa.gr/api/?act=webGetMasterLines ```