Please note this version of the API is deprecated. You should use Search V3 instead. This version of the search will be deactivated at the end of 2020. In order to avoid interruption please migrate to the new version of the API before then.
The API gives access to carpool trips on BlaBlaCar. The results are identical to those obtained for a similar search on the associated website. Each trip result includes a "links" object to get more details on this specific trip and you should use them instead of trying to reconstruct them.
The base URL is:
https://public-api.blablacar.com
It's a REST API, available only with GET queries.
You can transmit you API KEY either with the `key` parameter, either as a query parameter or as an HTTP header:
- Using an API key:
https://public-api.blablacar.com/api/v2/trips?key=XXX&fn=Paris
- Using an HTTP header:
curl -H 'key: XXX' https://public-api.blablacar.com/api/v2/trips?fn=Paris
NB: for simplification, the following examples are given without authentication
How to redirect to Blablacar website?
Each trip result includes a "links" object to get more details on this specific trip.
There are 2 links that you could use:
- _front point to the same trip on the website
- _self point to the direct object on the API
links: { _self: "https://api.blablacar.com/api/v2/trips/1234567-neuilly-sur-seine-tille", _front: "https://www.blablacar.co.uk/trip-neuilly-sur-seine-tille-1234567", }
Most of the time, it's the _front link that you will need to redirect users to the BlaBlaCar's trip page, after the concatenation of your marketing/campaign code:
?comuto_cmkt=MARKETING_CODE&utm_campaign=CAMPAIGN&utm_medium=API&utm_source=SOURCE&utm_content=WHATYOUWANT
This page is deep-linked and the website will detect if it's a mobile device and if the BlaBlaCar's app is on the device. In such a case, the user will be redirected to the app.
Trip Search
Search for trips on BlaBlaCar’s database.
GET /api/v2/trips
Example: https://public-api.blablacar.com/api/v2/trips?fn=Paris
Query Parameters
Name | Type | Required | Description | Example |
---|---|---|---|---|
fn | String | Optional | From Name: the departure place name | Paris |
tn | String | Optional | To Name: the arrival place name | London |
locale | String | Required |
Available locales and their possible currencies are detailed here |
en_GB |
_format | String | Optional | "json" | json |
cur | String | Required |
Select the currency you want, depending on the requested locale. For example, with the "en_GB" locale, use GBP to get prices in British Pounds |
EUR |
fc | String | Optional |
From Coordinate, as: "float|float", will be prefered to the "fn" parameter if both are presents |
48.756%7C7.268 |
tc | String | Optional |
To Coordinate, as: "float|float", will be prefered to the "tn" parameter if both are presents |
48.756%7C7.268 |
db | String(date-time) | Optional | Date Begin, can mean one of the two following:
Format: "YYYY-MM-DD" or "YYYY-MM-DD HH:mm:ss" |
2019-09-05 |
de | String(date) | Optional | Date End: end of the range of the requested search
Format: "YYYY-MM-DD" or "YYYY-MM-DD HH:mm:ss" |
2019-09-07 |
hb | Integer | Optional |
Hour Begin: hour of the earliest departure time. must be >= 0 and < 24 |
7 |
he | Integer | Optional |
Hour End: hour of the latest departure time. must be > 0 and <= 24 and > hb |
14 |
page | Integer | Optional |
Number of the requested page of result, if there is more than 1 page |
1 |
seats | Integer | Optional | number of requested available seats | 1 |
photo | Boolean(integer) | Optional | Limit results to trips with or without driver pictures | 1 |
fields | String | Optional |
Limit the response to the mentioned fields of the return values |
links%2Cprice%2Cpermanent_id |
sort | String | Optional | Sorting parameter of the query. Possible values are:
|
trip_price |
order | String | Optional |
Order of the sorting. Only used in combination with “sort”. Possible values are:
|
desc |
limit | Integer | Optional |
Maximum number of results requested. May results in slower and bigger queries. Must be < 100 |
50 |
radius | Integer | Optional |
Maximum radius of the search, in km Default is 10% of the length of the trip |
10 |
radius_from | Integer | Optional |
Maximum radius of the search for the "from" element. If not specified and "radius" is set, it will use the "radius" value |
5 |
radius_to | Integer | Optional |
Maximum radius of the search for the "to" element. If not specified and "radius" is set, it will use the "radius" value |
15 |
aa | Boolean | Optional |
Automatic Approval booking mode only. When set to 1, it will only return trips in automatic approval |
1 |
blablalines | Integer | Optional |
Include blablalines results (for short trips, in France only) |
1 |
pmin | Integer | Optional |
Minimum price requested (pmax must also be set). This must be < pmax |
2 |
pmax | Integer | Optional |
Maximum price requested (pmin must also be set). This must be > pmax |
142 |
Responses
Name | Type | Comment |
---|---|---|
links | Object | Links related to the query |
pager | Object | Pagination detail on the number of results |
trips | Array of trip | Detail of the trips found which match the query |
top_trips | Array of trip | Selection of recommended trips |
facets | Object | Detail on the results set by properties |
distance | int | Distance in km of the requested axis |
duration | int | Default duration of the requested axis, |
recommended_price | int | Recommended price of the requested axis |
savings | int | Default savings possible on this axis |
The format of each response object is detailed here.
Click here to see a Json example
in case of errors, look at this article.