
API在社交媒體中的應用
點擊右側訪問官網,點擊官網右上角注冊或登錄。
2.登錄成功以后就會到儀表盤頁面,可以看到 右側有一個創建API密鑰。
3.輸入密鑰名稱
4.創建成功后可以進入檢查頁面,查看密鑰詳細信息。
5.這里能看到密鑰詳細信息。
在獲取API密鑰后,進行可用性測試是確保其正常工作的重要步驟。以下是使用curl進行測試的一個案例
以下接口為TronGrid 托管接口中 列出鏈上所有資產 接口。
輸入:
curl --request GET \
--url https://api.shasta.trongrid.io/v1/assets \
--header 'accept: application/json'
輸出:
結果以 JSON 格式返回,包含了多個數字資產的詳細信息,如資產 ID、簡稱、名稱、精度、總供應量、交易次數、擁有者地址及起止時間等;同時提供了分頁信息、請求時間戳及數據指紋,全面展示了這些資產的基本屬性、流通情況和訪問管理細節。
{
"data": [
{
"id": 1001513,
"abbr": "MAT",
"description": "",
"name": "MyAwesomeToken",
"num": 1,
"precision": 0,
"url": "https://example.com",
"total_supply": 5000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "413a8d264521d7170e42f3f93c684625148df968b8",
"start_time": 1754637583711,
"end_time": 1754723973711
},
{
"id": 1001512,
"abbr": "GD",
"description": "",
"name": "GOOD",
"num": 100,
"precision": 2,
"url": "ceshi.com",
"total_supply": 1000000000000,
"trx_num": 1000000,
"vote_score": 0,
"owner_address": "41bd6d8d6a85ffbed34a62dc68fa027f0103ed2b3d",
"start_time": 1752854400000,
"end_time": 1752940800000
},
{
"id": 1001511,
"abbr": "NST11",
"description": "",
"name": "NST11",
"num": 1,
"precision": 0,
"url": "ceshi.com",
"total_supply": 1000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "411c03fa040f3f6d3e7ab823125f33cdf6c55f32be",
"start_time": 1752838408403,
"end_time": 1784374398403
},
{
"id": 1001510,
"abbr": "U8GWCOM",
"description": "",
"name": "U8GWCOM",
"num": 1000,
"precision": 6,
"url": "https://u8gw.com/",
"total_supply": 1000000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41e743783bb04406e6f095b4900beaba557b8a01af",
"start_time": 1751889963219,
"end_time": 1751976363219
},
{
"id": 1001509,
"abbr": "PXIL",
"description": "",
"name": "PXIL",
"num": 10000,
"precision": 4,
"url": "http://pxil-incr-p2p.com",
"total_supply": 10000000000,
"trx_num": 1000000,
"vote_score": 0,
"owner_address": "41201740263f95e48007897ed24900c6de48b3505c",
"start_time": 1751756400000,
"end_time": 1751842800000
},
{
"id": 1001508,
"abbr": "U8.COM",
"description": "",
"name": "U8COM",
"num": 1,
"precision": 6,
"url": "https://u8gw.com/",
"total_supply": 1000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41616ddcaa27f6839e38f9fdbb2f7172ab824d62c6",
"start_time": 1751357201514,
"end_time": 1751443591514
},
{
"id": 1001507,
"abbr": "U8.COM",
"description": "",
"name": "U8.COM",
"num": 1,
"precision": 6,
"url": "https://u8gw.com/",
"total_supply": 1000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "410591b983f3b89d771576aa428680ce201bdf21a9",
"start_time": 1751355476596,
"end_time": 1751441866596
},
{
"id": 1001506,
"abbr": "U8COM",
"description": "",
"name": "U8COM",
"num": 1,
"precision": 6,
"url": "https://u8gw.com/",
"total_supply": 10000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41085b3d46e96be7dc4aa8e99ad0dfb47ddb7f1f16",
"start_time": 1751354696461,
"end_time": 1751441086461
},
{
"id": 1001505,
"abbr": "MiDollarAI",
"description": "",
"name": "MiDollarAI",
"num": 1,
"precision": 0,
"url": "https://MiDollar.io",
"total_supply": 1000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "414bddef775250e3af5def2cff48bb47ef2cb85d92",
"start_time": 1750734036000,
"end_time": 1750737576000
},
{
"id": 1001504,
"abbr": "MDAI",
"description": "",
"name": "MiDoAI",
"num": 1,
"precision": 6,
"url": "https://MiDoAI.io",
"total_supply": 100000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41e150e01ab0235a889824adc7e731f4ceb6e5d6d2",
"start_time": 1750733622000,
"end_time": 1750737162000
},
{
"id": 1001503,
"abbr": "MDAI",
"description": "",
"name": "MintDoAI",
"num": 1,
"precision": 6,
"url": "https://MintDollar.ai",
"total_supply": 100000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41906bf8946c1b254e63b21406faef1ef0d6db5782",
"start_time": 1750733271000,
"end_time": 1750736811000
},
{
"id": 1001502,
"abbr": "MDAI",
"description": "",
"name": "MintDollarAI",
"num": 1,
"precision": 6,
"url": "https://MintDollar.AI",
"total_supply": 100000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41374250da5a2dfbfde9838947edbf5bffd611e27c",
"start_time": 1750663014000,
"end_time": 1750666554000
},
{
"id": 1001501,
"abbr": "FUN",
"description": "",
"name": "24TimeFUN",
"num": 1,
"precision": 6,
"url": "https://24time.fun",
"total_supply": 100000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41c878c490fc34314da345a35bafa3d3987781f7a0",
"start_time": 1750423797000,
"end_time": 1750427337000
},
{
"id": 1001500,
"abbr": "FUN",
"description": "",
"name": "24Time.FUN",
"num": 1,
"precision": 6,
"url": "https://24time.fun",
"total_supply": 100000000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "4105ca081fa08ce8ec7feb54564ed63b61e9506d76",
"start_time": 1750334700000,
"end_time": 1750338240000
},
{
"id": 1001499,
"abbr": "24TimeFUN",
"description": "",
"name": "24TimeFUN",
"num": 1,
"precision": 6,
"url": "https://24time.fun",
"total_supply": 100000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41862f16a3c80aa0e45aacf828116be29726658b5e",
"start_time": 1750298553000,
"end_time": 1750302093000
},
{
"id": 1001498,
"abbr": "trx",
"description": "",
"name": "TRX(TRX)",
"num": 100,
"precision": 6,
"url": "https://example.com",
"total_supply": 1000000000000000,
"trx_num": 100,
"vote_score": 0,
"owner_address": "41747294718582d91500b4286050a3376698bd1fa6",
"start_time": 1748539719000,
"end_time": 1751131119000
},
{
"id": 1001497,
"abbr": "TRX",
"description": "",
"name": "TRX(TRX)",
"num": 100,
"precision": 6,
"url": "https://example.com",
"total_supply": 1000000000000000,
"trx_num": 100,
"vote_score": 0,
"owner_address": "4106cda7268dcac9d64c88cdff19716826fd5cdea4",
"start_time": 1748539535000,
"end_time": 1751130935000
},
{
"id": 1001496,
"abbr": "trx",
"description": "",
"name": "TRX(TRX)",
"num": 100,
"precision": 6,
"url": "https://example.com",
"total_supply": 1000000000000000,
"trx_num": 100,
"vote_score": 0,
"owner_address": "417f23c35931c1ce30f82623558e779a410c595828",
"start_time": 1748539392000,
"end_time": 1751130792000
},
{
"id": 1001495,
"abbr": "4d5954",
"description": "",
"name": "4d7920546f6b656e",
"num": 1,
"precision": 6,
"url": "68747470733a2f2f6d79746f6b656e2e6578616d706c652e636f6d",
"total_supply": 1000000000000,
"trx_num": 1,
"vote_score": 0,
"owner_address": "41e01097fcbe2168884bfda5ced7f37b0db7ab7803",
"start_time": 1747486603613,
"end_time": 1747573003613
},
{
"id": 1001494,
"abbr": "FDT",
"description": "",
"name": "FLASH",
"num": 90000000,
"precision": 6,
"url": "ROMANCE.COM",
"total_supply": 2090009909000000,
"trx_num": 1000000000,
"vote_score": 0,
"owner_address": "41bae2af3696a4a1d62062110e21d1ad85e6626b61",
"start_time": 1746383400000,
"end_time": 1746469800000
}
],
"meta": {
"at": 1755207359667,
"fingerprint": "CoonJDu8eN2N4yvFTinUYnm6fj89o1vyFWswm1gAzghXjr7XWf5k1A4xVWhRWo7o7kKWkxL",
"links": {
"next": "https://api.shasta.trongrid.io/v1/assets?fingerprint=CoonJDu8eN2N4yvFTinUYnm6fj89o1vyFWswm1gAzghXjr7XWf5k1A4xVWhRWo7o7kKWkxL"
},
"page_size": 20
},
"success": true
}
在使用TronGrid 托管API搭建應用時,除了獲取和測試API密鑰外,還需考慮以下因素:
為了確保請求資源的合理分配,所有請求 API 都需要攜帶參數 API Key,未攜帶 API Key 的請求將被嚴重限制或根本不予響應。
目前,,調用接口時需要在請求頭中使用參數 TRON-PRO-API-KEY,,并其值為 API 密鑰。
HTTP 示例:
curl -X POST \
https://api.trongrid.io/wallet/createtransaction \
-H 'Content-Type: application/json' \
-H 'TRON-PRO-API-KEY: 25f66928-0b70-48cd-9ac6-da6f8247c663' \
-d '{
"to_address": "41e9d79cc47518930bc322d9bf7cddd260a0260a8d",
"owner_address": "41D1E7A6BC354106CB410E65FF8B181C600FF14292",
"amount": 1000
}'
??注意:
目前,每個賬戶每天的總請求次數為100,000次(根據相關需求,總請求次數稍后會進行調整)。
為了確保請求資源的合理分配,建議所有對 Trongrid 服務的請求都包含參數 API Key。Trongrid 對所有用戶設置了以下速率限制:
在申請和使用 TronGrid 托管 API密鑰過程中,你可能會遇到以下常見問題:
如果我被限流了該怎么辦?
如果您仍然被限流,可以嘗試以下解決方法:
TronGrid 是什么,為什么要用它?
TronGrid 是由 TRON 社區提供的托管 API 層,替開發者對外暴露節點功能(查詢賬戶、廣播交易、檢索區塊/事件等),省去自己部署節點并提供 API Key/限流管理。
文檔里時間戳和返回 meta.at 的單位是什么?
響應中常見的時間字段(如 create_time
、meta.at
)以毫秒為單位表示的 Unix 時間戳。
在獲得TronGrid 托管 API密鑰之后,即可開啟API接口對接,本文整理了多篇使用TronGrid 托管 API的案例,幫助讀者更有效地使用TronGrid 托管 API:
問題1: 什么是冪簡集成平臺?
冪簡集成是蜜堂有信在2023年打造的一款SAAS產品,建設著國內最全的API平臺,為開發者提供全面、高效、易用的API集成管理方案,一站搜索、試用、集成國內和國外API。讓用戶在AI時代全方位接入互聯網,用API連接一切服務和算力,實現價值倍增。
問題2:如何找到TronGrid 托管 API
冪簡API平臺可以通過以下兩種方式找到所需API:通過關鍵詞搜索API(例如,輸入’TronGrid 托管 API‘這類品類詞,更容易找到結果)、或者從API hub分類頁進入尋找。
問題3:TronGrid 托管 API的替代品有哪些?
市場上存在免費、付費兩種替代者
例如
更多競品可以在TronGrid 托管找到。
本文詳細介紹了TronGrid托管API密鑰的獲取、可用性測試及使用注意事項,涵蓋了從使用curl測試接口獲取鏈上資產信息,到在應用中正確攜帶API密鑰、遵守速率限制,以及解決常見問題的方法。同時,還提供了進階指引和替代方案參考,幫助開發者更高效、安全地對接TronGrid托管API,實現數字資產管理和鏈上應用開發的便捷集成。