get Google option chain

Hi, I'm trying to retrieve Google option chain by linux c++. Unfortunately the website uses Ajax and the program could only get the static webpage.

1. Is there anyway to retrieve the data?
2. Alternatively, is there any good source of option chain?

Thanks!
 
here's an easy way to do it.
Code:
import demjson,urllib2
def getOptionChain():
    url='http://www.google.com/finance/option_chain?q=AAPL&output=json'
    ii=urllib.urlopen(url).readline()
    ii = demjson.decode(ii)

you could wrap this in c++ and then execute a python interpreter to run it :p
 
Quote from 2rosy:

here's an easy way to do it.
Code:
import demjson,urllib2
def getOptionChain():
    url='http://www.google.com/finance/option_chain?q=AAPL&output=json'
    ii=urllib.urlopen(url).readline()
    ii = demjson.decode(ii)

you could wrap this in c++ and then execute a python interpreter to run it :p

Or even better use one of the open source c++ JSON libraries available on the internet.
 
Quote from 2rosy:

here's an easy way to do it.
Code:
import demjson,urllib2
def getOptionChain():
    url='http://www.google.com/finance/option_chain?q=AAPL&output=json'
    ii=urllib.urlopen(url).readline()
    ii = demjson.decode(ii)

you could wrap this in c++ and then execute a python interpreter to run it :p


Thanks 2rosy. I tried this but it only returns the most close expiry option data.
Is there any way to retrieve the next two months option chain? Or am I wrong?
 
YQL option chain is not accurate. I found some data inconsistent with nasdaq.com which is supposed to be correct.

So this problem is re-opened. Still need help to retrieve the whole accurate option chain from somewhere.
 
Quote from stevegee58:

If you have an account with IB you can download the option chain through their API quite easily.

Ye, this is one way. Actually my purpose is to re-organize the data on a web server which is running CentOS. I can get IB data on my laptop but can't do it on the server. Want to know if there is any option chain Web API...
 
I purchased Options data from ivolatility.com and loaded the CSV files into a database. I'm not sure if they have an API for the Historical Data, though. I have looked at their SDK briefly and it seems to address only Real Time data...
 
Quote from TigerBalm:

I purchased Options data from ivolatility.com and loaded the CSV files into a database. I'm not sure if they have an API for the Historical Data, though. I have looked at their SDK briefly and it seems to address only Real Time data...

Thanks. Real-time data is fine. May I retrieve the option chain at any time when market is open for a real-time snapshot?
 
Back
Top