One question that I'm often asked is what are my data sources. In order to keep the information here free, I don't pay for data. Instead I get it from free sources.
My primary source for option data is Google Finance. Yes, you that right, Google Finance. Google official retired thier finance data some years ago. But the API is still available. It's a REST API and all you need to supply is a URL, a ticker symbol and data format. For example the link below will return the most recent option data for AAPL in json format.
Google finance is pretty reliable. It's rarely down. As long as you collect the data every day you can build a database of historical option data. That's exactly what I've done for the S&P500 stocks.
One problem is that Google doesn't offer ETF data like SPY. SPY in the S&P500 ETF. It's perhaps the most ticker on this website. If you want to get options for it, you have to another data source.
Yahoo Finance is another free option data source. It does offer data on ETFs like SPY and QQQ. Yahoo offers an API and you also scrape their HTML finance pages. The only problem is Yahoo is often down. That's why it's my alternate data source. i find the HTML is more reliable than the API. You can see the Yahoo SPY data using the link below.
The process is to first get the option dat from Google. If that fails, then scrape the HTML from Yahoo. If that fails, then use the Yahoo API. It makes three different attempts to ge the data from multiple sources.
I do cache the data in my database. I only scrape every two hours. If the data is less than two hours old, I simply display from my database. If it's over two hours old, I scrape it and save to the database. The volume is the only option data updated intra-day. Open Interest is updated once daily.