API接口

From SimRail Wiki
Jump to navigation Jump to search

时刻表API

链接

目前可以访问如下网址:

https://staging.simrail.deadlykungfu.ninja/train/40684

可以通过将最后的车次更改查询其它列车。

API回复数据

一个示例:

[
  {
    "train_number": "40684",
    "scheduled_arrival_hour": null,
    "station": "Tychy Lodowisko",
    "layover": null,
    "scheduled_departure_hour": "17:26",
    "train_type": "ROJ",
    "line": "179",
    "cachedate": "2023-02-12T18:48:23.975Z",
    "stop_type": "ph",
    "hourSort": 0
  },
  {
    "train_number": "40684",
    "scheduled_arrival_hour": "17:27",
    "station": "Tychy Miasto",
    "layover": "0.0",
    "scheduled_departure_hour": "17:27",
    "train_type": "ROJ",
    "line": "179",
    "cachedate": "2023-02-12T18:48:24.000Z",
    "stop_type": null,
    "hourSort": 1727
  }
]

各部分说明

值类型 说明
train_number string 车次
scheduled_arrival_hour string / null 时刻表中到站时刻
station string 站名
layover string / null 时刻表中发车时刻
line string 列车当前所在线路的线路号
cachedate string 数据更新时间
stop_type string / null 停车类型,分为办客 ph 或者技停 pt
hourSort number 当前时刻,格式为:小时分钟(HHmm)。

调度时刻表

本API接口由官方EDR提供。

可搜索车站

目前仅提供如下几个车站ID: BZ LZ_LC SG_R52 爬虫索取,依此为本津、瓦基C信号楼、索斯诺维茨R52信号楼。

链接

https://staging.simrail.deadlykungfu.ninja/dispatch/BZ

API回复数据

[
  {
    "train_number": "14141",
    "train_type": "ECE",
    "type_speed": 0,
    "stop_type": null,
    "platform": " ",
    "arrival_time": "00:00",
    "departure_time": "00:00",
    "from_post": "Dąbrowa Górnicza",
    "to_post": "Sosnowiec Główny",
    "line": "1",
    "start_station": "Warszawa Grochów",
    "terminus_station": "Bohumin",
    "cachedate": "2023-02-12T18:08:32.837Z",
    "hourSort": 0
  },
  {
    "train_number": "41144",
    "train_type": "ECE",
    "type_speed": 0,
    "stop_type": null,
    "platform": " ",
    "arrival_time": "00:05",
    "departure_time": "00:05",
    "from_post": "Sosnowiec Główny",
    "to_post": "Dąbrowa Górnicza",
    "line": "1",
    "start_station": "Bohumin Vrbice",
    "terminus_station": "Warszawa Grochów",
    "cachedate": "2023-02-12T18:08:32.859Z",
    "hourSort": 5
  }
]

各部分说明

值类型 说明
train_number string 车次
train_type string 列车种类
type_speed number / undefined 最高速度
platform string 停靠站台,例如: I 1
arrival_time string 时刻表到站时间
departure_time string 时刻表发车时间
from_post string 上一站
to_post string 下一站
line string 当前线路号
start_station string 始发站
terminus_station string 终到站
cachedate string 上次数据更新时间
hourSort ǹumber 当前时刻

Steam资料卡

链接

https://staging.simrail.deadlykungfu.ninja/steam/<steam_id>

API接口回复

[
  {
    "avatar": "https://avatars.akamai.steamstatic.com/70845eef7475441ffc0c9f9685cf40a57df07e15.jpg",
    "pseudo": "Someone"
  }
]

其它API

服务器车次信息:http://docs.simrail.deadlykungfu.ninja/(作者:【法】DeadlyKungFu.Ninja)