实时金价v1
今日金价查询API是一个实时获取国内各大金店黄金价格和国际黄金白银期货价格的接口。(增加了10分钟的缓存)
接口信息
GET
api.11as.cn/api/jinjia/v1.php
Method
GET
分类
实时金价
Calls
34,218
KEY
KEY 必填
计费
免费
QPM
不限制
鉴权方式
Query 参数
作者
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口访问密钥(开启密钥访问时必填) | sk_xxxxxxxxxxxxxxxx |
[
{
"name": "key",
"type": "string",
"required": true,
"description": "接口访问密钥(开启密钥访问时必填)",
"example": "sk_xxxxxxxxxxxxxxxx"
}
]
返回示例
{
"code": 200,
"msg": "success",
"data": {
"update_time": "2026-05-02 18:58:02",
"shops": [
{
"name": "周大福",
"retail_price": "1419",
"exchange_price": "978",
"update_time": "2026-05-02 18:58:02"
},
{
"name": "六福珠宝",
"retail_price": "1417",
"exchange_price": "1205",
"update_time": "2026-05-02 18:58:03"
},
{
"name": "菜百首饰",
"retail_price": "1388",
"exchange_price": null,
"update_time": "2026-05-02 18:58:03"
}
],
"futures": [
{
"name": "国际黄金现货",
"trade_price": "4614.95",
"trade_unit": "美元/盎司",
"convert_price": "1012.9647",
"convert_unit": "元/克",
"update_time": "2026-05-02 04:59:58"
},
{
"name": "上海黄金现货",
"trade_price": "1013.36",
"trade_unit": "人民币/克",
"convert_price": "1013.36",
"convert_unit": "元/克",
"update_time": "2026-04-30 15:02:10"
},
{
"name": "国际白银现货",
"trade_price": "75.36",
"trade_unit": "美元/盎司",
"convert_price": "16.5412",
"convert_unit": "元/克",
"update_time": "2026-05-02 04:59:58"
},
{
"name": "上海白银现货",
"trade_price": "17954",
"trade_unit": "人民币/千克",
"convert_price": "17.954",
"convert_unit": "元/克",
"update_time": "2026-04-30 14:43:50"
}
],
"charts": {
"intl_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=122.XAU&type=r&imageType=rf",
"intl_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=122.XAU&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"intl_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=122.XAG&type=r&imageType=rf",
"intl_silver_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=122.XAG&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"shanghai_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=118.SHAU&type=r&imageType=rf",
"shanghai_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=118.SHAU&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"shanghai_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=118.SHAG&type=r&imageType=r",
"comex_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?imageType=r&type=&token=44c9d251add88e27b65ed86506f6e5da&nid=101.GC00Y",
"comex_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=101.GC00Y&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"comex_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?imageType=r&type=&token=44c9d251add88e27b65ed86506f6e5da&nid=101.SI00Y",
"comex_silver_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=101.SI00Y&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL"
}
},
"api_info": {
"developer": "尋鯨錄",
"blog": "https://www.xunjinlu.fun",
"api_platform": "https://api.xunjinlu.fun"
}
}
接口反馈
实时金价v1 API 文档
接口说明
今日金价查询API是一个实时获取国内各大金店黄金价格和国际黄金白银期货价格的接口。数据每10分钟更新一次,确保获取到最新的市场行情信息。
本接口返回内容包括:
- 国内主要金店(周大福、六福珠宝、菜百首饰等)的黄金零售价和换金价
- 国际黄金现货、上海黄金现货、国际白银现货、上海白银现货的实时交易价格
- 多种贵金属行情图表链接(实时图、趋势图)
调用地址: https://openapi.xunjinlu.fun/api/jinjia/v1.php
请求方式: GET
密钥要求: 必须提供有效密钥
鉴权方式: Query 参数
计费模式: 免费
所属分类: 实时金价
请求参数
| 参数名 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| key | string | 是 | 接口访问密钥,需在平台申请获取 | sk_xxxxxxxxxxxxxxxx |
请求示例
GET https://openapi.xunjinlu.fun/api/jinjia/v1.php?key=sk_xxxxxxxxxxxxxxxx
成功响应示例
{
"code": 200,
"msg": "success",
"data": {
"update_time": "2026-05-02 18:58:02",
"shops": [
{
"name": "周大福",
"retail_price": "1419",
"exchange_price": "978",
"update_time": "2026-05-02 18:58:02"
},
{
"name": "六福珠宝",
"retail_price": "1417",
"exchange_price": "1205",
"update_time": "2026-05-02 18:58:03"
},
{
"name": "菜百首饰",
"retail_price": "1388",
"exchange_price": null,
"update_time": "2026-05-02 18:58:03"
}
],
"futures": [
{
"name": "国际黄金现货",
"trade_price": "4614.95",
"trade_unit": "美元/盎司",
"convert_price": "1012.9647",
"convert_unit": "元/克",
"update_time": "2026-05-02 04:59:58"
},
{
"name": "上海黄金现货",
"trade_price": "1013.36",
"trade_unit": "人民币/克",
"convert_price": "1013.36",
"convert_unit": "元/克",
"update_time": "2026-04-30 15:02:10"
},
{
"name": "国际白银现货",
"trade_price": "75.36",
"trade_unit": "美元/盎司",
"convert_price": "16.5412",
"convert_unit": "元/克",
"update_time": "2026-05-02 04:59:58"
},
{
"name": "上海白银现货",
"trade_price": "17954",
"trade_unit": "人民币/千克",
"convert_price": "17.954",
"convert_unit": "元/克",
"update_time": "2026-04-30 14:43:50"
}
],
"charts": {
"intl_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=122.XAU&type=r&imageType=rf",
"intl_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=122.XAU&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"intl_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=122.XAG&type=r&imageType=rf",
"intl_silver_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=122.XAG&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"shanghai_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=118.SHAU&type=r&imageType=rf",
"shanghai_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=118.SHAU&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"shanghai_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?token=44c9d251add88e27b65ed86506f6e5da&nid=118.SHAG&type=r&imageType=r",
"comex_gold_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?imageType=r&type=&token=44c9d251add88e27b65ed86506f6e5da&nid=101.GC00Y",
"comex_gold_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=101.GC00Y&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL",
"comex_silver_realtime": "https://webquotepic.eastmoney.com/GetPic.aspx?imageType=r&type=&token=44c9d251add88e27b65ed86506f6e5da&nid=101.SI00Y",
"comex_silver_trend": "https://webquoteklinepic.eastmoney.com/GetPic.aspx?nid=101.SI00Y&type=&unitWidth=-6&ef=&formula=RSI&AT=1&imageType=KXL"
}
},
"api_info": {
"developer": "尋鯨錄",
"blog": "https://www.xunjinlu.fun",
"api_platform": "https://api.xunjinlu.fun"
}
}
响应字段说明
顶层字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码,200表示成功 |
| msg | string | 响应消息,success表示成功 |
| data | object | 数据主体,包含金价相关信息 |
| api_info | object | 开发者及平台信息 |
data 对象字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| update_time | string | 数据最后更新时间,格式:YYYY-MM-DD HH:MM:SS |
| shops | array | 国内金店金价列表 |
| futures | array | 期货价格列表 |
| charts | object | 行情图表链接集合 |
shops 数组元素字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| name | string | 金店名称 |
| retail_price | string | 黄金零售价(元/克) |
| exchange_price | string | 黄金换金价(元/克),可能为null |
| update_time | string | 该金店数据更新时间 |
futures 数组元素字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| name | string | 期货品种名称 |
| trade_price | string | 交易价格 |
| trade_unit | string | 交易单位(如:美元/盎司、人民币/克、人民币/千克) |
| convert_price | string | 换算为元/克后的价格 |
| convert_unit | string | 换算后的单位,固定为"元/克" |
| update_time | string | 该期货数据更新时间 |
charts 对象字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| intl_gold_realtime | string | 国际黄金现货实时行情图URL |
| intl_gold_trend | string | 国际黄金现货趋势图URL |
| intl_silver_realtime | string | 国际白银现货实时行情图URL |
| intl_silver_trend | string | 国际白银现货趋势图URL |
| shanghai_gold_realtime | string | 上海黄金现货实时行情图URL |
| shanghai_gold_trend | string | 上海黄金现货趋势图URL |
| shanghai_silver_realtime | string | 上海白银现货实时行情图URL |
| comex_gold_realtime | string | COMEX黄金期货实时行情图URL |
| comex_gold_trend | string | COMEX黄金期货趋势图URL |
| comex_silver_realtime | string | COMEX白银期货实时行情图URL |
| comex_silver_trend | string | COMEX白银期货趋势图URL |
api_info 对象字段
| 字段名 | 类型 | 说明 |
|---|---|---|
| developer | string | 开发者名称 |
| blog | string | 开发者博客地址 |
| api_platform | string | API平台地址 |
错误响应示例
当请求出现错误时,API将返回如下格式的JSON响应:
{
"code": 0,
"msg": "未提供调用密钥",
"errcode": 11001
}
业务错误码说明
| 错误码 | 含义 |
|---|---|
| 11001 | 未提供调用密钥 |
| 11002 | 密钥错误 |
| 11003 | 密钥已禁用 |
| 11004 | 积分余额不足 |
| 11005 | 请求过于频繁(QPM 限制) |
| 11006 | 接口维护中 |
| 11007 | 接口已禁用 |
| 11008 | 接口不可用 |
| 11009 | 密钥校验暂不可用 |
| 11010 | 积分系统暂不可用 |
| 11011 | 收费接口须提供有效密钥 |
| 11012 | 鉴权方式错误 |
| 11013 | 接口不存在 |
| 11014 | ***地址无效 |
| 11015 | ***地址不允许 |
| 11016 | ***请求失败 |
| 11017 | 服务暂不可用 |
| 11018 | 请求方式不允许 |
调用示例
PHP 示例
// 实时金价查询示例
$key = 'sk_xxxxxxxxxxxxxxxx';
$url = 'https://openapi.xunjinlu.fun/api/jinjia/v1.php?key=' . urlencode($key);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response, true);
if ($result['code'] === 200) {
// 成功获取数据
$data = $result['data'];
echo "更新时间: " . $data['update_time'] . "\n";
// 遍历金店金价
foreach ($data['shops'] as $shop) {
echo $shop['name'] . " 零售价: " . $shop['retail_price'] . " 元/克\n";
}
// 遍历期货价格
foreach ($data['futures'] as $future) {
echo $future['name'] . ": " . $future['trade_price'] . " " . $future['trade_unit'] . "\n";
}
} else {
// 错误处理
echo "错误码: " . $result['errcode'] . "\n";
echo "错误信息: " . $result['msg'] . "\n";
}
JavaScript 示例
// 实时金价查询示例
const key = 'sk_xxxxxxxxxxxxxxxx';
const url = `https://openapi.xunjinlu.fun/api/jinjia/v1.php?key=${encodeURIComponent(key)}`;
fetch(url)
.then(response => response.json())
.then(result => {
if (result.code === 200) {
const data = result.data;
console.log('更新时间:', data.update_time);
// 遍历金店金价
data.shops.forEach(shop => {
consol
…(已按长度限制截断)快速上手
暂无代码示例。管理员可在后台用 AI 生成或手动编写。
免责声明
使用本平台接口即表示同意本声明。
- 数据来源:接口数据来自第三方公开网络或用户上传,本平台不保证准确性、完整性、实时性,请以官方信息为准。
- 合法性与安全性:本平台无法核实每个接口的安全性、合法性,使用者自行承担相关风险。
- 用途限制:标注“学习专用”的接口禁止商用;严禁用于违法违规行为(如诈骗、赌博、侵权等)。违规后果由使用者自行承担。
- 损害免责:使用本接口产生的任何直接或间接损失,本平台不承担责任。
- 第三方上传:用户/商户上传的接口若侵权或违法,由上传者承担全部责任。
- 监督配合:本平台依法记录访问日志,如发现违法活动将配合执法部门处理,并有权随时限制或封禁服务。
注:本平台保留最终解释权,并可能随时更新本声明。
在线测试
请求地址
api.11as.cn/api/jinjia/v1.php
参数
Response
等待中
// 结果将在此处显示