{"id":24631,"date":"2011-12-22T00:00:00","date_gmt":"2011-12-22T00:00:00","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/download-search-queries-data-using-python\/"},"modified":"2011-12-22T00:00:00","modified_gmt":"2011-12-22T00:00:00","slug":"download-search-queries-data-using-python","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/download-search-queries-data-using-python\/","title":{"rendered":"Download search queries data using Python"},"content":{"rendered":"<aside class=\"key-point\">It&#8217;s been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore). Read the up-to-date documentation about how you can <a href=\"https:\/\/support.google.com\/webmasters\/topic\/12920294\" class=\"external-link\">bulk export your Search Console data<\/a>.<br \/>\n<\/aside>\n<p class=\"gargardate\">Thursday, December 22, 2011<\/p>\n<p>\n  For all the developers who have expressed interest in getting programmatic access to the search<br \/>\n  queries data for their sites in Webmaster Tools, we&#8217;ve got some good news. You can now get access<br \/>\n  to your search queries data in<br \/>\n  <a href=\"https:\/\/en.wikipedia.org\/wiki\/Comma-separated_values\" class=\"external-link\">CSV format<\/a><br \/>\n  using a open source Python script  from the<br \/>\n  <a href=\"https:\/\/code.google.com\/p\/webmaster-tools-downloads\/\" class=\"external-link\">webmaster-tools-downloads<\/a><br \/>\n  project. Search queries data is not currently available via the Webmaster Tools API, which has<br \/>\n  been a common API user request that we&#8217;re considering for the next API update. For those of you<br \/>\n  who need access to search queries data right now, let&#8217;s look at an example of how the search<br \/>\n  queries downloader Python script can be used to download your search queries data and upload it<br \/>\n  to a Google Spreadsheet in Google Docs.\n<\/p>\n<h2 id=\"example-usage-of-the-search-queries-downloader-python-script\" tabindex=\"-1\">Example usage of the search queries downloader Python script<\/h2>\n<ol>\n<li>\n    If Python is not already installed on your machine, download and install<br \/>\n    <a href=\"https:\/\/python.org\/download\/\" class=\"external-link\">Python<\/a>.\n  <\/li>\n<li>\n    Download and install the<br \/>\n    <a href=\"https:\/\/code.google.com\/apis\/gdata\/articles\/python_client_lib\" class=\"external-link\">Google Data APIs Python Client Library<\/a>.\n  <\/li>\n<li>\n    Create a folder and add the<br \/>\n    <a href=\"https:\/\/code.google.com\/p\/webmaster-tools-downloads\/source\/browse\/downloader.py\" class=\"external-link\"><code>downloader.py<\/code><\/a><br \/>\n    script to the newly created folder.\n  <\/li>\n<li>\n    Copy the<br \/>\n    <a href=\"https:\/\/code.google.com\/p\/webmaster-tools-downloads\/source\/browse\/example-create-spreadsheet.py\" class=\"external-link\"><code>example-create-spreadsheet.py<\/code><\/a><br \/>\n    script to the same folder as <code>downloader.py<\/code> and edit it to replace the example<br \/>\n    values for <code>website<\/code>, <code>email<\/code> and <code>password<\/code> with valid values<br \/>\n    for your Webmaster Tools verified site.\n  <\/li>\n<li>\n    Open a Terminal window and run the <code>example-create-spreadsheet.py<\/code> script by entering<br \/>\n    <code>python example-create-spreadsheet.py<\/code> at the terminal window command line.\n  <\/li>\n<li>Visit Google Docs to see a new spreadsheet containing your search queries data.<\/li>\n<\/ol>\n<p><img decoding=\"async\" alt=\"Top Search Queries data exported to Google Sheets\" src=\"https:\/\/alienroad.com\/wp-content\/uploads\/kb-gorsel\/g-efa1ab9abd90.png\" loading=\"lazy\"><\/p>\n<p>\n  If you just want to download your search queries data in a .csv file without uploading the data to<br \/>\n  a Google spreadsheet use<br \/>\n  <a href=\"https:\/\/code.google.com\/p\/webmaster-tools-downloads\/source\/browse\/example-simple-download.py\" class=\"external-link\"><code>example-simple-download.py<\/code><\/a><br \/>\n  instead of <code>example-create-spreadsheet.py<\/code> in the example above.\n<\/p>\n<p>\n  You could easily configure these scripts to be run daily or monthly to archive and view your<br \/>\n  search queries data across larger date ranges than the current one month of data that is available<br \/>\n  in Webmaster Tools, for example, by setting up a cron job or using Windows Task Scheduler.\n<\/p>\n<p>\n  An important point to note is that this script example includes user name and password credentials<br \/>\n  within the script itself. If you plan to run this in a production environment you should follow<br \/>\n  security best practices like using encrypted user credentials retrieved from a secure data storage<br \/>\n  source. The script itself uses HTTPS to communicate with the API to protect these credentials.\n<\/p>\n<p>\n  Take a look at the search queries downloader script and start using search queries data in your<br \/>\n  own scripts or tools. Let us know if you have questions or feedback in the<br \/>\n  <a href=\"https:\/\/support.google.com\/webmasters\/community\/label?lid=462896acb3879639&amp;hl=en\" class=\"external-link\">Webmaster Help Forum<\/a>.\n<\/p>\n<p class=\"byline-author\">\n  Written by<br \/>\n  <a href=\"https:\/\/developers.google.com\/search\/blog\/authors\/jonathan-simon\" rel=\"author\" class=\"external-link\">Jonathan Simon<\/a>,<br \/>\n  Webmaster Trends Analyst<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a while since we published this blog post. Some of the information may be outdated (for example, some images may be missing, and some links may not work anymore). Read the up-to-date documentation about how you can bulk export your Search Console data. Thursday, December 22, 2011 For all the developers who have [&hellip;]<\/p>\n","protected":false},"menu_order":84670,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[665],"ar_kb_etiket":[],"class_list":["post-24631","ar_kb","type-ar_kb","status-publish","has-post-thumbnail","hentry","ar_kb_kategori-blog"],"_links":{"self":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb"}],"about":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/types\/ar_kb"}],"version-history":[{"count":0,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/24631\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/26911"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=24631"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=24631"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=24631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}