COST
扣费规则
items 表示本次响应实际返回的记录条数,按记录数计算后再应用最低扣费。
按本页返回条数计费,0.10 额度/条,向上取整,最低扣费额度为 1
实际扣费以响应头 x-api-cost 为准;请求失败时也可能触发最低扣费。
请求说明
参数
路径参数
stationNamestring 必填
要查询的车站名,例如 北京南。
示例:北京南
查询参数
limitinteger
正整数分页大小;当请求值超过服务端配置上限时,服务端会自动截断。
示例:20
cursorstring
分页游标。
示例:1741996800:1024
响应说明
状态码与响应格式
200
指定车站的当日站内时刻表分页结果。
响应头
x-api-remainx-api-cost
application/jsonobject
响应结构
{
"type": "object",
"required": [
"ok",
"data",
"error"
],
"properties": {
"ok": {
"type": "boolean",
"required": true
},
"data": {
"type": "object",
"required": true,
"shape": {
"type": "object",
"required": [
"stationName",
"cursor",
"limit",
"nextCursor",
"items"
],
"properties": {
"stationName": {
"type": "string",
"required": true
},
"cursor": {
"type": "string",
"required": true
},
"limit": {
"type": "integer",
"required": true
},
"nextCursor": {
"type": "string | null",
"required": true
},
"items": {
"type": "array<object>",
"required": true,
"shape": {
"type": "array",
"items": {
"type": "object",
"required": [
"trainCode",
"allCodes",
"arriveAt",
"departAt",
"startStation",
"endStation",
"updatedAt",
"referenceModels"
],
"properties": {
"trainCode": {
"type": "string",
"required": true
},
"allCodes": {
"type": "array<string>",
"required": true,
"shape": {
"type": "array",
"items": {
"type": "string"
}
}
},
"arriveAt": {
"type": "integer | null",
"required": true
},
"departAt": {
"type": "integer | null",
"required": true
},
"startStation": {
"type": "string",
"required": true
},
"endStation": {
"type": "string",
"required": true
},
"updatedAt": {
"type": "integer | null",
"required": true
},
"referenceModels": {
"type": "array<object>",
"required": true,
"shape": {
"type": "array",
"items": {
"type": "object",
"required": [
"model",
"weightedShare"
],
"properties": {
"model": {
"type": "string",
"required": true
},
"weightedShare": {
"type": "number",
"description": "历史推断命中时为 0 到 1 的权重占比。",
"required": true
}
}
}
}
}
}
}
}
}
}
}
},
"error": {
"type": "string",
"required": true
}
}
}示例响应
{
"ok": true,
"data": {
"stationName": "北京南",
"cursor": "",
"limit": 1,
"nextCursor": "22440:1777673640:C2001:1:1777673640",
"items": [
{
"trainCode": "C2001",
"allCodes": [
"C2001"
],
"arriveAt": 1777673640,
"departAt": 1777673640,
"startStation": "北京南",
"endStation": "天津",
"updatedAt": 1776492498,
"referenceModels": [
{
"model": "CR400BF-S",
"weightedShare": 1
}
]
}
]
},
"error": ""
}400
路径参数或分页参数无效。
响应头
x-api-remainx-api-cost
application/jsonobject
响应结构
{
"type": "object",
"required": [
"ok",
"data",
"error"
],
"properties": {
"ok": {
"type": "boolean",
"required": true
},
"data": {
"type": "string",
"required": true
},
"error": {
"type": "string",
"required": true
}
}
}示例响应
{
"ok": false,
"data": "stationName 不能为空。",
"error": "invalid_param"
}404
指定车站暂无当日时刻表数据。
响应头
x-api-remainx-api-cost
application/jsonobject
响应结构
{
"type": "object",
"required": [
"ok",
"data",
"error"
],
"properties": {
"ok": {
"type": "boolean",
"required": true
},
"data": {
"type": "string",
"required": true
},
"error": {
"type": "string",
"required": true
}
}
}示例响应
{
"ok": false,
"data": "当前暂无该车站的时刻表。",
"error": "not_found"
}