DOCS

读取单日导出文件

读取某日已生成的车次车底对应关系导出文件;开启 binary 模式时返回原始文本,否则返回 JSON 包裹结构。

返回 API 列表
get/api/v1/exports/daily/{date}
可匿名访问api.exports.daily.read

COST

扣费规则

每次请求按固定额度扣费,不随返回条数变化。

固定 50 点额度/次

实际扣费以响应头 x-api-cost 为准。

请求说明

参数

路径参数

datestring 必填

日期,格式为 YYYYMMDD。

示例:20260401

查询参数

formatcsv | jsonl

导出格式;留空时默认使用 csv。

示例:csv

binarytrue | false

当值为 true 时,接口直接返回原始导出文本和下载头,而不是 JSON 包裹结构。

示例:false

响应说明

状态码与响应格式

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": [
                    "date",
                    "format",
                    "total",
                    "content"
                ],
                "properties": {
                    "date": {
                        "type": "string",
                        "required": true
                    },
                    "format": {
                        "type": "csv | jsonl",
                        "required": true,
                        "enum": [
                            "csv",
                            "jsonl"
                        ]
                    },
                    "total": {
                        "type": "integer",
                        "required": true
                    },
                    "content": {
                        "type": "string",
                        "required": true
                    }
                }
            }
        },
        "error": {
            "type": "string",
            "required": true
        }
    }
}

示例响应

{
    "ok": true,
    "data": {
        "date": "20260321",
        "format": "csv",
        "total": 1245,
        "content": "trainCode,emuCode,startStation,endStation,startAt,endAt\\nC2724,CR400AF-C-2214,雄安,北京西,1774076820,1774091220"
    },
    "error": ""
}
text/csvstring

响应结构

{
    "type": "string"
}

示例响应

trainCode,emuCode,startStation,endStation,startAt,endAt
G1,CR400AF-2149,Beijing South,Shanghai Hongqiao,1741996800,1742019960
application/x-ndjsonstring

响应结构

{
    "type": "string"
}

示例响应

{"trainCode":"G1","emuCode":"CR400AF-2149","startStation":"Beijing South","endStation":"Shanghai Hongqiao","startAt":1741996800,"endAt":1742019960}
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": "format 必须是 csv 或 jsonl。",
    "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": "20250315.csv 尚未生成。",
    "error": "not_found"
}