织梦CMS - 轻松建站从此开始!

欧博ABG-会员注册-官网网址

KB: Load Historical Prices from Google Finance to

时间:2025-08-24 10:52来源: 作者:admin 点击: 9 次
Discover how to export historical stock prices from Google Finance to CSV files using command prompts and batch files. Explore free alternatives!

Knowledge Base | How to Export Historical Stock Prices from Google Finance to CSV

How to Export Historical Stock Prices from Google Finance to CSV

Updated: August 28, 2019

This article is archived. Google stopped publishing finance data via API in 2018.

You have free alternatives: MSN Money and Yahoo Finance.

If you are looking for historical stock prices in Microsoft Excel, try Market RTD.

Download Market RTD

You will find workbook samples that show how to load historical and intraday prices, financial data and statistics, US stock options.

If you are looking for CSV data, you can read these articles:

Contents

Historical Prices at Google Finance

You can open https://www.google.com/finance/, search a ticker like GOOGL, and click the 'Historical prices' link on the left panel.

You can use URLs like https://www.google.com/finance/historical?q=GOOGL to open pages with historical prices directly.

You can download the historical prices to a CSV file using the 'Download to spreadsheet' link on the right panel.

You can download data for the required selected period.
Unfortunately, Google allows loading historical prices using download utilities for the one last year only.

URLs to Download Historical Prices from Google Finance

You can download historical prices from Google Finance with download utilities using URLs like this:

?q=GOOGL&output=csv

You can use any free tool like CURL to download data.

We recommend you try gsqlcmd, a specialized download and parser utility.

For example, you can download data using the command like this:

gsqlcmd convert "?q=GOOGL&output=csv" googl.csv /add=Symb=GOOGL /quoteChar=

gsqlcmd has special useful options like /add and /quoteChar to convert loaded data.

For example, the source data look like this:

Date,Open,High,Low,Close,Volume 19-May-17,952.82,959.56,952.00,954.65,1360299 18-May-17,943.20,954.18,941.27,950.50,1800465 17-May-17,959.70,960.99,940.06,942.17,2449058

The result of gsqlcmd looks like this:

Symb;Date;Open;High;Low;Close;Volume GOOGL;2017-05-19;952.82;959.56;952;954.65;1360299 GOOGL;2017-05-18;943.2;954.18;941.27;950.5;1800465 GOOGL;2017-05-17;959.7;960.99;940.06;942.17;2449058

So, you can get CSV data suitable for further import to a database without additional conversions.

Loading Historical Prices from Google Finance with Batch Files

You can create a simple batch file to load historical prices for a list of tickers with any command line download utility.

Create a text file like 'tickers.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 "?q=%%i&output=csv" %%i.CSV ^ /add=Symb=%%i /quoteChar= /delay=200 /echoOutputFileName )

Run it. You will see the result:

C:>load.cmd AAPL.CSV - 251 rows FB.CSV - 251 rows GOOGL.CSV - 251 rows

Pay attention to the /delay parameter. Use the delay to avoid banning your IP due to frequent multiple automatic requests.

Undocumented URLs to Download Historical Prices from Google Finance

Google has an undocumented web service that returns historical and intraday prices in a specific text format.

You can download data. However, you need a special parser to convert results to CSV.

URLs for daily and weekly historical prices:

?q=GOOGL&i=86400&p=1Y&f=d,c,v,o,h,l ?q=GOOGL&i=604800&p=10Y&f=d,c,v,k,o,h,l

URLs for 1, 5, 15, 30, and 60-minute intraday prices:

?q=GOOGL&i=60&p=1d&f=d,c,v,o,h,l ?q=GOOGL&i=300&p=5d&f=d,c,v,o,h,l ?q=GOOGL&i=900&p=5d&f=d,c,v,o,h,l ?q=GOOGL&i=1800&p=30d&f=d,c,v,o,h,l ?q=GOOGL&i=3600&p=30d&f=d,c,v,o,h,l

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 |

  Download  

Disclaimer

Google Finance is a logo and registered trademark of Google Inc.

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-08-26 03:08 最后登录:2025-08-26 03:08
栏目列表
推荐内容