Get Financial Option Data with YQL

2019-03-20 11:37发布

I am using YQL to retrieve Financial Option data. Something like:

select * from yahoo.finance.options where symbol="AAPL" and expiration="2011-07"

However, the above query returns an optionsChain of data.

Is there a way to retrieve just the record for a specific option symbol, e.g. symbol=AAPL110716C00155000?

Thanks for your time.

2条回答
Root(大扎)
2楼-- · 2019-03-20 12:01

I just got all the optionsChain of data by :

select * from yahoo.finance.options where symbol="A" and expiration="2012-10"

And, then just used a JSON Parser to parse the optionsChain's data and got my desired data.

查看更多
成全新的幸福
3楼-- · 2019-03-20 12:16

You can apply a "local filter", for your desired symbol, on the result set brought back from yahoo.finance.options in addition to the "remote filters" (symbol and expiration).

select option
from yahoo.finance.options
where symbol = "AAPL" 
  and expiration = "2011-07" 
  and option.symbol = "AAPL110716C00155000" 

For more info on filtering query results see the Filtering Query Results (WHERE) page in the YQL documentation.

查看更多
登录 后发表回答