Search API

🎉  Getting Started

BlaBlaCar’s API allows to search for car sharing trips, just as the BlaBlaCar’s website does. The web service is based on REST and is available in the two formats XML and JSON.

-> Are you ready to develop awesome tools with our API?

Here are just a few quick tips to get you started:

Integration Tips

In order to access the BlaBlaCar's API, you need to register a developer account on this website. This will register you on our API gateway and create an access to test the API with a small quota. When you are ready to go to production and need a bigger quota, feel free to contact us.

Stay posted

We will only send planned maintenances, status and important evolutions on this awesome mailing list.

How to use the API?

This API gives access to trips search and trips details. To have more relevant results, you should make a precise query with a departure place, a departure arrival, and a date.

  • All search fields are optionnals but there need to be at least one place in order to retrieve results
  • You can use the "fn" / "tn" parameters to search for full-text place name, or the "fc" / "tc" parameters to search for coordinates. If both are present, the full-text name is ignored and the coordinates are privilegied
  • Use the "locale" parameter to have the configuration of the user that is making the query
  • The API will return several prices: price, price_with_commission, price_without_commission, commission. The price value is egal to either price_with_commission or price_without_commission, depending on the country (thus the locale)

Defaults values

  • In order to provide faster response, the API returns 10 results by default. You can change that from 0 to 100 with the "limit" parameter
  • All trips are returned by default, even full trips. You can change that with the "seats=1" parameter

How NOT to use the API?

  • As a realtime platform, seats availability may change very often and there might be new trips offered anytime. For this reason, you shouldn't cache the results you retrieve from the API, or for a very small time (10 min max). Also, caching may bypass the "locale" parameter which would result into not the best relevant experience for the user
  • For the same reason, you should not query the API, if it's not coming from a real user
  • There is no bulk query so you need to make 1 query for each user's request

Design

There is a Design Guideline page to help you to integrate our service to your app or website with the best consitent experience for users. You will find there images resources and logos.

Terms && Conditions

By using this service, you agree to our Terms and conditions. You can find our Privacy Policy in english on our uk website.

🆔  Authentication

You can find your generated keys on your dashboard. You can also generate more keys if you need.

To make queries, you will simply add the "key" parameter in your requests:

https://public-api.blablacar.com/api/v2/trips?key=YOUR_KEY

📰  Locales

Available locales and their associated currencies are:

Locale Default Currency Alternative Currency
de_AT "EUR"
pt_BR "EUR"
cs_CZ "CZK"
de_DE "EUR"
en_GB "GBP" "EUR"
es_ES "EUR"
fr_FR "EUR"
fr_BE "EUR"
hr_HR "HRK"
hu_HU "HUF"
en_IN "INR"
it_IT "EUR"
es_MX "MXN"
nl_NL "EUR"
nl_BE "EUR"
pl_PL "PLN"
pt_PT "EUR"
ro_RO "RON"
sr_Latn_RS "RSD"
ru_RU "RUB" "UAH"
sk_SK "EUR"
tr_TR "TRY"
uk_UA "UAH" "RUB"

if there is an alternative currency for the locale of the user, you may add the "cur" parameter to have results in a specific currency:

https://public-api.blablacar.com?locale=en_GB&cur=EUR

⚓  Follow the links

Each trip result include a "links" object to get more details on this specific trip.
There are 3 links that you could use:

  • _front point to the same trip on the website
  • _self point to the direct object on the API
  • _threads is a direct access to the messages asked to the driver, if any
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",
    _threads: "https://api.blablacar.com/api/v2/trips/1234567-neuilly-sur-seine-tille/threads"
}

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 deeplinked and the website will detect if it's a mobile device and if BlaBlaCar's app are on the device. In such a case, the user will be redirected to the apps.

⚠️  Errors

The API’s errors codes are the same as HTTP’s error codes. You may check with CURL requests, like below:

curl -i  https://public-api.blablacar.com/api/v2/trips 

There is no api key, so it fail with:

HTTP/1.1 401 Unauthorized

curl -i  https://public-api.blablacar.com/api/v2/trips?key=test

The api key is wrong and it returns:

HTTP/1.1 403 Forbidden

Possibles error codes:

400 Bad Request

Check the parameter of the query and their format

404 Not Found

in the case of a business error, you may receive a detailled error message like the following example:

{
  "error": {
    "code": "x",
    "developper-message": "trip.not_found",
    "message": "The ride you are looking for does not exist",
    "support-link": "https://www.blablacar.co.uk/contact"
  }
}

NB: in this case, the quota is still consummed as the query is considered valid

🚀  Switch To Production

When you are ready to go live, you need to contact us to sign a licence agreement, and to have access to a bigger quota. The basic quota is limited to 10.000 queries per day.

🆕  What's new?

Here are the recent changes on the API:

  • 2017-09-03: addition of 2 fields: "radius_from" and "radius_to"
  • 2017-05-15: removal of the "frequency" field on trips. All trips are now unique
  • 2017-03-06: addition of a "full_trips_count" attribute to show how many trips are already full
  • 2017-02-07: addition of a "_front" attribute into the global "links" object, that point to the same search on the website
  • 2017-31-01: β period is over! and dev.blablacar.com is officially launched! 🚀
  • 2016-11-24: No more ‘_name: “date” _’ parameter in the facet
  • 2016-10-22: Adding the "radius" query parameter
  • 2016-09-22: dev.blablacar.com is now live and opened in β! 🎉
  • 2016-09-09: Developer Portal is opened in α