Google Webmaster Tools API: Downloading queries via OAUTH2

别等时光非礼了梦想. 提交于 2019-12-07 08:44:19

问题


I'm trying to use Google's Webmaster Tools API to download a CSV file of recent search queries.

I know how to do that using their Python example at http://googlewebmastercentral.blogspot.com/2011/12/download-search-queries-data-using.html

But I want to use OAUTH2.

Here's the problem: The download url for CSV downloads is:

/webmasters/tools/downloads-list?hl=%s&siteUrl=%s

But the Google data API only lets me use OAUTH2 against: /webmasters/tools/feeds/sites/

So the token I get when I authenticate doesn't provide access.

It SEEMS insane that they'd have some of their data available via OAUTH2 and some of it only using username/password.

Does anyone know a request URI I can use to download the query report via OAUTH2? Or is this API as nuts as it seems?


回答1:


My $.02 would be "yes, it IS as nuts as it seems."

If you look at the Google APIs Console (https://code.google.com/apis/console) the Webmaster Tools API is conspicuously absent.

I attempted to go down the same road & use OATH2 for the GWT API & was not able to make it work. Using the 'basic authentication' was the only solution.

edit April 2015: basic authentication has been withdrawn by Google and no longer works




回答2:


I just ran into this, I am shure it has to be possible with OAuth2, corresponding to this sentence:

Activate the Google Site Verification API in the Services pane of the Google APIs Console. (If it isn't listed in the Console, then skip this step.)

https://developers.google.com/site-verification/v1/getting_started



来源:https://stackoverflow.com/questions/16157170/google-webmaster-tools-api-downloading-queries-via-oauth2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!