首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >AkShare-货币数据

AkShare-货币数据

作者头像
数据科学实战
发布2020-03-23 14:49:17
发布2020-03-23 14:49:17
98700
代码可运行
举报
文章被收录于专栏:数据科学实战数据科学实战
运行总次数:0
代码可运行
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

比率

接口示例

代码语言:javascript
代码运行次数:0
运行
复制
import akshare as ak
currency_latest_df = ak.currency_latest(base="USD", api_key="Please put your api key here")
print(currency_latest_df)

数据示例

代码语言:javascript
代码运行次数:0
运行
复制
                         date base       rates
AED 2020-03-07 13:45:25+00:00  USD    3.672500
AFN 2020-03-07 13:45:25+00:00  USD   76.099722
ALL 2020-03-07 13:45:25+00:00  USD  108.450334
AMD 2020-03-07 13:45:25+00:00  USD  479.819972
ANG 2020-03-07 13:45:25+00:00  USD    1.786501
..                        ...  ...         ...
XPT 2020-03-07 13:45:25+00:00  USD    0.001113
YER 2020-03-07 13:45:25+00:00  USD  250.279406
ZAR 2020-03-07 13:45:25+00:00  USD   15.667657
ZMW 2020-03-07 13:45:25+00:00  USD   15.245795
ZWD 2020-03-07 13:45:25+00:00  USD  361.899994

货币报价历史数据

接口: 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

比率

接口示例

代码语言:javascript
代码运行次数:0
运行
复制
import akshare as ak
currency_history_df = ak.currency_history(base="USD", date="2020-02-03", api_key="Please put your api key here")
print(currency_history_df)

数据示例

代码语言:javascript
代码运行次数:0
运行
复制
          date base       rates
AED 2020-02-03  USD    3.672500
AFN 2020-02-03  USD   76.350078
ALL 2020-02-03  USD  110.256982
AMD 2020-02-03  USD  478.447633
ANG 2020-02-03  USD    1.790009
..         ...  ...         ...
XPT 2020-02-03  USD    0.001032
YER 2020-02-03  USD  250.312033
ZAR 2020-02-03  USD   14.826424
ZMW 2020-02-03  USD   14.627862
ZWD 2020-02-03  USD  361.899994

货币报价时间序列数据

接口: 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

比率

接口示例

代码语言:javascript
代码运行次数:0
运行
复制
import akshare as ak
currency_time_series_df = ak.currency_time_series(base="USD", start_date="2020-02-03", end_date="2020-03-04", api_key="Please put your api key here")
print(currency_time_series_df)

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

代码语言:javascript
代码运行次数:0
运行
复制
          date base       rates
AED 2020-02-03  USD    3.672500
AFN 2020-02-03  USD   76.350078
ALL 2020-02-03  USD  110.256982
AMD 2020-02-03  USD  478.447633
ANG 2020-02-03  USD    1.790009
..         ...  ...         ...
XPT 2020-02-03  USD    0.001032
YER 2020-02-03  USD  250.312033
ZAR 2020-02-03  USD   14.826424
ZMW 2020-02-03  USD   14.627862
ZWD 2020-02-03  USD  361.899994

货币基础信息查询

接口: 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

使用此货币的国家

接口示例

代码语言:javascript
代码运行次数:0
运行
复制
import akshare as ak
currency_currencies_df = ak.currency_currencies(c_type="fiat", api_key="Please put your api key here")
print(currency_currencies_df)

数据示例

代码语言:javascript
代码运行次数:0
运行
复制
                     currency_name  ...                          countries
AED    United Arab Emirates dirham  ...             [United Arab Emirates]
AFN                 Afghan afghani  ...                      [Afghanistan]
ALL                   Albanian lek  ...                          [Albania]
AMD                  Armenian dram  ...                          [Armenia]
ANG  Netherlands Antillean guilder  ...  [Curaçao (CW), Sint Maarten (SX)]
..                             ...  ...                                ...
XXX                    No currency  ...                                 []
YER                    Yemeni rial  ...                            [Yemen]
ZAR             South African rand  ...   [Lesotho, Namibia, South Africa]
ZMW                 Zambian kwacha  ...                           [Zambia]
ZWL              Zimbabwean dollar  ...                         [Zimbabwe]

货币对价格转换

接口: 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

使用此货币的国家

接口示例

代码语言:javascript
代码运行次数:0
运行
复制
import akshare as ak
currency_convert_se = ak.currency_convert(base="USD", to="CNY", amount="10000", api_key="Please put your api key here")
print(currency_convert_se)

数据示例

代码语言:javascript
代码运行次数:0
运行
复制
timestamp    2020-03-07 13:45:31
date                  2020-03-07
from                         USD
to                           CNY
amount                     10000
value                      69320
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-03-07,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 数据科学实战 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • AkShare 货币数据
    • 货币报价最新数据
    • 货币报价历史数据
    • 货币报价时间序列数据
    • 货币基础信息查询
    • 货币对价格转换
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档