Game API: Difference between revisions
(He traducido al español el texto original) Tag: Reverted |
No edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[File:Api pngegg.png|thumb|300x300pixel|API logo, source pngegg.com]] | [[File:Api pngegg.png|thumb|300x300pixel|API logo, source pngegg.com]]{{notranslate}} | ||
==API | == Train Timetable API == | ||
This API retrieves train schedules for the train number specified by the driver. | |||
=== | ===Source:=== | ||
Secret -for now- | |||
https://staging.simrail.deadlykungfu.ninja/train/40684 | https://staging.simrail.deadlykungfu.ninja/train/40684 | ||
=== | ===Response=== | ||
Will return an array of TrainTimetableRow | |||
[ | [ | ||
{ | { | ||
Line 33: | Line 33: | ||
} | } | ||
] | ] | ||
==== | ====TimeTableRow==== | ||
{| class="wikitable" | {| class="wikitable" | ||
! | !Field | ||
! | !Type | ||
! | !Description | ||
|- | |- | ||
| | |train_number | ||
|<code> | |<code>string</code> | ||
| | |The number of the train | ||
|- | |- | ||
|scheduled_arrival_hour | |scheduled_arrival_hour | ||
|<code> | |<code>string / null</code> | ||
| | |The time the train should arrive at the station | ||
|- | |- | ||
| | |station | ||
|<code> | |<code>string</code> | ||
| | |The station name | ||
|- | |- | ||
| | |layover | ||
|<code> | |<code>string / null</code> | ||
| | |Time in minutes of the layover if the train stops at this station | ||
|- | |- | ||
| | |line | ||
|<code> | |<code>string</code> | ||
| | |The line the train will be running at this station | ||
|- | |- | ||
|cachedate | |cachedate | ||
|<code> | |<code>string</code> | ||
| | |Time this data was updated for the last time | ||
|- | |- | ||
|stop_type | |stop_type | ||
|<code> | |<code>string / null</code> | ||
| | |If there is a stop at the station, the type of the layover. <code>ph</code> or <code>pt</code> | ||
|- | |- | ||
|hourSort | |hourSort | ||
|<code> | |<code>number</code> | ||
| | |Hour in HHmm format to help sorting the data or focus the current station | ||
|} | |} | ||
== | ==Dispatch station timetables== | ||
This API will return the timetable of the station post | |||
Source: Official EDR | |||
=== | ===Parameters=== | ||
One of the Post id: <code>BZ</code> <code>LZ_LC</code> <code>SG_R52</code> are the only ones supported during staging | |||
=== | ===Request=== | ||
https://staging.simrail.deadlykungfu.ninja/dispatch/BZ | https://staging.simrail.deadlykungfu.ninja/dispatch/BZ | ||
=== | ===Response=== | ||
The response will be an Array of StationTimetableRow | |||
''/!\ | ''/!\ The official EDR timetable has a bug where some departure times for trains differ of 1minute between dispatch and train data. This is not an API bug /!\'' | ||
[ | [ | ||
{ | { | ||
Line 118: | Line 118: | ||
] | ] | ||
====StationTimetableRow==== | ====StationTimetableRow==== | ||
Content of each elements of the array: | |||
{| class="wikitable" | {| class="wikitable" | ||
! | !Field | ||
! | !Type | ||
! | !Description | ||
|- | |- | ||
|train_number | |train_number | ||
|<code> | |<code>string</code> | ||
| | |The number of the train | ||
|- | |- | ||
|train_type | |train_type | ||
|<code> | |<code>string</code> | ||
| | |The type of the train | ||
|- | |- | ||
|type_speed | |type_speed | ||
|<code> | |<code>number / undefined</code> | ||
| | |The maximum speed for the train type, if we have such info | ||
|- | |- | ||
|platform | |platform | ||
|<code> | |<code>string</code> | ||
| | |The platform the train will stop. Example <code>I 1</code> | ||
|- | |- | ||
|arrival_time | |arrival_time | ||
|<code> | |<code>string</code> | ||
| | |Scheduled arrival time of the train | ||
|- | |- | ||
|departure_time | |departure_time | ||
|<code> | |<code>string</code> | ||
| | |Scheduled departure time of the train | ||
|- | |- | ||
|from_post | |from_post | ||
|<code> | |<code>string</code> | ||
| | |The station where the train comes from | ||
|- | |- | ||
|to_post | |to_post | ||
|<code> | |<code>string</code> | ||
| | |The station where the train goes | ||
|- | |- | ||
|line | |line | ||
|<code> | |<code>string</code> | ||
| | |The line the train needs to be sent to | ||
|- | |- | ||
|start_station | |start_station | ||
|<code> | |<code>string</code> | ||
| | |The starting station of the train | ||
|- | |- | ||
|terminus_station | |terminus_station | ||
|<code> | |<code>string</code> | ||
| | |The terminus station of the train | ||
|- | |- | ||
|cachedate | |cachedate | ||
|<code> | |<code>string</code> | ||
| | |The last time the data was updated from the source | ||
|- | |- | ||
|hourSort | |hourSort | ||
|<code> | |<code>ǹumber</code> | ||
| | |Internal sorting value, can also help to focus current row | ||
|} | |} | ||
== | ==Steam profiles== | ||
Returns the username and the avatarUrl of a given user without calling SimRail API and cached for a day | |||
=== | ===Request=== | ||
[https://staging.simrail.deadlykungfu.ninja/steam/%3Csteam_id%3E https://staging.simrail.deadlykungfu.ninja/steam/<steam_id>] | [https://staging.simrail.deadlykungfu.ninja/steam/%3Csteam_id%3E https://staging.simrail.deadlykungfu.ninja/steam/<steam_id>] | ||
=== | ===Response=== | ||
An array containing one object with the data | |||
[ | [ | ||
{ | { | ||
Line 188: | Line 188: | ||
} | } | ||
] | ] | ||
== | ==Train infos by server== | ||
n/a | n/a | ||
'' | ''Author: DeadlyKungFu.Ninja'' | ||
'' | ''Website: http://docs.simrail.deadlykungfu.ninja/'' |
Latest revision as of 14:55, 17 April 2023
This is the source page. This page is not allowed for translation. |
Train Timetable API
This API retrieves train schedules for the train number specified by the driver.
Source:
Secret -for now-
https://staging.simrail.deadlykungfu.ninja/train/40684
Response
Will return an array of TrainTimetableRow
[ { "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 } ]
TimeTableRow
Field | Type | Description |
---|---|---|
train_number | string
|
The number of the train |
scheduled_arrival_hour | string / null
|
The time the train should arrive at the station |
station | string
|
The station name |
layover | string / null
|
Time in minutes of the layover if the train stops at this station |
line | string
|
The line the train will be running at this station |
cachedate | string
|
Time this data was updated for the last time |
stop_type | string / null
|
If there is a stop at the station, the type of the layover. ph or pt
|
hourSort | number
|
Hour in HHmm format to help sorting the data or focus the current station |
Dispatch station timetables
This API will return the timetable of the station post
Source: Official EDR
Parameters
One of the Post id: BZ
LZ_LC
SG_R52
are the only ones supported during staging
Request
https://staging.simrail.deadlykungfu.ninja/dispatch/BZ
Response
The response will be an Array of StationTimetableRow
/!\ The official EDR timetable has a bug where some departure times for trains differ of 1minute between dispatch and train data. This is not an API bug /!\
[ { "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 } ]
StationTimetableRow
Content of each elements of the array:
Field | Type | Description |
---|---|---|
train_number | string
|
The number of the train |
train_type | string
|
The type of the train |
type_speed | number / undefined
|
The maximum speed for the train type, if we have such info |
platform | string
|
The platform the train will stop. Example I 1
|
arrival_time | string
|
Scheduled arrival time of the train |
departure_time | string
|
Scheduled departure time of the train |
from_post | string
|
The station where the train comes from |
to_post | string
|
The station where the train goes |
line | string
|
The line the train needs to be sent to |
start_station | string
|
The starting station of the train |
terminus_station | string
|
The terminus station of the train |
cachedate | string
|
The last time the data was updated from the source |
hourSort | ǹumber
|
Internal sorting value, can also help to focus current row |
Steam profiles
Returns the username and the avatarUrl of a given user without calling SimRail API and cached for a day
Request
https://staging.simrail.deadlykungfu.ninja/steam/<steam_id>
Response
An array containing one object with the data
[ { "avatar": "https://avatars.akamai.steamstatic.com/70845eef7475441ffc0c9f9685cf40a57df07e15.jpg", "pseudo": "Someone" } ]
Train infos by server
n/a
Author: DeadlyKungFu.Ninja