金額換算
get
Authorizations
X-API-KeystringRequired
Query parameters
amountnumber · doubleRequiredExample:
要換算的金額(非負數)
33000fromstringRequiredExample:
來源幣別(法幣代碼或 rate_symbol)
TWDtostringRequiredExample:
目標幣別(法幣代碼或 rate_symbol)
USDTatinteger · int64OptionalExample:
時點(unix 秒);省略=最新
1721142000Responses
200
換算成功,回傳結果金額與所用匯率
application/json
400
請求參數有誤,請檢查 amount / from / to
401
缺少或無效的 API key
404
指定幣別在該時點沒有匯率資料
get/v1/rates/convert
GET /v1/rates/convert?amount=1&from=text&to=text HTTP/1.1
Host: api.blockchainsecurity.asia
X-API-Key: YOUR_API_KEY
Accept: */*
{
"data": {
"amount": 33000,
"at": 1721142000,
"from": "TWD",
"from_rate": {
"kind": "fiat",
"price_usd": 0.030536215952119215,
"ts": 1721142000,
"units_per_usd": 32.748
},
"rate": 0.030536215952119215,
"result": 1007.695126419934,
"to": "USDT",
"to_rate": {
"kind": "stable",
"price_usd": 1,
"ts": null,
"units_per_usd": null
},
"usd_value": 1007.695126419934
},
"meta": {
"request_id": "3f1c8a20-6d54-4f8b-9a17-2c9e5b7d1e44"
}
}Last updated
Was this helpful?

