分享快速获取汇率及国际黄金价格API接口

783 阅读2分钟

有业务用到金融服务就会涉及到这几个接口,汇率及上海黄金交易所的价格,下面分享下这几个的说明:

汇率接口

{
    "code": 1,
    "msg": "操作成功",
    "data": {
        "from": "CNY",
        "from_name": "人民币",
        "to": "USD",
        "to_name": "美元",
        "exchange": "0.1399",
        "money": "0.1399",
        "updatetime": "2024-01-06 03:00:02"
    }
}

名称 类型 说明 from string 转换汇率前的货币代码 from_name string 货币名称 to string 转换汇率前的货币代码 to_name string 货币名称 exchange string 当前汇率 updatetime string 更新时间 money string 换算后金额

黄金接口

{
    "code": 1,
    "msg": "操作成功",
    "data": {
        "list": [
            {
                "type": "Au(T+D)",
                "typename": "黄金延期",
                "price": "478.50",
                "openingprice": "479.88",
                "maxprice": "482.99",
                "minprice": "478.00",
                "changepercent": "-0.55",
                "lastclosingprice": "480.29",
                "tradeamount": "10096.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "mAu(T+D)",
                "typename": "迷你黄金延期",
                "price": "478.18",
                "openingprice": "480.00",
                "maxprice": "483.50",
                "minprice": "478.00",
                "changepercent": "-0.64",
                "lastclosingprice": "480.34",
                "tradeamount": "40642.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "AU99.99",
                "typename": "AU9999",
                "price": "477.86",
                "openingprice": "479.50",
                "maxprice": "483.00",
                "minprice": "477.86",
                "changepercent": "-0.45",
                "lastclosingprice": "480.00",
                "tradeamount": "224984.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "Au99.95",
                "typename": "沪金95",
                "price": "482.00",
                "openingprice": "482.00",
                "maxprice": "482.00",
                "minprice": "482.00",
                "changepercent": "0.34",
                "lastclosingprice": "480.37",
                "tradeamount": "2.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "Pt99.95",
                "typename": "沪铂95",
                "price": "227.01",
                "openingprice": "0.00",
                "maxprice": "0.00",
                "minprice": "0.00",
                "changepercent": "-1.72",
                "lastclosingprice": "227.01",
                "tradeamount": "172.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "Au100g",
                "typename": "沪金100G",
                "price": "480.00",
                "openingprice": "482.00",
                "maxprice": "483.00",
                "minprice": "480.00",
                "changepercent": "-0.47",
                "lastclosingprice": "482.29",
                "tradeamount": "14.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "Au(T+N1)",
                "typename": "延期单金",
                "price": "470.00",
                "openingprice": "470.00",
                "maxprice": "470.00",
                "minprice": "470.00",
                "changepercent": "0.72",
                "lastclosingprice": "466.65",
                "tradeamount": "20.00",
                "updatetime": "2024-01-07 14:45:01"
            },
            {
                "type": "Au(T+N2)",
                "typename": "延期双金",
                "price": "474.00",
                "openingprice": "474.00",
                "maxprice": "474.00",
                "minprice": "474.00",
                "changepercent": "-0.03",
                "lastclosingprice": "474.15",
                "tradeamount": "14.00",
                "updatetime": "2024-01-07 14:45:01"
            }
        ]
    }
}

"type": "Au(T+D)", //品种代号 "typename": "黄金延期", //品种名称 "price": "475.00", //最新价 "openingprice": "467.70", //开盘价 "maxprice": "475.00", //最高价 "minprice": "466.70", //最低价 "changepercent": "1.52", //涨跌幅 "lastclosingprice": "466.90", //昨收盘价 "tradeamount": "17664.00", //总成交量 "updatetime": "2024-01-07 16:55:01" //更新时间

白银接口

上海黄金交易所
上海期货交易所
伦敦交易所
https://www.tanshuapi.com/market/detail-96

"type": "伦敦金",//品种代号 "price": "2035.80",//最新价 "changepercent": "+0.02%",//涨跌幅 "changequantity": "+0.4",//涨跌量 "openingprice": "2036.20",//开盘价 "maxprice": "2038.57",//最高价 "minprice": "2036.15",//最低价 "lastclosingprice": "2036.20",//昨收盘价 "updatetime": "2024-01-07 14:37:25"//更新时间