币价 · 快速上手
export API_KEY="your-api-key"
查 BTC、ETH 的 USD 报价(ids 是系统代币 ID,1 = BTC,1027 = ETH):
curl -H "X-API-Key: $API_KEY" \
"https://gateway.gelabs.org/market/api/v1/quotes/latest?ids=1,1027"
换法币:
curl -H "X-API-Key: $API_KEY" \
"https://gateway.gelabs.org/market/api/v1/quotes/latest?ids=1,1027&fiat=CNY"
已知链和合约时用批次报价:
curl -X POST -H "X-API-Key: $API_KEY" -H "Content-Type: application/json" \
"https://gateway.gelabs.org/market/api/v1/quotes/batch" \
-d '{"fiat":"USD","token_addrs":[{"chain_type":"evm","chain_id":1,"token_address":"0xdac17f958d2ee523a2206206994597c13d831ec7"}]}'
字段与错误码见 接口。