Time for Vbus API wraps the WSDL service of Vitrasa for get the stops and the buses estimates in JSON format.
GET /stops
Example:
GET /stops
{
"stops": [
{
"number": 20,
"name": "Abade Juan de Bastos, (C.C.Freixo)",
"location": {
"lng": -8.74098135187851,
"lat": 42.1874372819504
}
},
{
"number": 40,
"name": "Abade Juan de Bastos, 48",
"location": {
"lng": -8.73182995565854,
"lat": 42.1913070501787
}
}
]
}
GET /stops?lat=<latitude>&lng=<longitude>
Example:
GET /stops?lat=42.2260892&lng=-8.7254259
{
"stops": [
{
"number": 14255,
"name": "Pintor Colmeiro 23",
"location": {
"lng": -8.72577877618138,
"lat": 42.2253189833775
},
"distance": 136.092
},
{
"number": 2450,
"name": "Barcelona,36",
"location": {
"lng": -8.72371600770132,
"lat": 42.2259534895588
},
"distance": 212.8333
}
]
}
GET /stops/<stop_number>
Example:
GET /stops/14255
{
"number": 14255,
"name": "Pintor Colmeiro 23",
"location": {
"lng": -8.72577877618138,
"lat": 42.2253189833775
}
}
GET /stops/<stop_number>/estimates
Example:
GET /stops/14255/estimates
{
"buses": [
{
"line": "16",
"minutes": 11,
"route": "HISPANIDAD - COIA"
}
]
}