### Discover Categories Endpoint Request Source: https://apidocs.emtmadrid.es/ Example of how to make a GET request to the discover categories endpoint. Ensure you include the 'accessToken' in the headers. ```http GET https://openapi.emtmadrid.es/v1/mobilitylabs/discover/categories/ ``` -------------------------------- ### Discover Collection Endpoint Request Source: https://apidocs.emtmadrid.es/ Example of how to make a GET request to retrieve details for a specific collection. Replace '' with the actual collection code. An 'accessToken' is required in the headers. ```http GET https://openapi.emtmadrid.es/v1/mobilitylabs/discover/collection// ``` -------------------------------- ### Device Registration Success Response Source: https://apidocs.emtmadrid.es/ This is an example of a successful response after registering a device. It confirms the operation and provides details of the registered device. ```json { "code": "00", "data": [ { "modelName": "VTR-L09", "os": { "version": "8.0", "type": "android", "compilationNumber": "4.4.23" }, "userId": "00000000-0000-0000-0000-000000000009", "modelNumber": "VTR-L09 8.0.0", "idDevice": "1429b60656c0a723", "applicationId": "2705207F-D98E-444F-9ACF-5054CFBDFD5C", "notificationToken": "f1hAkQeiu8o:bPA91cFAeiard3A0YFxc1HCaUtrWxlFyqEiFDGyJdjdg79wRJq0QcrezrXGSnmojGfyUEC_ySq4Oaf5i6cLB5AnBtdMEIgz66VpYs4iCWV8NGoc2oQAtwRrXp6ls7zB6oRxobjpoaQsT", "manufacturer": "HUAWEY" } ], "description": "Device register OK", "datetime": "2019-04-01T06:51:01.366597" } ``` -------------------------------- ### Get API Status Source: https://apidocs.emtmadrid.es/ This webmethod returns the API and server status. ```APIDOC ## GET /v1/hello/ ### Description This webmethod returns the API and server status. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/hello/ ### Response #### Success Response (200) - **APIVersion** (object) - API version details. - **code** (string) - Status code. - **developerPortal** (string) - Link to the developer portal. - **instant** (string) - Timestamp of the response. - **message** (string) - Status message. - **morehelp** (string) - Link for more help. - **poweredBy** (string) - Information about the provider. - **versions** (array) - List of available API versions. #### Response Example ```json { "APIVersion": { "description": "OPENAPI for public access", "version": "00107" }, "code": "00", "developerPortal": "https://mobilitylabs.emtmadrid.es", "instant": "2019-10-01T16:52:31.664108", "message": "Hello, here openapi.emtmadrid.es, I am running Ok and I feel good", "morehelp": "https://gitlab.com/mobilitylabsmadrid", "poweredBy": "Empresa Municipal de Transportes de Madrid, S.A.", "versions": [ "v1", "build 06", "v2", "build 10" ] } ``` ``` -------------------------------- ### Discover Categories Success Response Source: https://apidocs.emtmadrid.es/ Example of a successful response when retrieving categories and subcategories. The 'data' array contains details for each category. ```json { "code": "00", "data": [ { "DS_CATEGORY": "TRANSPORT", "DS_PHOTO_CAT": null, "DS_SUBCATEGORY": "BUSEMTMAD", "CD_CATEGORY": 1, "DS_PHOTO_SUBCAT": "https://mobilitylabs.emtmadrid.es/fs/1/providers/emtPortal/images/subcatsubemtmad", "DS_URI": "https://openapi.emtmadrid.es/v1/transport/busemtmad/", "DS_DESCRIPTION_CAT": "TRANSPORT EMTMADRID DATA", "DS_DESCRIPTION_SUBCAT": "FOR GETTING DATA FROM MADRID EMT BUSES", "FC_CREATION": { "$date": 1535365773290 }, "CD_SUBCATEGORY": 4, "CD_DATA_TYPE": 1 } ], "description": "Data recovered OK, (lapsed: 378 millsecs)", "datetime": "2018-09-21T06:47:16.587652" } ``` -------------------------------- ### Validate Token Success Response Source: https://apidocs.emtmadrid.es/ Example of a successful response when validating a token, indicating the token is alive and valid. ```json { "code": "02", "description": "Token 984f85c9-86db-4066-8fb1-d791abd3a16e valid into control-cache", "datetime": "2019-10-02T07:10:37.541911", "data": [ { "_id": "984f85c9-86db-4066-8fb1-d791abd3a16e", "updatedAt": "2019-06-25T07:50:13.9030000", "createdAt": "2019-06-25T07:50:13.9030000", "userName": "youruser", "lastUpdate": { "$date": 1569993020894 }, "idUser": "2f104b08-f8bf-4199-a4bc-c6ecc42ad6ba", "tokenSecExpiration": 86400, "email": "yourmail@mail.com", "tokenDteExpiration": { "$date": 1570086620894 }, "flagAdvise": true, "apiCounter": { "current": 4, "dailyUse": 150000, "owner": 0, "licenceUse": "Please mention EMT Madrid MobilityLabs as data source. Thank you and enjoy!", "aboutUses": "Important announcement! On November 30, 2019, your permitted use of this API will be 20.000 hits. To increase up to 150,000 hits, please, register your App or Website in Mobilitylabs and use your own X-ClientId and X-ApiKey instead of generic login. It is free cost (more info in https://mobilitylabs.emtmadrid.es/doc/new-app and https://apidocs.emtmadrid.es/#api-Block_1_User_identity-login)" } } ] } ``` -------------------------------- ### Success Response 200 Example Source: https://apidocs.emtmadrid.es/ This JSON structure represents a successful API response, indicating data was recovered with a status of OK. ```json { "type":"Bus", "order":2 .... .... ], "description": "Data recovered OK, (lapsed: 971 millsecs)", "datetime": "2018-09-18T06:39:34.496482" } ``` -------------------------------- ### Get Allowed and Forbidden Zones Source: https://apidocs.emtmadrid.es/ This web method returns data regarding zones allowed and forbidden for cycling and parking with BiciMAD GO. ```APIDOC ## GET /transport/bicimadgo/zones/ ### Description Retrieves information about zones allowed and forbidden for BiciMAD GO cycling and parking. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/transport/bicimadgo/zones/ ### Header - **accessToken** (String) - Required - Current token generated from login ``` -------------------------------- ### Get Point of Interest Types Request Source: https://apidocs.emtmadrid.es/ Example of a GET request to retrieve the list of POI types. Requires 'cultureInfo' in the URL and an 'accessToken' in the header. ```http GET https://openapi.emtmadrid.es/v1/citymad/places/types// Header: accessToken: String ``` -------------------------------- ### Get Bus Line Timetable Source: https://apidocs.emtmadrid.es/ Retrieves the start and stop times for a specific EMT bus line. ```APIDOC ## GET /v1/transport/busemtmad/lines/{lineId}/timetable/ ### Description This web method returns the start and stop times for a given EMT line. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/transport/busemtmad/lines//timetable/ ### Headers #### Header - **accessToken** (String) - Required - Current token generated from login ### Success Response (200) - **code** (String) - Result of operation (00=OK) - **description** (String) - Description of success - **datetime** (String) - Instant of current operation in server side - **data** (Array) - Main structure of values (if operation did well or empty array) contains below: - **dateIni** (String) - Start of current planification - **dateEnd** (String) - End of current planification - **firstTimeServiceA** (String) - First time in reference date from A to B - **firstTimeServiceB** (String) - First time in reference date from B to A - **endTimeServiceA** (String) - Last time in reference date from A to B - **endTimeServiceB** (String) - Last time in reference date from B to A - **dayType** (String) - Related to line timetable and calendar - **line** (String) - idLine EMT ### Response Example ```json { "code": "00", "data": [ { "dateIni": "03/09/2018", "endTimeServiceB": "22/09/2018 5:30:00", "firstTimeServiceB": "21/09/2018 23:50:00", "dateEnd": "10/10/2018", "endTimeServiceA": "22/09/2018 5:50:00", "dayType": "V", "firstTimeServiceA": "21/09/2018 23:45:00", "line": "501" }, { "dateIni": "03/09/2018", "endTimeServiceB": "24/09/2018 5:50:00", "firstTimeServiceB": "23/09/2018 23:30:00", "dateEnd": "10/10/2018", "endTimeServiceA": "24/09/2018 5:10:00", "dayType": "FE", "firstTimeServiceA": "23/09/2018 23:55:00", "line": "501" } ], "description": "Data recovered OK, (lapsed: 971 millsecs)", "datetime": "2018-09-18T06:39:34.496482" } ``` ``` -------------------------------- ### Retrieve Datatypes Response Source: https://apidocs.emtmadrid.es/ Example response for successfully retrieving datatypes. The 'data' array lists available datatypes with their respective codes and descriptions. ```json { "code": "00", "data": [ { "CD_DATA_TYPE": 1, "DS_DATA_TYPE": "WEBSERVICE" }, { "CD_DATA_TYPE": 2, "DS_DATA_TYPE": "STATIC" }, { "CD_DATA_TYPE": 3, "DS_DATA_TYPE": "REACTIVE" } ], "description": "Data recovered OK, (lapsed: 40 millsecs)", "datetime": "2018-09-21T16:38:27.086406" } ``` -------------------------------- ### Get Stops Around Geographical Point API Request Source: https://apidocs.emtmadrid.es/ This is an example of a GET request to retrieve bus stops within a specified radius of a given geographical point. It requires longitude, latitude, and radius as parameters. ```http https://openapi.emtmadrid.es/v2/transport/busemtmad/stops/arroundxy//// ``` -------------------------------- ### User Login Source: https://apidocs.emtmadrid.es/ This webmethod allows creating a session into the API context. It supports Basic, Advanced, and Protected authentication methods. ```APIDOC ## GET /v?/mobilitylabs/user/login/ ### Description This webmethod allows create one session into API context. If you register your own apps into MobilityLabs portal you can use credentials in the context of this X-ClientId and X-Apikey, so, please, register those params for your proposal. You can use on three ways: Basic, Advanced, and Protected. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v?/mobilitylabs/user/login/ ### Parameters #### Header Parameters - **email** (String) - Email verified that user has registered using https://mobilitylabs.emtmadrid.es (mandatory if not put the X-ClientId and passKey params). - **password** (String) - Personal password (mandatory if not put the X-ClientId and passKey params). - **X-ApiKey** (String) - (deprecated, please, use passKey instead of) when email and password are inserted, if not input, MobilityLabs openapi is asumed. - **X-ClientId** (String) - Optional when email and password are inserted, MobilityLabs openapi is asumed. Mandatory when passKey is inserted. - **passKey** (String) - Optional. Mandatory if not exists email and password. ``` -------------------------------- ### Get Bus Line Timetable - EMT Madrid Source: https://apidocs.emtmadrid.es/ Retrieve the start and end times for a specific EMT bus line. Requires an access token in the header. ```json { "code": "00", "data": [ { "dateIni": "03/09/2018", "endTimeServiceB": "22/09/2018 5:30:00", "firstTimeServiceB": "21/09/2018 23:50:00", "dateEnd": "10/10/2018", "endTimeServiceA": "22/09/2018 5:50:00", "dayType": "V", "firstTimeServiceA": "21/09/2018 23:45:00", "line": "501" }, { "dateIni": "03/09/2018", "endTimeServiceB": "24/09/2018 5:50:00", "firstTimeServiceB": "23/09/2018 23:30:00", "dateEnd": "10/10/2018", "endTimeServiceA": "24/09/2018 5:10:00", "dayType": "FE", "firstTimeServiceA": "23/09/2018 23:55:00", "line": "501" } ], "description": "Data recovered OK, (lapsed: 971 millsecs)", "datetime": "2018-09-18T06:39:34.496482" } ``` -------------------------------- ### Discover Datatypes API Endpoint Source: https://apidocs.emtmadrid.es/ Example of the API endpoint to discover datatypes. This is used to understand the different types of data available through the API. ```bash https://openapi.emtmadrid.es/v1/mobilitylabs/discover/datatypes/ ``` -------------------------------- ### Discover Field Formats API Endpoint Source: https://apidocs.emtmadrid.es/ Example of the API endpoint to discover field formats. This is used to understand the various field formats available in the API. ```bash https://openapi.emtmadrid.es/v1/mobilitylabs/discover/fieldformats/ ``` -------------------------------- ### Get BiciMAD GO Bikes Availability Source: https://apidocs.emtmadrid.es/ Retrieve the availability of BiciMAD GO bikes. You can specify a bike number to get details for a single bike or use coordinates and a radius to find nearby bikes. Requires an accessToken header. ```json { "code": "00", "description": "1 bikes recovered", "datetime": "2020-09-30T09:09:44.581269", "data": [ { "bike_in_station": 0, "DeviceName": "0160", "qrcode": 4984, "porcBattery": 0, "geometry": { "type": "Point", "coordinates": [ -3.6075183, 40.4326883 ] }, "Address": ",,,,,", "lastUpdate": "2020-09-30T07:06:03.440000" } ] } ``` -------------------------------- ### Success Response Example (200 OK) Source: https://apidocs.emtmadrid.es/ This JSON object represents a successful API response, indicating that zones were recovered. It includes a status code, a descriptive message, the timestamp of the operation, and a data array containing details about the zones. ```json { "code": "00", "description": "5 zones recovered", "datetime": "2020-09-29T07:57:45.027703", "data": [ { "include": false, "name": "Parque del Capricho", "geometry": { "type": "Polygon", "coordinates": [ [ [ -3.60362, 40.45366 ], [ -3.60377, 40.45365 ], [ -3.60383, 40.45369 ], [ -3.60385, 40.45373 ], [ -3.60386, 40.45378 ], [ -3.60379, 40.45386 ], [ -3.60361, 40.45413 ], [ -3.60356, 40.45422 ], [ -3.60352, 40.45434 ], [ -3.60211, 40.45559 ], [ -3.60143, 40.4562 ], [ -3.60062, 40.45692 ], [ -3.60049, 40.45703 ], [ -3.60036, 40.45714 ], [ -3.60027, 40.45721 ], [ -3.60019, 40.45727 ], [ -3.60012, 40.45732 ], [ -3.60004, 40.45737 ], [ -3.59994, 40.45743 ], [ -3.59983, 40.45749 ], [ -3.59972, 40.45755 ], [ -3.59958, 40.45762 ], [ -3.59935, 40.45772 ], [ -3.59914, 40.45781 ], [ -3.59894, 40.4579 ], [ -3.59871, 40.458 ], [ -3.59847, 40.45811 ], [ -3.59802, 40.45832 ], [ -3.59749, 40.45857 ], [ -3.59728, 40.45866 ], [ -3.59723, 40.4586 ], [ -3.60362, 40.45366 ] ] ] } } ] } ``` -------------------------------- ### Get Bus Calendar Source: https://apidocs.emtmadrid.es/ Retrieves the EMT transport bus calendar for a specified date range. ```APIDOC ## GET /v1/transport/busemtmad/calendar/// ### Description This webmethod returns the EMT transport bus calendar. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/transport/busemtmad/calendar/// ### Headers - **accessToken** (String) - Required - Current token generated from login ### Parameters #### Path Parameters - **startdate** (String) - Required - Date start on YYYYMMDD formnat - **enddate** (String) - Required - Date end on YYYYMMDD format ### Success Response (200) - **code** (String) - Result of operation (00=OK) - **description** (String) - Description of success - **datetime** (String) - Instant of current operation in server side - **data** (Array) - Main structure of values (if operation did well or empty array) contains below: - **date** (String) - Calendar date - **strike** (String) - in this day or not (depending on this attribute, data planification could have change). - **dayType** (String) - (LA.- Working day, SA.- Saturday, FE.- Holly day ### Response Example ```json { "code": "00", "data": [ { "date": "01/01/2018 0:00:00", "strike": "N", "dayType": "FE" }, { "date": "02/01/2018 0:00:00", "strike": "N", "dayType": "LA" }, { "date": "03/01/2018 0:00:00", "strike": "N", "dayType": "LA" } ], "description": "Data recovered OK, (lapsed: 156 millsecs)", "datetime": "2018-09-24T07:14:43.076404" } ``` ``` -------------------------------- ### Login Success Response Source: https://apidocs.emtmadrid.es/ Example of a successful response after a user logs in. It includes user details, access token, and API usage information. ```json { "code": "00", "description": "Register user: yourusername with token: 3bd5855a-ed3d-41d5-8b4b-182726f86031 ", "datetime": "2019-10-01T16:35:39.521302", "data": [ { "updatedAt": "2019-05-08T07:23:40.7500000", "userName": "yourusername", "accessToken": "3bd5855a-ed3d-41d5-8b4b-182726f86031", "tokenSecExpiration": 984, "email": "yourmail@mail.com", "idUser": "2f104b08-f8bf-4199-a4bc-c6ecc42ad6ba", "apiCounter": { "current": 5, "dailyUse": 150000, "owner": 0, "licenceUse": "Please mention EMT Madrid MobilityLabs as data source. Thank you and enjoy!", "aboutUses": "Important announcement! On November 30, 2019, your permitted use of this API will be 20.000 hits. To increase up to 150,000 hits, please, register your App or Website in Mobilitylabs and use your own X-ClientId and X-ApiKey instead of generic login. It is free cost (more info in https://mobilitylabs.emtmadrid.es/doc/new-app and https://apidocs.emtmadrid.es/#api-Block_1_User_identity-login)" } } ] } ``` -------------------------------- ### Get Street Detail Source: https://apidocs.emtmadrid.es/ Retrieves street information from the Cartociudad database using a partial name and number. ```APIDOC ## GET /v1/citymad/places/streets/{partialname}/{number}/ ### Description This webmethod returns the first street found from Cartociudad database using a partial name and number. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/citymad/places/streets/{partialname}/{number}/ ### Headers #### Header * **accessToken** (String) - Current token generated from login ### Parameters #### Path Parameters * **partialname** (String) - String with a part or full name to find * **number** (String) - Number of street ### Success Response (200) * **code** (String) - Result of operation (00=OK) * **description** (String) - Description of success * **datetime** (String) - Instant of current operation in server side * **data** (Array) - Main structure of values (if operation did well or empty array) contains below: * **sourceName** (String) - Name of source data * **province** (String) - Province * **poblacion** (String) - City * **refCatastral** (String) - id of cadastre * **muni** (String) - City * **countryCode** (String) - Code of Country * **id** (String) - Unique id of data * **stateMsg** (String) - (Partial or exact match) * **tip_via** (String) - (name of via) * **postalCode** (String) - postalCode * **geom** (String) - (datapoint geo) in Cartociudad format * **lat** (String) - latitude * **lng** (String) - longitude * **type** (String) - class of direction * **portalNumber** (String) - Address number * **contactURL** (String) - url of Cartociudad ### Response Example ```json { "code": "00", "data": [ { "sourceName": "Streets from CARTOCIUDAD", "values": { "province": "Madrid", "poblacion": "Madrid", "refCatastral": null, "muni": "Madrid", "countryCode": "011", "id": "280790007456", "stateMsg": "Resultado exacto de la bĂşsqueda", "tip_via": "CALLE", "priority": 0, "postalCode": "28014", "state": 1, "geom": "POINT (-3.696580377168761 40.41844754169817)", "address": "ALCALA", "lat": 40.41844754169817, "lng": -3.696580377168761, "type": "portal", "portalNumber": 42 }, "contactURL": "www.cartociudad.es" ], "description": "Data recovered OK, (lapsed: 971 millsecs)", "datetime": "2018-09-18T06:39:34.496482" } ``` ``` -------------------------------- ### Register Device for Push Notifications Source: https://apidocs.emtmadrid.es/ Use this endpoint to register a device for receiving push notifications. Ensure you have a valid accessToken and provide all required device and application details. ```bash curl -X POST \ https://openapi.emtmadrid.es/v1/mobilitylabs/push/devices/register/ \ -H 'Content-Type: application/json' \ -H 'accessToken: eea06332-df69-482e-acaa-9b345e863d16' \ -d ' {"applicationId": "your mobilitylabs app id", "userId":"optional mobilitylabs user id","idDevice": "device id", "manufacturer": "HUAWEY", "modelName": "VTR-L09", "modelNumber": "VTR-L09 8.0.0", "notificationToken": "firebase notification token", "os": {"type": "android or ios", "version": "version number", "compilationNumber": "compilation number"} }' ``` -------------------------------- ### User Login Source: https://apidocs.emtmadrid.es/ This endpoint allows users to log in and obtain an access token for subsequent API calls. It requires email, password, and optionally API key and client ID. ```APIDOC ## POST /v1/mobilitylabs/user/login/ ### Description Allows users to log in and obtain an access token. ### Method POST ### Endpoint https://openapi.emtmadrid.es/v1/mobilitylabs/user/login/ ### Headers #### Header - **email** (String) - Required - User's email address. - **password** (String) - Required - User's password. - **X-ApiKey** (String) - Optional - API Key for authentication. - **X-ClientId** (String) - Optional - Client ID for identification. - **passKey** (String) - Optional - A specific key for the request. ### Request Example ```json { "code": "00", "description": "Register user: yourusername with token: 3bd5855a-ed3d-41d5-8b4b-182726f86031 ", "datetime": "2019-10-01T16:35:39.521302", "data": [ { "updatedAt": "2019-05-08T07:23:40.7500000", "userName": "yourusername", "accessToken": "3bd5855a-ed3d-41d5-8b4b-182726f86031", "tokenSecExpiration": 984, "email": "yourmail@mail.com", "idUser": "2f104b08-f8bf-4199-a4bc-c6ecc42ad6ba", "apiCounter": { "current": 5, "dailyUse": 150000, "owner": 0, "licenceUse": "Please mention EMT Madrid MobilityLabs as data source. Thank you and enjoy!", "aboutUses": "Important announcement! On November 30, 2019, your permitted use of this API will be 20.000 hits. To increase up to 150,000 hits, please, register your App or Website in Mobilitylabs and use your own X-ClientId and X-ApiKey instead of generic login. It is free cost (more info in https://mobilitylabs.emtmadrid.es/doc/new-app and https://apidocs.emtmadrid.es/#api-Block_1_User_identity-login)" } } ] } ``` ### Response #### Success Response (200) - **code** (String) - Result of operation (00=OK). - **description** (String) - Description of success. - **datetime** (String) - Instant of current operation in server side. - **data** (Array) - Structure of values (if operation did well or empty array). - **first_Position** (Object) - Only one item of data structure. - **userName** (String) - User ID registered. - **tokenSecExpiration** (Integer) - Seconds until token expired (auto-extend each the API is invoked). - **idUser** (String) - Code of user into Service Identity Provider. - **email** (String) - Email logged. - **accessToken** (String) - Token ID for use in each API call. - **updatedAt** (String) - Last updated of identity. - **apiCounter** (Object) - Counter and limit of daily API uses, also indicates if you are the owner (relation ship between idUser and xClientId) or not. ``` -------------------------------- ### Get List of BiciPARK Stations Source: https://apidocs.emtmadrid.es/ Retrieves a list of all BiciPARK bike stations, including their status and capacity. ```APIDOC ## GET https://openapi.emtmadrid.es/v1/transport/bicipark/stations/ ### Description This web method returns a list of BiciPARK bike stations. For recovering one station, insert the number of station param, example v1/transport/bicipark/stations/{idStation}/. For recovering stations around one point, insert the longitude/latitude and radius, example v1/transport/bicipark/stations/arroundxy/{longitude}/{latitude}/{radius}/ ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/transport/bicipark/stations/ ### Headers #### Header - **accessToken** (String) - Required - Current token generated from login ### Success Response (200) - **code** (String) - Result of operation (00=OK) - **description** (String) - Description of success - **datetime** (String) - Instant of current operation in server side - **data** (Array) - Main structure of array of values (if operation did well or empty array) contains below: - **stationId** (String) - Number of BiciPARK station - **stationName** (String) - Parking name - **address** (String) - Address - **city** (String) - Name of city - **zip_code** (String) - Zip code - **total_places** (String) - Number of slots for parking - **free_places** (String) - Availables - **reserved_places** (String) - Slots booking - **geometry** (Object) - Geoposition - **type** (String) - **coordinates** (Array) ### Request Example ```json { "code": "00", "description": "1 parkings recovered", "datetime": "2021-07-14T06:46:57.454919", "data": [ { "stationId": "74", "stationName": "EMT - Fuente de la Mora", "address": "Estación de Fuente de la Mora", "city": " Madrid", "zip_code": "28050", "total_places": 9, "free_places": 5, "reserved_places": 0, "geometry": { "type": "Point", "coordinates": [ -3.6630679, 40.4846838 ] } } ] } ``` ``` -------------------------------- ### Get All Active Lines Source: https://apidocs.emtmadrid.es/ Retrieves a list of all active EMT bus lines for a specified reference date. ```APIDOC ## GET /v2/transport/busemtmad/lines/info/{dateref}/ ### Description This web method returns the list of lines actives in the reference date. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v2/transport/busemtmad/lines/info// ### Headers #### Header - **accessToken** (String) - Current token generated from login ### Parameters #### Path Parameters - **dateref** (String) - date reference on YYYYMMDD format ### Response #### Success Response (200) (Response structure not detailed in the source text, but would typically include a list of lines.) ### Request Example ```json { "accessToken": "YOUR_ACCESS_TOKEN" } ``` ``` -------------------------------- ### Discover Sharing Types Source: https://apidocs.emtmadrid.es/ Fetches available sharing types. Requires an accessToken in the header. ```json { "code": "00", "data": [ { "IT_ACTIVE": true, "CD_SHARING_TYPE": 1, "DS_SHARING_TYPE": "PUBLIC" }, { "IT_ACTIVE": true, "CD_SHARING_TYPE": 2, "DS_SHARING_TYPE": "PRIVATE" }, { "IT_ACTIVE": true, "CD_SHARING_TYPE": 3, "DS_SHARING_TYPE": "SHARED" } ], "description": "Data recovered OK, (lapsed: 25 millsecs)", "datetime": "2018-09-21T16:54:45.309656" } ``` -------------------------------- ### Success Response Example Source: https://apidocs.emtmadrid.es/ This JSON object represents a successful API response (code 00) for retrieving data, including details about valuations, links, comments, and general collection attributes. It shows the structure of data returned for operations that complete successfully. ```json { "code": "00", "data": [ { "valuations": [], "links": [ { "CD_LINK_TYPE": 4, "DS_LINK": "info//", "DS_LINK_DESCRIPTION": "List of EMTMADRID lines on a refered date", "CD_LINK": 1 }, { "CD_LINK_TYPE": 4, "DS_LINK": "/info//", "DS_LINK_DESCRIPTION": "General Info of a EMTMADRID line on a refered date", "CD_LINK": 2 }, { "CD_LINK_TYPE": 4, "DS_LINK": "groups/", "DS_LINK_DESCRIPTION": "Groups of lines ", "CD_LINK": 3 }, { "CD_LINK_TYPE": 4, "DS_LINK": "/stops//", "DS_LINK_DESCRIPTION": "List of Stops bus from EMTMADRID for a specific line", "CD_LINK": 4 } ], "comments": [], "general": { "FS_STATIC": null, "DS_DESCRIPTION": "Servicios de EMTMADRID orientados a la información de Líneas y sus datos derivados", "DS_ROW_SEPARATOR": null, "NM_VERSION": 1, "DS_DATE_SEPARATOR": null, "CD_SHARING_TYPE": 1, "CD_REST_ACTION": 1, "COLLECTION": "busemtmad.lines", "IT_GEOGRPHIC_INFO": false, "CD_COLLECTION": "F0B6DA3B-E4DA-419B-B75C-C3146BE22E67", "DS_THOUSANDS_SEPARATOR": null, "FC_CREATION": { "$date": 1534173646050 }, "DS_FORMAT": null, "DS_COLLECTION": "Líneas de EMT", "CD_SUBCATEGORY": 2, "CD_DATA_TYPE": 1, "FC_UPDATE": { "$date": 1534173646050 }, "CD_COLLECTION_PARENT": null } } ], "description": "Data recovered OK, (lapsed: 28 millsecs)", "datetime": "2018-09-24T06:59:22.361654" } ``` -------------------------------- ### Get Line Information Source: https://apidocs.emtmadrid.es/ Retrieves detailed information for a specific EMT bus line on a given date. ```APIDOC ## GET /v1/transport/busemtmad/lines/{lineId}/info/{dateref}/ ### Description This web method returns the detail of one EMT line. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/transport/busemtmad/lines//info// ### Headers #### Header - **accessToken** (String) - Current token generated from login ### Parameters #### Path Parameters - **lineId** (String) - Line (or label) for getting data - **dateref** (String) - date reference on YYYYMMDD format ### Response #### Success Response (200) - **code** (String) - Result of operation (00=OK) - **description** (String) - Description of success - **datetime** (String) - Instant of current operation in server side - **data** (Array) - Main structure of values (if operation did well or empty array) contains below: - **dateRef** (String) - date reference of line data - **line** (Object) - Group of data - **nameA** (String) - Name of Header A - **nameB** (String) - Name of Header B - **label** (String) - Public line code - **timeTable** (Object) - Timetable of line in all typeDays ### Request Example ```json { "accessToken": "YOUR_ACCESS_TOKEN" } ``` ### Response Example ```json { "code": "00", "data": [ { "dateRef": "01/07/2018", "nameA": "CIRCULAR 1", "label": "C1", "timeTable": [ { "Direction2": { "MaximumFrequency": "30", "MinimunFrequency": "8", "FrequencyText": "De 07:00 a 23:30 -> Cada 8 - 30min./", "StopTime": "23:30", "StartTime": "07:00" }, "Direction1": { "MaximumFrequency": "30", "MinimunFrequency": "8", "FrequencyText": "De 07:00 a 23:00 -> Cada 8 - 30min./", "StopTime": "23:00", "StartTime": "07:00" }, "idDayType": "FESTIVO" }, { "Direction2": { "MaximumFrequency": "11", "MinimunFrequency": "4", "FrequencyText": "De 06:00 a 23:30 -> Cada 4 - 11min./", "StopTime": "23:30", "StartTime": "06:00" }, "Direction1": { "MaximumFrequency": "11", "MinimunFrequency": "4", "FrequencyText": "De 05:35 a 23:00 -> Cada 4 - 11min./", "StopTime": "23:00", "StartTime": "05:35" }, "idDayType": "LABORABLE" }, { "Direction2": { "MaximumFrequency": "14", "MinimunFrequency": "6", "FrequencyText": "De 06:00 a 23:30 -> Cada 6 - 14min./", "StopTime": "23:30", "StartTime": "06:00" }, "Direction1": { "MaximumFrequency": "14", "MinimunFrequency": "6", "FrequencyText": "De 05:35 a 23:00 -> Cada 6 - 14min./", "StopTime": "23:00", "StartTime": "05:35" }, "idDayType": "SABADO" } ], "nameB": "CIRCULAR 1", "line": "068" } ], "description": "Data recovered OK, (lapsed: 31493 millsecs)", "datetime": "2018-09-25T07:20:01.765757" } ``` ``` -------------------------------- ### Get Mobility Labs Data Source: https://apidocs.emtmadrid.es/ Retrieves data related to mobility labs. Requires an accessToken in the header. ```json { "code": "00", "data": [ { "CD_REST_TYPE": 1, "DS_REST_TYPE": "REQUEST" }, { "CD_REST_TYPE": 2, "DS_REST_TYPE": "RESPONSE" } ], "description": "Data recovered OK, (lapsed: 25 millsecs)", "datetime": "2018-09-21T16:51:32.257659" } ``` -------------------------------- ### Example JSON Response Structure Source: https://apidocs.emtmadrid.es/ This JSON structure represents a successful API response, detailing properties like stroke width, opacity, and fill for a cycling route. ```json { "stroke-width": 2, "stroke-opacity": 1, "fill": "#007FFF", "fill-opacity": 0.3 }, "type": "cycling" } ] } ``` -------------------------------- ### Get Point of Interest Types Source: https://apidocs.emtmadrid.es/ Retrieves a list of Point of Interest (POI) types integrated from Madrid Destino. ```APIDOC ## GET /v1/citymad/places/types// ### Description This webmethod returns the list of POIs types integrated from Madrid Destino. ### Method GET ### Endpoint https://openapi.emtmadrid.es/v1/citymad/places/types// ### Headers #### Header - **accessToken** (String) - Current token generated from login ``` -------------------------------- ### API and Server Status Response Source: https://apidocs.emtmadrid.es/ Example response structure for the API and server status check. It includes version information, operational status, and developer resources. ```json { "APIVersion": { "description": "OPENAPI for public access", "version": "00107" }, "code": "00", "developerPortal": "https://mobilitylabs.emtmadrid.es", "instant": "2019-10-01T16:52:31.664108", "message": "Hello, here openapi.emtmadrid.es, I am running Ok and I feel good", "morehelp": "https://gitlab.com/mobilitylabsmadrid", "poweredBy": "Empresa Municipal de Transportes de Madrid, S.A.", "versions": [ "v1", "build 06", "v2", "build 10" ] } ```