⚠️ Search V3 - Error management

When using our API, you may encounter different types of errors which are detailed below.

Please note that the list of error formats given below is not exhaustive and may change in the future.

400 Bad Request

This error occurs when the given parameters are invalid. You can receive different error bodies from bad request errors.

Examples:

curl -i https://public-api.blablacar.com/api/v3/trips?key=MY_API_KEY&from_coordinate=52.843625&to_coordinate=55.5807419,36.823769&from_country=FR&to_country=FR&locale=en-GB&start_date_local=2020-03-10T20:00:00&currency=EUR
{
    "type": "malformed_request",
    "code": "coordinate.wrong_format",
    "context": {},
    "field": "from_coordinate"
}
curl -i https://public-api.blablacar.com/api/v3/trips?key=MY_API_KEY&from_country=INVALID&currency=INVALID&to_country=FR&locale=en-GB&start_date_local=2020-03-10T20:00:00&from_coordinate=52.843625,32.684018&to_coordinate=55.5807419,36.823769
[
    {
        "type": "malformed_request",
        "code": "constraint_valid_country_code",
        "context": {},
        "field": "from_country"
    },
    {
        "type": "malformed_request",
        "code": "constraint_valid_currency_code",
        "context": {},
        "field": "currency"
    }
]
curl -i https://public-api.blablacar.com/api/v3/trips?key=MY_API_KEY&radius=INVALID&to_country=FR&locale=en-GB&start_date_local=2020-03-10T20:00:00&to_coordinate=55.5807419,36.823769&from_country=FR&currency=EUR&from_coordinate=52.843625,32.684018
{
    "error": "bad_request",
    "error_description": ""
}

401 Unauthorized

This error may occur when no API key is given.

Example:

curl -i https://public-api.blablacar.com/api/v3/trips
HTTP/1.1 401 Unauthorized

403 Forbidden

This error may occur when the API key is wrong.

Example:

curl -i https://public-api.blablacar.com/api/v3/trips?key=invalid
HTTP/1.1 403 Forbidden

404 Not Found

This error may occur when the URL requested is invalid.

Example:

curl -i https://public-api.blablacar.com/invalid/search
{"message":"no Route matched with those values"}

429 Quota exceeded

There are quota limitations for each account.
The first tier is limited to 1000 queries/day (and 100 queries/hour).

You can check the remaining and consumed quota for your account in the HTTP response headers of API queries.

Example:

curl -i https://public-api.blablacar.com/api/v3/trips?key=MY_API_KEY
X-RateLimit-Limit-day: 1000
X-RateLimit-Remaining-day: 985
X-RateLimit-Limit-hour: 100
X-RateLimit-Remaining-hour: 97

500 Internal Server Error

{
    "error": "unexpected_error",
    "error_description": ""
}

 

Was this article helpful?
1 out of 2 found this helpful
Didn't find what you're looking for? Contact us