雅虎财经 API 变更(2017 年) [英] Yahoo Finance API changes (2017)

查看:26
本文介绍了雅虎财经 API 变更(2017 年)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从雅虎财经请求数据似乎已更改或现已被阻止.以下商品数据请求自 2017 年 5 月起不再有效.有谁知道是否有新的方式来提出此请​​求?

Requesting data from Yahoo Finance seems to have changed or is now blocked. The request below for commodity data no longer works as of May 2017. Does anyone know if there is a new way to make this request?

http://chartapi.finance.yahoo.com/instrument/1.0/GCQ17.CMX/chartdata;type=quote;range=10d/csv/

推荐答案

首先,旧的雅虎财经 iChart 下载已经一去不复返了.在其中一个论坛帖子中,雅虎员工已确认免费 EOD 数据已终止,不会重新引入.看看这个 thread 并寻找尼克松的回复.雅虎最近被Verizon收购,必定是新方向.

First, the old Yahoo finance iChart download is gone for good. In one of the forum posts, a Yahoo employee has confirmed that the free EOD data has been terminated, and will not be reintroduced. Check out this thread and look for reply from Nixon. Yahoo is recently acquired by Verizon, and it must be the new direction.

但是,如果您查看 Yahoo 财务页面,则 CSV 下载链接有效,但现在有所不同.这是通过一个新的 API 使用身份验证令牌crumb",当您访问页面时,该令牌链接到 cookie.

However, if you check the Yahoo financial page, the CSV download link works, though differently now. It is through a new API that uses an authentication token "crumb" that is linked to a cookie when you access the page.

因此,有一种变通方法可以通过这个新 API 获得与以前相同的 CSV 下载.我已经整理了一些快速的 Python3 代码.请查看 GitHub 以获取源代码 yahoo_quote_download.

So there is a work-around to get the same CSV download as before through this new API. I have put together some quick Python3 code. Please check out GitHub for source code yahoo_quote_download.

这篇关于雅虎财经 API 变更(2017 年)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆