Get Price Calendar
List current prices of specific train connections and route in a certain time period.
Request
Security
Calendar endpoints are part of the bookachoo B2B API, and have restricted access. Valid credentials can be used to authenticate via HTTP Basic Authentication, and must be passed in the Authorization request header.
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Credentials consist of a client_id and an access token, and should be used in a server-to-server
context.
Query parameters
| Name | Type | Description |
|---|---|---|
| from required | string | Location of departure |
| ||
| to required | string | Location of arrival |
| ||
| departure | enum | Part of the day to depart inOne of:morning, afternoon, evening, night |
| period | string | Time period to filter by (ISO-8601 Duration) |
Example: period=P1M | ||
| index_by | enum | Index list of search resultsOne of:day, month |
Responses
-
Successful response with list of offerings
Body
Property path Type Description days arraydays[].date stringDate in YYYY-MM-DDformat, pattern:/^\d{4}-\d{2}-\d{2}$/days[].offers arrayList of offers available on that date
days[].offers[].time stringTime of departure in 24-hour
hh:mmformatExample: "08:55"days[].offers[].price stringCurrent price in the corresponding travel class, pattern: /^\d+\.\d{2,4}$/Example: "24.99"days[].offers[].currency "EUR"days[].offers[].direct booleanWhether the offer is for a direct train connection
days[].offers[].trainNumbers string[]Line number(s) of the train(s) servicing the offered connection
Example: ["ICE-140"]days[].offers[].travelClass enumNormalized travel class the price applies to, one of: budget,standard,premiumExample
{ "days": [ { "date": "2025-01-01", "offers": [ { "currency": "EUR", "direct": false, "price": "15.00", "time": "09:30", "trainNumbers": [ "ABC-1234", "DEF-6789" ], "travelClass": "standard" }, { "currency": "EUR", "direct": true, "price": "35.00", "time": "12:00", "trainNumbers": [ "XYZ-9876" ], "travelClass": "premium" } ] }, { "date": "2025-01-02", "offers": [] } ] } -
Bad request due to invalid query parameters
Body
Property path Type Description error objecterror.description optional stringOptional longer explanation describing the error.
error.message stringConcise error message.
error.reason optional stringOptional underlying reason that caused the error to happen.
Example
{ "error": { "message": "Invalid query parameter", "description": "Failed to deserialize query string.", "reason": "index_by: unknown variant `week`, expected `day` or `month`" } } -
Unauthorized due to invalid or missing authentication token
Headers
Name Description WWW-Authenticate Required authentication method
Example: Basic realm="/calendar"; charset="UTF-8"Body
Property path Type Description error objecterror.description optional stringOptional longer explanation describing the error.
error.message stringConcise error message.
error.reason optional stringOptional underlying reason that caused the error to happen.
Example
WWW-Authenticate: Basic realm="/calendar"; charset="UTF-8"{ "error": { "message": "Authorization required", "description": "Price calendar endpoint is for authorized consumers only.", "reason": "Unable to find authentication token in request" } } -
Unknown origin
fromor destination locationtoBody
Property path Type Description error objecterror.description optional stringOptional longer explanation describing the error.
error.message stringConcise error message.
error.reason optional stringOptional underlying reason that caused the error to happen.
Example
{ "error": { "message": "Origin station not found", "description": "Unable to return price calendar due to unknown origin station." } }