> For the complete documentation index, see [llms.txt](https://docs.blockchainsecurity.asia/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.blockchainsecurity.asia/api-reference/readme/assets-and-market-data/jinehuan-suan.md).

# 金額換算

將一筆金額從某個幣別換算成另一個幣別，兩端都可以是法幣或加密資產。指定時間時使用該 時點的歷史匯率，適合案件金額比對、帳務回溯與跨幣別對帳。回應會一併帶出換算所依據的 匯率與其資料時間，方便留存佐證。

若指定時間早於該幣別的資料涵蓋範圍，會回傳 404，而不會改用最新匯率代替。

## GET /v1/rates/convert

>

```json
{"openapi":"3.1.0","info":{"title":"Blockchain Atlantis API Gateway","version":"0.1.0"},"tags":[{"description":"將一筆金額從某個幣別換算成另一個幣別，兩端都可以是法幣或加密資產。指定時間時使用該\n時點的歷史匯率，適合案件金額比對、帳務回溯與跨幣別對帳。回應會一併帶出換算所依據的\n匯率與其資料時間，方便留存佐證。\n\n若指定時間早於該幣別的資料涵蓋範圍，會回傳 404，而不會改用最新匯率代替。","name":"金額換算"}],"servers":[{"description":"Production","url":"https://api.blockchainsecurity.asia"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"in":"header","name":"X-API-Key","type":"apiKey"}}},"paths":{"/v1/rates/convert":{"get":{"operationId":"convert","parameters":[{"description":"要換算的金額（非負數）","in":"query","name":"amount","required":true,"schema":{"format":"double","type":"number"}},{"description":"來源幣別（法幣代碼或 rate_symbol）","in":"query","name":"from","required":true,"schema":{"type":"string"}},{"description":"目標幣別（法幣代碼或 rate_symbol）","in":"query","name":"to","required":true,"schema":{"type":"string"}},{"description":"時點（unix 秒）；省略=最新","in":"query","name":"at","required":false,"schema":{"format":"int64","type":"integer"}}],"responses":{"200":{"content":{"application/json":{}},"description":"換算成功，回傳結果金額與所用匯率"},"400":{"description":"請求參數有誤，請檢查 amount / from / to"},"401":{"description":"缺少或無效的 API key"},"404":{"description":"指定幣別在該時點沒有匯率資料"}},"summary":"","tags":["金額換算"]}}}}
```
