Find stations and train locations by keyword.
Authentication and headers
| Header | Description |
|---|---|
Authorization | Bearer <secret_key>. Keep the secret on the server and never write it to client logs. |
X-Travelandz-Id | <public_key>:<profile_code>, where the persisted profile code has the form dp_<12 alphanumeric>. |
Content-Type | application/json for requests with a JSON body. |
Request
Query: keyword is required and cannot be empty. language is optional and accepts en, es, or zh.
Request Params Schema
keywordRequired search text; it cannot be empty.
languageSuccess response
Returns locations[] with id, name, country, country code, coordinates and language.
Response Body Schema
locationslocations[]idlocations[]namelocations[]countryCodelocations[]countrylocations[]latitudelocations[]longitudelocations[]languageErrors
400for validation or unknown fields.401or403for invalid API credentials.500 internal_communication_errororunknown_errorfor provider failures.
Usage notes
Use the returned location ids as origin and destination in journey searches.
cURL example
bash
curl --request GET \
--url "https://api.sandbox.travelandz.com/v1/trains/locations?keyword=Paris&language=en" \
--header "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
--header "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"