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

2

7

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.

Guib answered 31/7, 2016 at 1:42 Comment(0)
I
12

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

Israel answered 25/10, 2016 at 15:26 Comment(2)
This is awesome. Can you provide some more details on the type of query parameters that can be passed ? Is there any documentation available for this ?Aerobe
@Aerobe did you find the query params you can pass?Hemline
E
1

There is a problem with the Yahoo finance API, they said something like they wasn't developing the finance tables for YQL... i'm researching a lot for getting that data here is something that maybe could help you:

edit: that link was for all company's option... Maybe this one could help:

https://query2.finance.yahoo.com/v7/finance/chart/ACAD160805C00029000?range=5d&interval=5m&includeTimestamps=false&corsDomain=finance.yahoo.com

Erethism answered 3/8, 2016 at 18:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.