Trip.com Train Stations API Documentation Find train stations by name or list the hot stations of a country. Each station has a code, the name, the original name, a type, country, province, city code, coordinates, tags such as eurostar and child stations. The country filter is applied to the real country of each station. Use the codes with the Train Search and Train Price Calendar endpoints. China and Korea return few stations. A search without a match returns an empty list and costs nothing. Cost: 1 credit.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
This endpoint has no required query parameters.
3 optional filters available.
string
Optional
search or recommend. Defaults to search. recommend lists the hot stations of one country.
example
string
Optional
Station or city name, 2 to 100 characters. Required for mode=search. Example: london.
coffee shops
string
Optional
Two-letter country code, e.g. GB, FR, DE, IT, ES, JP. Results are filtered to this country. Required for mode=recommend.
US
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"mode": "search",
"query": "London",
"total": 1,
"country": "GB",
"stations": [
{
"code": "GB1601",
"name": "London Euston",
"tags": [],
"type": 1,
"city_id": "338",
"latitude": 51.5283763,
"city_code": "LON",
"longitude": -0.1345585,
"country_code": "GB",
"country_name": "United Kingdom",
"name_original": "London Euston",
"province_name": "London",
"flight_city_code": "LON",
"children_stations": []
}
]
},
"meta": {
"billable": true,
"endpoint_family": "train_stations"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A query parameter is missing or invalid. This response is not billable.
{
"errors": {
"query": [
"A search text is required, e.g. london."
]
},
"message": "The request validation failed"
}Unexpected Upstream Format
Trip.com answered with a format Scrappa does not know. This response is not billable.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "train_stations"
},
"error": {
"code": "PARSER_DRIFT",
"message": "Trip.com answered with an unexpected format. Please retry later."
},
"success": false
}Upstream Unavailable
Trip.com did not answer after one retry. This response is not billable. Retry later.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "train_stations"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "The Trip.com API is temporarily unavailable. Please retry."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.