📅  最后修改于: 2023-12-03 14:53:27.826000             🧑  作者: Mango
作为印度最繁忙的城市之一,孟买的交通拥堵严重,但也提供了丰富的公共交通选择之一:火车。在孟买当地,有3个主要的铁路线路:西线、中央线和港线,每天运行大量的火车,连接了孟买和周边地区的城市和镇。
我们提供了关于孟买当地火车时刻表的API,这个API可以让你查询孟买当地的火车时刻表。该API返回JSON数据格式,返回数据包括火车班次名称、起点站、终点站、预计到达时间等。该API接口已经开放,欢迎开发者使用。
GET /mumbai/train/schedule
{
"trains": [
{
"trainName": "Gorakhpur Express",
"startStation": "Mumbai Central",
"endStation": "Gorakhpur Junction",
"scheduledArrivalTime": "05:35",
"scheduledDepartureTime": "05:50"
},
{
"trainName": "Rajdhani Express",
"startStation": "Mumbai Central",
"endStation": "New Delhi",
"scheduledArrivalTime": "08:35",
"scheduledDepartureTime": "08:50"
},
{
"trainName": "Siddheshwar Express",
"startStation": "Mumbai CST",
"endStation": "Solapur Junction",
"scheduledArrivalTime": "16:05",
"scheduledDepartureTime": "16:10"
},
{
"trainName": "Deccan Queen",
"startStation": "Pune",
"endStation": "Mumbai CST",
"scheduledArrivalTime": "09:30",
"scheduledDepartureTime": "09:35"
}
]
}
该API不需要传递任何参数
trainName
: 火车班次名称startStation
: 起点站名称endStation
: 终点站名称scheduledArrivalTime
: 预计到达时间scheduledDepartureTime
: 预计出发时间import requests
url = "https://example.com/mumbai/train/schedule"
headers = {
"Authorization": "Bearer mysecrettoken",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)
以上是孟买当地火车时刻表介绍的全部内容。我们的API已经开放,欢迎大家使用。