get Google option chain

Discussion in 'App Development' started by dangqiwu, Dec 6, 2013.

  1. dangqiwu

    dangqiwu

    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!
     
  2. 2rosy

    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
     
  3. Or even better use one of the open source c++ JSON libraries available on the internet.
     
  4. dangqiwu

    dangqiwu


    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?
     
  5. dangqiwu

    dangqiwu

    finally I move to YQL and this is solved.
     
  6. dangqiwu

    dangqiwu

    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.
     
  7. If you have an account with IB you can download the option chain through their API quite easily.
     
  8. dangqiwu

    dangqiwu

    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...
     
  9. 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...
     
  10. dangqiwu

    dangqiwu

    Thanks. Real-time data is fine. May I retrieve the option chain at any time when market is open for a real-time snapshot?
     
    #10     Dec 14, 2013