| 参数名称 | 类型 | 必填 | 说明 |
|---|
| 参数名称 | 类型 | 说明 |
|---|---|---|
| type | string | 品种代号 |
| typename | string | 品种名称 |
| price | string | 最新价 |
| openingprice | string | 开盘价 |
| maxprice | string | 最高价 |
| minprice | string | 最低价 |
| changepercent | string | 涨跌幅 |
| lastclosingprice | string | 昨收盘价 |
| tradeamount | string | 总成交量 |
| updatetime | string | 更新时间 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/shgold?appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $val)
{
echo $val['type'].' '.$val['typename'].' '.$val['price'].' '.$val['openingprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['changepercent'].' '.$val['lastclosingprice'].' '.$val['tradeamount'].' '.$val['updatetime'].'
';
}
#!/usr/bin/python
# encoding:utf-8
import requests
# 1、上海黄金交易所价格
data = {}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/gold/shgold"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
print(jsonarr["msg"])
exit()
result = jsonarr["result"]
for val in result:
print(val["type"],val["typename"],val["price"],val["openingprice"],val["maxprice"],val["minprice"],val["changepercent"],val["lastclosingprice"],val["tradeamount"],val["updatetime"])
package api.jisuapi.gold;
import api.util.HttpUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class Shgold {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/gold/shgold";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONArray resultarr = json.optJSONArray("result");
for (int i = 0; i < resultarr.size(); i++) {
JSONObject obj = (JSONObject) resultarr.opt(i);
String type = obj.getString("type");
String typename = obj.getString("typename");
String price = obj.getString("price");
String openingprice = obj.getString("openingprice");
String maxprice = obj.getString("maxprice");
String minprice = obj.getString("minprice");
String changepercent = obj.getString("changepercent");
String lastclosingprice = obj.getString("lastclosingprice");
String tradeamount = obj.getString("tradeamount");
String updatetime = obj.getString("updatetime");
System.out.println(type + " " + typename + " " + price + " " + openingprice + " " + maxprice + " "
+ minprice + " " + changepercent + " " + lastclosingprice + " " + tradeamount + " "
+ updatetime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/shgold';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status": 0,
"msg": "ok",
"result": [
{
"type": "Au(T+D)",
"typename": "黄金延期",
"price": "238.05",
"openingprice": "241.00",
"maxprice": "241.50",
"minprice": "237.50",
"changepercent": "-0.90%",
"lastclosingprice": "240.22",
"tradeamount": "45998.0000",
"updatetime": "2015-10-26 15:29:13"
},
{
"type": "Au99.99",
"typename": "沪金99",
"price": "238.30",
"openingprice": "241.48",
"maxprice": "241.48",
"minprice": "238.00",
"changepercent": "-0.91%",
"lastclosingprice": "240.49",
"tradeamount": "25400.9800",
"updatetime": "2015-10-26 15:29:15"
}
]
}
| 参数名称 | 类型 | 必填 | 说明 |
|---|
| 参数名称 | 类型 | 说明 |
|---|---|---|
| type | string | 品种代号 |
| typename | string | 品种名称 |
| price | string | 最新价 |
| changequantity | string | 涨跌量 |
| buyprice | string | 买入价 |
| buyamount | string | 买入量 |
| sellprice | string | 卖出价 |
| sellamount | string | 卖出量 |
| tradeamount | string | 总成交量 |
| openingprice | string | 开盘价 |
| lastclosingprice | string | 昨收盘价 |
| maxprice | string | 最高价 |
| minprice | string | 最低价 |
| holdamount | string | 持仓量 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/shfutures?appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $val)
{
echo $val['type'].' '.$val['typename'].' '.$val['price'].' '.$val['changequantity'].' '.$val['buyprice'].' '.$val['buyamount'].' '.$val['sellprice'].' '.$val['sellamount'].' '.$val['tradeamount'].' '.$val['openingprice'].' '.$val['lastclosingprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['holdamount'].' '.$val['increaseamount'].'
';
}
#!/usr/bin/python
# encoding:utf-8
import requests
# 2、上海期货交易所价格
data = {}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/gold/shfutures"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
print(jsonarr["msg"])
exit()
result = jsonarr["result"]
for val in result:
print(val["type"],val["typename"],val["price"],val["changequantity"],val["buyprice"],val["buyamount"],val["sellprice"],val["sellamount"],val["tradeamount"],val["openingprice"],val["lastclosingprice"],val["maxprice"],val["minprice"],val["holdamount"],val["increaseamount"])
package api.jisuapi.gold;
import api.util.HttpUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class Shfutures {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/gold/shfuturess";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONArray resultarr = json.optJSONArray("result");
for (int i = 0; i < resultarr.size(); i++) {
JSONObject obj = (JSONObject) resultarr.opt(i);
String type = obj.getString("type");
String typename = obj.getString("typename");
String price = obj.getString("price");
String changequantity = obj.getString("changequantity");
String buyprice = obj.getString("buyprice");
String buyamount = obj.getString("buyamount");
String sellprice = obj.getString("sellprice");
String sellamount = obj.getString("sellamount");
String tradeamount = obj.getString("tradeamount");
String openingprice = obj.getString("openingprice");
String maxprice = obj.getString("maxprice");
String minprice = obj.getString("minprice");
String lastclosingprice = obj.getString("lastclosingprice");
String holdamount = obj.getString("holdamount");
String increaseamount = obj.getString("increaseamount");
System.out.println(type + " " + typename + " " + price + " " + changequantity + " " + buyprice + " "
+ buyamount + " " + sellprice + " " + sellamount + " " + tradeamount + " " + openingprice
+ " " + lastclosingprice + " " + maxprice + " " + minprice + " " + holdamount + " "
+ increaseamount);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/shfutures';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status": 0,
"msg": "ok",
"result": [
{
"type": "AU1511",
"typename": "黄金1511",
"price": "237.25",
"changequantity": "1.951",
"buyprice": "233.25",
"buyamount": "0",
"sellprice": "244.6",
"sellamount": "0",
"tradeamount": "20",
"openingprice": "236.049",
"lastclosingprice": "235.299",
"maxprice": "237.25",
"minprice": "236.049",
"holdamount": "16",
"increaseamount": "0"
},
{
"type": "AU1512",
"typename": "黄金1512",
"price": "238.7",
"changequantity": "-0.949",
"buyprice": "238.7",
"buyamount": "5",
"sellprice": "238.75",
"sellamount": "100",
"tradeamount": "210274",
"openingprice": "241.5",
"lastclosingprice": "239.649",
"maxprice": "241.5",
"minprice": "237.799",
"holdamount": "188302",
"increaseamount": "-6086"
}
]
}
| 参数名称 | 类型 | 必填 | 说明 |
|---|
| 参数名称 | 类型 | 说明 |
|---|---|---|
| type | string | 品种代号 |
| buyprice | string | 买入价 |
| sellprice | string | 卖出价 |
| changequantity | string | 涨跌量 |
| openingprice | string | 开盘价 |
| closingprice | string | 收市价 |
| maxprice | string | 最高价 |
| minprice | string | 最低价 |
| updatetime | string | 更新时间 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/hkgold?appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $val)
{
echo $val['type'].' '.$val['buyprice'].' '.$val['sellprice'].' '.$val['finalprice'].' '.$val['openingprice'].' '.$val['closingprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['updatetime'].'
';
}
#!/usr/bin/python
# encoding:utf-8
import requests
# 3、香港金银业贸易场价格
data = {}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/gold/hkgold"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
print(jsonarr["msg"])
exit()
result = jsonarr["result"]
for val in result:
print(val["type"],val["buyprice"],val["sellprice"],val["finalprice"],val["openingprice"],val["closingprice"],val["maxprice"],val["minprice"],val["updatetime"])
package api.jisuapi.gold;
import api.util.HttpUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class Hkgold {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/gold/hkgold";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONArray resultarr = json.optJSONArray("result");
for (int i = 0; i < resultarr.size(); i++) {
JSONObject obj = (JSONObject) resultarr.opt(i);
String type = obj.getString("type");
String buyprice = obj.getString("buyprice");
String sellprice = obj.getString("sellprice");
String finalprice = obj.getString("finalprice");
String maxprice = obj.getString("maxprice");
String minprice = obj.getString("minprice");
String openingprice = obj.getString("openingprice");
String closingprice = obj.getString("closingprice");
String updatetime = obj.getString("updatetime");
System.out.println(type + " " + buyprice + " " + sellprice + " " + finalprice + " " + openingprice
+ " " + closingprice + " " + maxprice + " " + minprice + " " + updatetime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/hkgold';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status":0,
"msg":"ok",
"result":[
{
"type":"HKG",
"typename":"香港黄金",
"price":"16780",
"changequantity":"37",
"openingprice":"16743",
"maxprice":"16781",
"minprice":"16718",
"lastclosingprice":"16743",
"buyprice":"15564",
"sellprice":"15579",
"tradeamount":"4083",
"updatetime":"2020-07-15 16:05:33"
}
]
}
| 参数名称 | 类型 | 必填 | 说明 |
|---|
| 参数名称 | 类型 | 说明 |
|---|---|---|
| typename | string | 品种名称 |
| midprice | string | 中间价 |
| buyprice | string | 买入价 |
| sellprice | string | 卖出价 |
| maxprice | string | 最高价 |
| minprice | string | 最低价 |
| updatetime | string | 更新时间 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/bank?appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $val)
{
echo $val['type'].' '.$val['midprice'].' '.$val['buyprice'].' '.$val['sellprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['openingprice'].' '.$val['lastclosingprice'].' '.$val['changequantity'].' '.$val['updatetime'].'
';
}
#!/usr/bin/python
# encoding:utf-8
import requests
# 4、银行账户黄金价格
data = {}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/gold/bank"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
print(jsonarr["msg"])
exit()
result = jsonarr["result"]
for val in result:
print(val["type"],val["midprice"],val["buyprice"],val["sellprice"],val["maxprice"],val["minprice"],val["openingprice"],val["lastclosingprice"],val["changequantity"],val["updatetime"])
package api.jisuapi.gold;
import api.util.HttpUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class Bank {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/gold/bank";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONArray resultarr = json.optJSONArray("result");
for (int i = 0; i < resultarr.size(); i++) {
JSONObject obj = (JSONObject) resultarr.opt(i);
String type = obj.getString("type");
String midprice = obj.getString("midprice");
String buyprice = obj.getString("buyprice");
String sellprice = obj.getString("sellprice");
String maxprice = obj.getString("maxprice");
String minprice = obj.getString("minprice");
String openingprice = obj.getString("openingprice");
String lastclosingprice = obj.getString("lastclosingprice");
String changequantity = obj.getString("changequantity");
String updatetime = obj.getString("updatetime");
System.out.println(type + " " + midprice + " " + buyprice + " " + sellprice + " " + maxprice + " "
+ minprice + " " + openingprice + " " + lastclosingprice + " " + changequantity + " "
+ updatetime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/bank';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status":0,
"msg":"ok",
"result":[
{
"typename":"人民币黄金",
"midprice":"408.92",
"buyprice":"408.67",
"sellprice":"409.17",
"maxprice":"409.16",
"minprice":"407.58",
"updatetime":"2020-07-21 12:19:54"
},
{
"typename":"人民币白银",
"midprice":"4.548",
"buyprice":"4.538",
"sellprice":"4.558",
"maxprice":"4.592",
"minprice":"4.424",
"updatetime":"2020-07-21 12:19:54"
},
{
"typename":"人民币铂金",
"midprice":"191.44",
"buyprice":"190.24",
"sellprice":"192.64",
"maxprice":"191.88",
"minprice":"189.39",
"updatetime":"2020-07-21 12:19:54"
},
{
"typename":"人民币钯金",
"midprice":"462.06",
"buyprice":"458.71",
"sellprice":"467.66",
"maxprice":"466.68",
"minprice":"458.45",
"updatetime":"2020-07-21 12:19:54"
},
{
"typename":"美黄金",
"midprice":"1818.7650",
"buyprice":"1817.8650",
"sellprice":"1819.6650",
"maxprice":"1820.0650",
"minprice":"1815.2750",
"updatetime":"2020-07-21 12:19:54"
}
]
}
| 参数名称 | 类型 | 必填 | 说明 |
|---|
| 参数名称 | 类型 | 说明 |
|---|---|---|
| type | string | 品种代号 |
| price | string | 最新价 |
| changepercent | string | 涨跌幅 |
| changequantity | string | 涨跌量 |
| openingprice | string | 开盘价 |
| maxprice | string | 最高价 |
| minprice | string | 最低价 |
| lastclosingprice | string | 昨收盘价 |
| updatetime | string | 更新时间 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/london?appkey=$appkey";
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $val)
{
echo $val['type'].' '.$val['price'].' '.$val['changepercent'].' '.$val['changequantity'].' '.$val['openingprice'].' '.$val['maxprice'].' '.$val['minprice'].' '.$val['lastclosingprice'].' '.$val['amplitude'].' '.$val['buyprice'].' '.$val['sellprice'].' '.$val['updatetime'].'
';
}
#!/usr/bin/python
# encoding:utf-8
import requests
# 5、伦敦金、银价格
data = {}
data["appkey"] = "your_appkey_here"
url = "https://api.jisuapi.com/gold/london"
response = requests.get(url,params=data)
jsonarr = response.json()
if jsonarr["status"] != 0:
print(jsonarr["msg"])
exit()
result = jsonarr["result"]
for val in result:
print(val["type"],val["price"],val["changepercent"],val["changequantity"],val["openingprice"],val["maxprice"],val["minprice"],val["lastclosingprice"],val["amplitude"],val["buyprice"],val["sellprice"],val["updatetime"])
package api.jisuapi.gold;
import api.util.HttpUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class London {
public static final String APPKEY = "your_appkey_here";// 你的appkey
public static final String URL = "https://api.jisuapi.com/gold/london";
public static void Get() {
String result = null;
String url = URL + "?appkey=" + APPKEY;
try {
result = HttpUtil.sendGet(url, "utf-8");
JSONObject json = JSONObject.fromObject(result);
if (json.getInt("status") != 0) {
System.out.println(json.getString("msg"));
} else {
JSONArray resultarr = json.optJSONArray("result");
for (int i = 0; i < resultarr.size(); i++) {
JSONObject obj = (JSONObject) resultarr.opt(i);
String type = obj.getString("type");
String price = obj.getString("price");
String changepercent = obj.getString("changepercent");
String changequantity = obj.getString("changequantity");
String openingprice = obj.getString("openingprice");
String maxprice = obj.getString("maxprice");
String minprice = obj.getString("minprice");
String lastclosingprice = obj.getString("lastclosingprice");
String amplitude = obj.getString("amplitude");
String buyprice = obj.getString("buyprice");
String sellprice = obj.getString("sellprice");
String updatetime = obj.getString("updatetime");
System.out.println(type + " " + price + " " + changepercent + " " + changequantity + " "
+ openingprice + " " + maxprice + " " + minprice + " " + lastclosingprice + " " + amplitude
+ " " + buyprice + " " + sellprice + " " + updatetime);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/london';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status":0,
"msg":"ok",
"result":[
{
"type":"铂金期货",
"price":"864.960",
"changepercent":"+0.82%",
"changequantity":"+7.060",
"maxprice":"868.200",
"minprice":"860.900",
"lastclosingprice":"857.900",
"updatetime":"2020-07-21 12:23:34"
},
{
"type":"钯金期货",
"price":"2100.710",
"changepercent":"-0.41%",
"changequantity":"-8.690",
"maxprice":"2113.900",
"minprice":"2092.700",
"lastclosingprice":"2109.400",
"updatetime":"2020-07-21 12:23:34"
},
{
"type":"伦敦金",
"price":"1818.6899",
"changepercent":"+0.05%",
"changequantity":"+0.9199",
"openingprice":"1817.95",
"maxprice":"1820.29",
"minprice":"1815.8199",
"lastclosingprice":"1817.77",
"updatetime":"2020-07-21 12:23:35"
}
]
}
| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| date | string | 否 | 日期(仅支持最近七天,不填则默认当天,更新时间不固定) |
| 参数名称 | 类型 | 说明 |
|---|---|---|
| store_name | string | 金店名称 |
| date | string | 日期 |
| gold | string | 黄金(元/克) |
| platinum | string | 铂金(元/克) |
| platinum_hk | string | 铂金(香港)(港币/两) |
| goldbar | string | 金条(内地)(元/克) |
| goldbar_hk | string | 金条(香港)(港币/两) |
| jewelry | string | 黄金饰品(内地)(元/克) |
| jewelry_hk | string | 黄金饰品(香港)(港币/两) |
| solid_gold | string | 足金价格(元/克) |
<?php
require_once 'curl.func.php';
$date = date('Y-m-d', strtotime("-1 days"));
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.jisuapi.com/gold/storegold?appkey=$appkey&date=".$date;
$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$list = $jsonarr['result']['list'];
foreach($list as $val)
{
echo $val['store_name'].' 金价为:'.$val['gold'].'<br>';
}
// 1. 安装 axios(如果未安装)
// 在终端执行: npm install axios
const axios = require('axios');
// 2. 直接配置参数
const url = 'https://api.jisuapi.com/gold/storegold';
const params = {
appkey: 'your_appkey_here', // 替换成你的真实appkey
};
// 3. 立即发送请求
axios.get(url, { params })
.then(response => {
// 检查API业务状态码
if (response.data.status !== 0) {
console.error('API返回错误:', response.data.status+"-"+response.data.msg);
return;
}
// 输出结果
for (const [key, value] of Object.entries(response.data.result.list)) {
for (const [k, v] of Object.entries(value)) {
console.log(`${k}: ${v}`);
}
}
})
.catch(error => {
// 统一错误处理
console.error('请求失败!');
});
{
"status": 0,
"msg": "ok",
"result": {
"list": [{
"store_name": "周大福",
"date": "2023-09-20",
"gold": "612.00",
"platinum": "387.00",
"platinum_hk": "11170.00",
"goldbar": "602.00",
"goldbar_hk": "19390.00",
"jewelry": "612.00",
"jewelry_hk": "21260.00",
"solid_gold": null
}, {
"store_name": "老凤祥",
"date": "2023-09-20",
"gold": "610.00",
"platinum": "365.00",
"platinum_hk": null,
"goldbar": null,
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": "610.00"
}, {
"store_name": "周六福",
"date": "2023-09-20",
"gold": "613.00",
"platinum": "404.00",
"platinum_hk": null,
"goldbar": "553.00",
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": null
}, {
"store_name": "周生生",
"date": "2023-09-20",
"gold": "609.00",
"platinum": "387.00",
"platinum_hk": "11170.00",
"goldbar": "598.00",
"goldbar_hk": "19390.00",
"jewelry": "609.00",
"jewelry_hk": "21260.00",
"solid_gold": null
}, {
"store_name": "六福珠宝",
"date": "2023-09-20",
"gold": "612.00",
"platinum": "387.00",
"platinum_hk": "11170.00",
"goldbar": "602.00",
"goldbar_hk": "19390.00",
"jewelry": "612.00",
"jewelry_hk": "21260.00",
"solid_gold": null
}, {
"store_name": "菜百",
"date": "2023-09-20",
"gold": "582.00",
"platinum": "358.00",
"platinum_hk": null,
"goldbar": null,
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": "582.00"
}, {
"store_name": "金至尊",
"date": "2023-09-20",
"gold": "612.00",
"platinum": "387.00",
"platinum_hk": null,
"goldbar": null,
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": null
}, {
"store_name": "潮宏基",
"date": "2023-09-20",
"gold": "612.00",
"platinum": "387.00",
"platinum_hk": null,
"goldbar": null,
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": null
}, {
"store_name": "周大生",
"date": "2023-09-20",
"gold": "608.00",
"platinum": "383.00",
"platinum_hk": null,
"goldbar": null,
"goldbar_hk": null,
"jewelry": null,
"jewelry_hk": null,
"solid_gold": null
}]
}
}
| 代号 | 说明 |
|---|---|
| 201 | 没有信息 |
| 代号 | 说明 |
|---|---|
| 101 | APPKEY为空或不存在 |
| 102 | APPKEY已过期 |
| 103 | APPKEY无请求此数据权限 |
| 104 | 请求超过次数限制 |
| 105 | IP被禁止 |
| 106 | IP请求超过限制 |
| 107 | 接口维护中 |
| 108 | 接口已停用 |
添加“金店金价”子接口,可获取近期金店的黄金、铂金、金条、饰品等价格
黄金数据上海黄金交易所数据更新


© 2015-2025 杭州极速互联科技有限公司 版权所有 浙ICP备17047587号-4 浙公网安备33010502005096 增值电信业务经营许可证:浙B2-20190875
