AkShare

作者寄语

这几天都在规范各种自动化工具和文档,今天更新一个货币接口,可以查询世界各种货币的实时价格、历史价格和货币对转换。做外汇的小伙伴可以关注下,目前本接口可以在原网站注册后免费试用 5000 次每月,大规模提取原网站就会收费。小规模自己使用的可以考虑下。更多正在开发中的数据接口,请访问 AkShare 查看。

AkShare-更新记录

  • "currency_latest"  # 最新货币报价

  • "currency_history"  # 指定历史日期的所有货币报价

  • "currency_time_series"  # 指定日期间的时间序列数据-需要权限

  • "currency_currencies"  # 查询所支持的货币信息

  • "currency_convert"  # 货币换算

AkShare 货币数据

货币报价最新数据

接口: currency_latest

目标地址: https://currencyscoop.com/

描述: 获取货币报价最新数据

限量: 单次返回指定货币的最新报价数据-免费账号每月限量访问 5000 次

输入参数

名称

类型

必选

描述

base

str

Y

base="USD"

api_key

str

Y

api_key="Please put your api key here"; you can register currencyscoop, Gmail well be better

输出参数

名称

类型

默认显示

描述

date

str

Y

日期时间-注意时区

base

float

Y

货币

rates

str

Y

比率

接口示例

import akshare as ak

数据示例

                         date base       rates

货币报价历史数据

接口: currency_history

目标地址: https://currencyscoop.com/

描述: 获取货币报价历史数据

限量: 单次返回指定货币在指定交易日的报价历史数据-免费账号每月限量访问 5000 次

输入参数

名称

类型

必选

描述

base

str

Y

base="USD"

date

str

Y

date="2020-02-03"

api_key

str

Y

api_key="Please put your api key here"; you can register currencyscoop, Gmail well be better

输出参数

名称

类型

默认显示

描述

date

str

Y

日期时间-注意时区

base

float

Y

货币

rates

str

Y

比率

接口示例

import akshare as ak

数据示例

          date base       rates

货币报价时间序列数据

接口: currency_time_series

目标地址: https://currencyscoop.com/

描述: 获取货币报价时间序列数据

限量: 单次返回指定货币在指定交易日到另一指定交易日的报价数据-免费账号每月限量访问 5000 次

输入参数

名称

类型

必选

描述

base

str

Y

base="USD"

start_date

str

Y

start_date="2020-02-03"

end_date

str

Y

end_date="2020-03-04"

api_key

str

Y

api_key="Please put your api key here"; you can register currencyscoop, Gmail well be better

输出参数

名称

类型

默认显示

描述

date

str

Y

日期时间-注意时区

base

float

Y

货币

rates

str

Y

比率

接口示例

import akshare as ak

数据示例(由于没有权限,此示例仅作占位)

          date base       rates

货币基础信息查询

接口: currency_currencies

目标地址: https://currencyscoop.com/

描述: 获取所有货币的基础信息

限量: 单次返回指定所有货币基础信息-免费账号每月限量访问 5000 次

输入参数

名称

类型

必选

描述

c_type

str

Y

c_type="fiat"

api_key

str

Y

api_key="Please put your api key here"; you can register currencyscoop, Gmail well be better

输出参数

名称

类型

默认显示

描述

currency_name

str

Y

货币名称

currency_code

str

Y

货币代码

decimal_units

int

Y

小数点位

countries

str

Y

使用此货币的国家

接口示例

import akshare as ak

数据示例

                     currency_name  ...                          countries

货币对价格转换

接口: currency_convert

目标地址: https://currencyscoop.com/

描述: 获取指定货币对指定货币数量的转换后价格

限量: 单次返回指定货币对的转换后价格-免费账号每月限量访问 5000 次

输入参数

名称

类型

必选

描述

base

str

Y

base="USD"

to

str

Y

to="CNY"

amount

str

Y

amount="10000"

api_key

str

Y

api_key="Please put your api key here"; you can register currencyscoop, Gmail well be better

输出参数

名称

类型

默认显示

描述

currency_name

str

Y

货币名称

currency_code

str

Y

货币代码

decimal_units

int

Y

小数点位

countries

str

Y

使用此货币的国家

接口示例

import akshare as ak

数据示例

timestamp    2020-03-07 13:45:31

本文分享自微信公众号 - 数据科学实战(dsaction)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

评论

暂无评论