To find vehicles, use the Vehicle Search API.
To find vehicles, make a GET
request to the following URL including the parameters described below.
GET /api/beta/vehicles?position=51.509865,-0.118092
Standard URL parameters:
position
- (required) The position to find vehicles near in the format lat,lng
radius
- (number: default 1000
) Number of metres around position
to search for vehiclescursor
- (string) Cursor string for getting subsequent pages of results (read more about cursors)limit
- (number: default 10
) Maximum number of vehicles to returnVehicle filters:
type
- (string) Vehicle type key - see the complete list of Vehicle TypesA successful Vehicle search request will result in the following response:
{
"query": "position=51.509865,-0.118092&limit=10&radius=1000",
"next_cursor": "def456",
"total": 10,
"vehicles": []
}
query
- (string) URL parameters describing the search querynext_cursor
- (string) Cursor string that should be passed into the next request to get the next page of results - read more about cursorstotal
- (int) Approximate total number of vehicles that have been foundvehicles
- (array) Array of the matching vehicles (see Vehicle search object)The Vehicle search object is a smaller version of the Vehicle object that contains enough information to make a decision about booking the vehicle.
{
"id": "UCxIHVmNsZaWZdICAgICACGRiAggtkZXVoaVzdGIFwcHgw",
"mtime": "2017-08-27T23:24:15.769+01:00",
"status": "available",
"position": {
"lat": 51.509865,
"lng": -0.118092
},
"type": "car-basic",
"year": 2018,
"functions": "passenger",
"passengers_max": 5,
"load_m3": 100,
"price_per_km": 2000,
"price_per_minute": 1000,
"make": "Beatle",
"image_url": "https://opentransport.com/path/to/vehicle-image.png"
}