How to Load Historical Stock Prices from MSN Money to CSV
Updated: August 28, 2019
Contents
- Historical Prices at MSN Money
- Undocumented URLs to Download Historical Prices from MSN Money
- Loading Historical Prices from MSN Money with Batch Files
Historical Prices at MSN Money
MSN Money provides data from a lot of exchanges.
You can open https://www.msn.com/en-us/money, search a ticker like MSFT, and click the 'History' tab.
You can use URLs like https://www.msn.com/en-us/money/stockdetails/history/fi-126.1.MSFT.NAS
or https://www.msn.com/en-us/money/stockdetails/history/fi-MSFT (for US tickers)
to open pages with historical prices directly.
MSN Money has no public links to download historical prices to CSV.
Undocumented URLs to Download Historical Prices from MSN Money
MSN Money uses an internal web service to load historical stock and currency prices in the JSON format into its web pages.
You can use any tool like CURL to download data.
Also, you can use a specialized tool, gsqlcmd, to download and convert JSON data to CSV.
For example, to get daily historical prices, use the command:
gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=MSFT&chartType=1y&isEOD=True&isCS=true&isVol=true" msft.csv ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/
To get weekly historical prices:
gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=MSFT&chartType=5y&isEOD=False&isCS=true&isVol=true" msft-weekly.csv ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/
To get monthly historical prices:
gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=MSFT&chartType=max&isEOD=False&isCS=true&isVol=true" msft-monthly.csv ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/
To get 15-minute historical prices:
gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=MSFT&chartType=5d&isEOD=False&isCS=true&isVol=true" msft-15.csv ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/
To get 5-minute historical prices:
gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=MSFT&chartType=1D_5M&isEOD=False&isCS=true&isVol=true" msft-5.csv ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/
Use the convert mode to download and convert JSON to CSV.
Use the /rootPath=Chart.Series option to point to the JSON root of historical prices.
Use the /referer option to specify the referrer required for MSN web services.
You can download historical prices for currencies also. Just use tickers like 245.20.GBPUSDLITE.
Loading Historical Prices from MSN Money with Batch Files
gsqlcmd allows automating downloads using batch files.
Create a text file like 'task.txt' and place tickers one by line like:
TICKERS.TXT
AAPL FB GOOGL
Create a batch file like 'load.cmd' with the following commands:
LOAD.CMD
@echo off @for /F %%i in (tickers.txt) do ( gsqlcmd convert ^ "http://finance-services.msn.com/Market.svc/ChartAndQuotes?symbols=%%i&chartType=1y&isEOD=True&isCS=true&isVol=true" %%i.CSV ^ /rootPath=Chart.Series /skippedNodes=IsStitched ^ /referer=https://www.msn.com/en-us/money/ ^ /delay=200 /echoOutputFileName )
Run it. You will see the result:
C:>load.cmd
AAPL.CSV - 253 rows FB.CSV - 253 rows GOOGL.CSV - 253 rows
Pay attention to the /delay parameter. Use the delay to avoid banning your IP due to frequent multiple automatic requests.
Downloads
Products for Traders and Investors | |
---|---|
gsqlcmd
This tool downloads, converts, and imports data from Yahoo Finance and MSN Money Version: 6.14 | 05/05/2025 | 14.6MB | www.gsqlcmd.com |
Download |
Disclaimer
MSN is a logo and registered trademark of Microsoft Corporation.