Knowledge Base | How to Load Option Chains from MSN Money to CSV


Option Chains at MSN Money

MSN Money publishes US stock option chains.

You may open, search a ticker like MSFT, and click the 'Options' tab.

You may use URLs like
or to open pages with option chains directly.

MSN Money has no links to download option chains to CSV.

Undocumented URLs to Download Option Chains from MSN Money

MSN Money uses a web service to load option chains into web pages.

The web service returns JSON and has URLs like this:

The challenge is getting expiration dates and parsing JSON to CSV.

Loading Option Chains from MSN Money using gwebcmd

You may use specialized download and parser utilities like gwebcmd to download and convert JSON data to CSV.

Create a text file like 'tickers.txt' and place ticker and expiration date pairs one by line like:

AAPL    20180119
AAPL    20180216
AAPL    20180615
AAPL    20190118

Create a batch file like 'load.cmd' with the following commands:

@echo off

@for /F "tokens=1,* delims= " %%i in (tickers.txt) do (
    gwebcmd webtotext "" src\%%i-%%j.JSON /delay=200 /echoUrl

gwebcmd texttocsv src\*.json csv\*.csv ^
    "/add=Symbol=FileNameWithoutPage();LoadDate=FileDateTime();ExpDate=FileNameDate();Type=C" ^
    /quoteChar= /DateFormat=yyyy-MM-dd /echoInputFileName /rootPath=C

gwebcmd texttocsv src\*.json csv\*.csv ^
    "/add=Symbol=FileNameWithoutPage();LoadDate=FileDateTime();ExpDate=FileNameDate();Type=P" ^
    /quoteChar= /DateFormat=yyyy-MM-dd /echoInputFileName /rootPath=P /Append

Run it. You will see the result like this:

C:>load.cmd - ok - ok - ok - ok
AAPL-20180119.JSON - 72 rows
AAPL-20180216.JSON - 35 rows
AAPL-20180615.JSON - 37 rows
AAPL-20190118.JSON - 43 rows
AAPL-20180119.JSON - 72 rows
AAPL-20180216.JSON - 35 rows
AAPL-20180615.JSON - 37 rows
AAPL-20190118.JSON - 43 rows

The batch file contains the @for command to download data for every ticker and expiration date pair.

gwebcmd "knowns" this URL and converts dates in the yyyyMMdd format to the required M/d/yyyy.

Also, the batch file contains two commands that parse loaded JSON data to CSV, for CALL and PUT sections.

To get suitable data for further import to a database, you have to add the symbol, expiration date, option types that are absent in raw data.

In gwebcmd, you may do this using the /add option.

Below is a result example:

AAPL;2017-06-01 19:24:16;2018-01-19;C;2.5;151;-2.13;-0.0139;decrease;1.44;151.15;151.8;6;6
AAPL;2017-06-01 19:24:16;2018-01-19;C;5;147.98;147.98;;increase;1.44;148.65;149.3;8;
AAPL;2017-06-01 19:24:16;2018-01-19;C;7.5;;;;unchanged;;146.15;146.85;0;

Downloading Option Chains from MSN Money using Market.csv

Market.csv is a specialized tool for loading data from Yahoo Finance, Google Finance, and MSN Money.

Market.csv loads and parses expiration dates from the MSN Money web pages before loading JSON option data.

So, you may place just the required tickers to a file like tickers.txt.


Then you execute commands to download data using the required data providers:

market.csv.exe download MsnMoneyOptions

The tool downloads data, archives the data to zip files and converts the data to CSV.

You may get results for all stocks with all expiration dates in the MsnMoneyOptions.csv output file.

Moreover, Market.csv includes ready-to-use SQL codes and format files to import CSV data into a Microsoft SQL Server database.


Products for Option Traders
WEB.CSV aka gwebcmd
The app loads data from the web (HTML, XML, JSON, and CSV) into CSV
Version: 4.6 | 08/22/2017 | 1.4MB | Home | What's New | Editions
The app loads data from Yahoo Finance, Google Finance, and MSN Money to CSV and databases
Version: 2.5 | 08/22/2017 | 0.9MB | Home | What's New | Editions


MSN is a logo and registered trademark of Microsoft Corporation.

Share This