定價頁 | 點(diǎn)此進(jìn)入 |
免費(fèi)方式 | 每月限免 |
定價方式 | 訂閱、 按量(例如每次/元、每token/美元)、 定制 |
采購渠道 | 官網(wǎng) |
API適用國家/地區(qū) | 美國 |
支持語言 | N/A |
TransitLand API 服務(wù)商
評分 48/100
9
TransitLand是什么公司
更多Transitland 是一個開放的交通數(shù)據(jù)平臺,成立于2014年,由一群致力于改善公共交通數(shù)據(jù)訪問的創(chuàng)新者創(chuàng)立。公司的使命是聚合全球范圍內(nèi)的GTFS、GTFS Realtime、GBFS等開放數(shù)據(jù)源,為開發(fā)者、規(guī)劃者和研究人員提供全面、實(shí)時的交通信息。核心價值觀包括開放性、協(xié)作和數(shù)據(jù)驅(qū)動的決策。Transitland 提供的主要產(chǎn)品和服務(wù)包括全球交通地圖、API接口以及數(shù)據(jù)可視化和分析工具。市場定位為交通數(shù)據(jù)領(lǐng)域的聚合器和創(chuàng)新者,服務(wù)于全球超過2500家運(yùn)營商和55個國家的交通網(wǎng)絡(luò)。
官網(wǎng)入口 | 點(diǎn)擊進(jìn)入 | API開放平臺 | 點(diǎn)擊進(jìn)入 |
公司名稱 | TransitLand | 公司簡稱 | TransitLand |
公司分類 | 生活服務(wù) 、 交通出行 | 主營產(chǎn)品 | N/A |
成立時間 | N/A | 總部地址 | N/A |
網(wǎng)站排名 | 143.4K | 月用戶量 | 49.4K |
國家/地區(qū) | 美國 | 收錄時間 | 2024.09.12 |
TransitLand的API接口(產(chǎn)品與功能)
Transit Land 是一個平臺,它從交通機(jī)構(gòu)和其他來源策劃和聚合交通數(shù)據(jù)。他們提供公共 API,讓你可以訪問豐富的交通數(shù)據(jù),用于構(gòu)建應(yīng)用程序或改進(jìn)現(xiàn)有應(yīng)用程序。
在本文中,我們將探索 Transit Land 的一些 API 以及如何在 JavaScript 中使用它們。
Transit Land 提供了幾個 API 來訪問交通數(shù)據(jù)。以下是其中的一些:
https://api.transit.land/api/v2/schedule_stop_pairs
- 返回在給定站點(diǎn)停靠的所有交通行程的列表。https://api.transit.land/api/v1/feed_versions
- 返回 Transit Land 數(shù)據(jù)庫中可用的訂閱版本列表。https://api.transit.land/api/v2/router/router
- 使用 GTFS 交通數(shù)據(jù)計(jì)算兩個站點(diǎn)之間的可能路線。
讓我們看看如何在 JavaScript 中使用這些 API。
要從 JavaScript 應(yīng)用程序進(jìn)行 API 調(diào)用,我們可以使用 fetch()
函數(shù),這是現(xiàn)代網(wǎng)絡(luò)瀏覽器的原生功能。
要檢索在給定站點(diǎn)停靠的所有交通行程的列表,我們可以向 schedule_stop_pairs
端點(diǎn)發(fā)送 GET
請求,將站點(diǎn) ID 作為參數(shù)傳遞。
fetch('https://api.transit.land/api/v2/schedule_stop_pairs?origin_onestop_id=o-9q8y-nfantacitypark&date=2019-05-03')
.then(response => response.json())
.then(data => console.log(data));
在這個例子中,我們請求了 ID 為 o-9q8y-nfantacitypark
的站點(diǎn)在 2019 年 5 月 3 日的行程站點(diǎn)對。
要檢索 Transit Land 數(shù)據(jù)庫中可用的訂閱版本列表,我們可以向 feed_versions
端點(diǎn)發(fā)送 GET
請求。
fetch('https://api.transit.land/api/v1/feed_versions')
.then(response => response.json())
.then(data => console.log(data));
要使用 GTFS 交通數(shù)據(jù)計(jì)算兩個站點(diǎn)之間的可能路線,我們可以向 router
端點(diǎn)發(fā)送 POST
請求,在請求正文中傳遞起點(diǎn)和目的地站點(diǎn) ID。
const requestBody = JSON.stringify({
origin_onestop_id: 'o-9q8y-nfantacitypark',
destination_onestop_id: 'o-9q8y-nfanthewestend'
});
const headers = {
'Content-Type': 'application/json'
};
fetch('https://api.transit.land/api/v2/router/router', {
method: 'POST',
headers,
body: requestBody
})
.then(response => response.json())
.then(data => console.log(data));
在這個例子中,我們計(jì)算了 ID 為 o-9q8y-nfantacitypark
和 o-9q8y-nfanthewestend
的站點(diǎn)之間的可能路線。
在本文中,我們探索了 Transit Land 的一些公共 API 以及如何在 JavaScript 中使用它們。有了這些 API,你可以訪問各種交通數(shù)據(jù),用于構(gòu)建強(qiáng)大的交通相關(guān)應(yīng)用程序和解決方案。
TransitLand API的價格(API免費(fèi)方式與收費(fèi)標(biāo)準(zhǔn))
在選擇API服務(wù)商時,綜合評估以下維度,選擇最適合自己需求的API服務(wù)商,確保技術(shù)兼容性和成本效益。