
一、四个子接口全览二、货币种类列表/list获取系统支持的所有币种代码。用于初始化币种选择器或下拉菜单。接口地址https://market.aliyun.com/detail/cmapi00065831 import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class ExchangeRateListAPI { public static void main(String[] args) { String host https://market.aliyun.com/detail/cmapi00065831; String path /list; String appcode 你的AppCode; try { String url host path; URL obj new URL(url); HttpURLConnection connection (HttpURLConnection) obj.openConnection(); connection.setRequestMethod(GET); connection.setRequestProperty(Authorization, APPCODE appcode); int responseCode connection.getResponseCode(); System.out.println(Response Code: responseCode); BufferedReader in new BufferedReader( new InputStreamReader(connection.getInputStream())); String inputLine; StringBuilder response new StringBuilder(); while ((inputLine in.readLine()) ! null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } catch (Exception e) { e.printStackTrace(); } } }返回的data.list是一个数组每个元素包含currency货币代码和name中文名称以及可选的logo字段。三、实时汇率查询换算/index传入源币种、目标币种和金额直接返回换算结果。String querys fromCNYtoUSDmoney1; String url host /index? querys; // ... 发起 GET 请求返回示例{ code: 1, msg: 操作成功, data: { from: CNY, from_name: 人民币, to: USD, to_name: 美元, exchange: 0.147839, updatetime: 2026-06-12 22:50:23, money: 0.147839 } }四、单个货币汇率列表/single一次请求获取某币种对所有其他货币的汇率。适合做汇率速览卡片。String querys fromCNY; String url host /single? querys;返回的data.list是一个对象key 为货币代码value 包含name和rate。五、银行汇率查询/bank查询银行的实时外汇牌价。传入bank_code参数。String querys bank_codeICBC; // 工商银行 String url host /bank? querys;四个价格字段字段说明hui_in汇买价——银行买入外汇hui_out汇卖价——银行卖出外汇chao_in钞币买入价chao_out钞币卖出价跨境结算时实际换汇成本用的是 hui_out。六、典型应用场景跨境电商平台使用币种列表初始化选择器配合实时汇率换算自动将商品价格转换为用户所在国货币。金融资讯应用通过单货币多汇率查询一次获取人民币兑多种货币汇率。财务与会计系统自动完成多币种账务换算支持历史汇率回溯。银行与外汇服务平台获取工行、中行等十大银行的实时外汇牌价。七、总结汇率查询 API 的四个子接口覆盖了从币种枚举到银行牌价的完整场景。在实际项目中通常组合使用用 /list 初始化用 /index 做换算用 /single 做展示用 /bank 做结算参考。