汇率的查询接口

x33g5p2x  于2022-07-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(333)

项目中使用到汇率,需要能有一个接口进行查询,而查询汇率最权威的应该就是中国外汇交易中心

官网地址:

https://www.chinamoney.com.cn/chinese/index.html

通过F12就可以查看网站的汇率接口;

https://www.chinamoney.com.cn/ags/ms/cm-u-bk-ccpr/CcprHisNew?startDate=2022-05-30&endDate=2022-06-29&currency=USD/CNY&pageNum=1&pageSize=10

查询出来的结果:

{
	"head": {
		"version": "2.0",
		"provider": "CWAP",
		"req_code": "",
		"rep_code": "200",
		"rep_message": "",
		"ts": 1656598274022,
		"producer": "",
		"tstext": "2022-06-30 22:11:14"
	},
	"data": {
		"total": 22,
		"startDate": "2022-05-30",
		"pageTotal": 3,
		"searchlist": ["USD/CNY"],
		"pageSize": 10,
		"endDate": "2022-06-29",
		"flagMessage": "",
		"head": ["USD/CNY", "EUR/CNY", "100JPY/CNY", "HKD/CNY", "GBP/CNY", "AUD/CNY", "NZD/CNY", "SGD/CNY", "CHF/CNY", "CAD/CNY", "CNY/MYR", "CNY/RUB", "CNY/ZAR", "CNY/KRW", "CNY/AED", "CNY/SAR", "CNY/HUF", "CNY/PLN", "CNY/DKK", "CNY/SEK", "CNY/NOK", "CNY/TRY", "CNY/MXN", "CNY/THB"],
		"currency": "USD/CNY",
		"pageNum": 1
	},
	"records": [{
		"date": "2022-06-29",
		"values": ["6.7035"]
	}, {
		"date": "2022-06-28",
		"values": ["6.6930"]
	}, {
		"date": "2022-06-27",
		"values": ["6.6850"]
	}, {
		"date": "2022-06-24",
		"values": ["6.7000"]
	}, {
		"date": "2022-06-23",
		"values": ["6.7079"]
	}, {
		"date": "2022-06-22",
		"values": ["6.7109"]
	}, {
		"date": "2022-06-21",
		"values": ["6.6851"]
	}, {
		"date": "2022-06-20",
		"values": ["6.7120"]
	}, {
		"date": "2022-06-17",
		"values": ["6.6923"]
	}, {
		"date": "2022-06-16",
		"values": ["6.7099"]
	}]
}

相关文章