Downloading Search Query Data


After many years of demand by the SEO and webmaster community, Google has finally given us an API option to download search query data from Google Webmaster Tools.

For years now, the drill has been the same. Log into Google Webmaster Tools, navigate to search queries, set the parameters, date range and filters and export data. We were grateful to have an export function in the first place but the way to download data was very restricted and it still is for many things including link data. Now we have an option and it seems they are busy with enabling more. Jonathan Simon, Webmaster Trends Analyst reports on this in detail in Google Webmaster Central [1].

The Python script comes from Webmaster Tools Download Project:

To make use of this facility go to Google Data APIs Python Client Library download and install the library. Add the script to a new folder and copy the following script to it as well. (Customise it to replace the dummy values). Run the script in your Terminal:


You can see your data in Google Docs:

Search Queries API

Use to download the spreadsheet (CSV) without storing it in Google Docs. What’s great about this script is that it can be configured to regularly download and store fresh data ready for manipulation, reports and visualisation.

Watch out for security as this script contains Google account username and password stored. The script uses https as default as the first layer of protection of your data.


[1] Simon, J. – Google Webmaster Central Blog:



Dan Petrovic is a well-known Australian SEO and a managing director of Dejan SEO. He has published numerous research articles in the field of search engine optimisation and online marketing. Dan's work is highly regarded by the world-wide SEO community and featured on some of the most reputable websites in the industry.

More Posts - Website

Copy the code below to your web site.

National Sales Number: 1300 123 736 - International Callers: +61 7 3188 9200

© 2015 DEJAN SEO PTY LTD - ABN:77151340420 - ACN:151340420 - Privacy Policy

Privacy Policy by TRUSTe Google Partner