Barcelona urban mobility API REST

The Barcelona Urban Mobility API is an application program interface that allows the developers of Barcelona to get access to all the mobility information of the city that is actually stored in the Barcelona and Generalitat open data websites. The aim of the API is to offer static data such as the bus and metro stations but also real-time data such as the time for the next bus on a specific bus shelter, the free bicing stations next to me or the traffic in the streets of Barcelona.

Technically the Barcelona Urban Mobility API is a REST API with GET methods described below that can send JSON or XML responses of the requests.

Resource URL examples

http://barcelonaapi.marcpous.com/[transport]/stations
http://barcelonaapi.marcpous.com/[transport]/station/id/[ID station]

Example Request

GET http://barcelonaapi.marcpous.com/bicing/stations.json

Example response

{"code":200, "data":{ "bici": [ {"id":"1", "name":"Gran Via Corts Catalanes, 760", "lat":"41.397952", "lon":"2.180042", "nearby_stations":"24,369,387,424"}, ...

Barcelona Urban mobility API

Bicing

Bus

Metro

Tram

Ferrocarrils de la Generalitat

Renfe

Parking

Traffic

Barcodes