Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
6.6k views
in Technique[技术] by (71.8m points)

How can I download option tables using the yahoo finance api?

Yahoo Finance changed its web page formats last week (again) and the data isn't copyable, downloadable, or scrapeable, since the data is apparently loaded indirectly. (I can see it in the debugger.)

The Yahoo Finance API doesn't currently return option data for a single option symbol, much less tables of or for expiration dates, nor apparently does YQL.

Has anyone successfully downloaded or scraped Options data from Yahoo finance in the past week? If so, how?

It probably isn't relevant, but I mainly use perl.

This question is about programming, since surely downloading data is part of programming.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I have found an API that works since the change in Yahoo Finance. I'm still trying to find any clues to other APIs available.

Here's the base call. The {} is for either the number 1 or 2 as both work: query{}.finance.yahoo.com/v7/finance/

Now, as @Yago notes, you can append chart/ and you can also append options/. I'm looking for other options to append. Specifically I'd like to find Fundamental and Technical analysis like you can get from this oldie but goodie: http://finance.yahoo.com/d/quotes.csv?s=amd&f=nb4t8 (which returns: n=Name; b4=book value; t8=1yr target price)

The /v7 returns JSON which is nice. Thanks.

And to actually answer your question about option chains: https://query{1|2}.finance.yahoo.com/v7/finance/options/{ticker} you can also add a specific epoch date (with Hour,Min,Sec as zeros which will match up with output from Yahoo Finance) of an option expiry: https://query2.finance.yahoo.com/v7/finance/options/amd?date=1487289600


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...