{
"data": {
"origin": {
"name": "London",
"code": "urn:trainline:generic:loc:182gb"
},
"destination": {
"name": "Manchester Piccadilly",
"code": "urn:trainline:generic:loc:MAN2968gb"
},
"currency": "GBP",
"journey_type": "single",
"date_from": "2026-11-23",
"date_to": "2026-11-25",
"cheapest_price": 17.9,
"cheapest_date": "2026-11-25",
"days": [
{
"date": "2026-11-23",
"cheapest_price": 24.9,
"currency": "GBP",
"departures": [
"2026-11-23T19:19:00.000Z"
]
},
{
"date": "2026-11-24",
"cheapest_price": 19.9,
"currency": "GBP",
"departures": [
"2026-11-24T10:19:00.000Z"
]
}
]
},
"cached": false,
"source": "thetrainline:graphql",
"pagination": {
"total": 3,
"limit": 50,
"offset": 0,
"count": 3,
"has_more": false
}
}
curl --location --request GET 'https://zylalabs.com/api/15315/trainline+unofficial+data+api/40912/fares?from=london&to=manchester&date=2026-08-11&days=3¤cy=GBP&limit=50&offset=Optionalrefresh=false' --header 'Authorization: Bearer YOUR_API_KEY'
{
"data": {
"query": "london",
"locations": [
{
"name": "London",
"code": "urn:trainline:generic:loc:182gb",
"type": "stationGroup",
"country": "GB",
"subtitle": "Any"
},
{
"name": "London Euston",
"code": "urn:trainline:generic:loc:EUS1444gb",
"type": "station",
"country": "GB",
"subtitle": null
}
]
},
"cached": false,
"source": "thetrainline:locations-search",
"pagination": {
"total": 30,
"limit": 50,
"offset": 0,
"count": 30,
"has_more": false
}
}
curl --location --request GET 'https://zylalabs.com/api/15315/trainline+unofficial+data+api/40913/locations?q=london&limit=10&offset=Optionalrefresh=false' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 Trainline 非官方数据 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
Trainline 上任意两个车站之间的火车票价和出发时间
不 这是一个非官方 API 与 Trainline 没有任何关联 未经其认可或赞助 它返回的是 Trainline 上公开可见的数据♀♀♀♀
每个端点都返回 JSON。无法处理的请求会返回包含错误代码和消息的 JSON 正文】【。