首页 文章

Google Search Console API - SearchAnalytics 500错误

提问于
浏览
2

我正在尝试使用SearchAnalyticsQuery从Search Console Api中获取一些数据 .

首先我用PHP尝试过:

$this->client->setAccessToken( \Session::get('access_token') );

        $webmaster =  new \Google_Service_Webmasters( $this->client );

        $q = new \Google_Service_Webmasters_SearchAnalyticsQueryRequest();

        $q->setStartDate('2015-01-01');

        try {

            $webmaster->searchanalytics->query('http://example.com', $q);

        } catch(\Exception $e )
        {
            dd($e);
        }

我有一个有效的令牌,它执行请求但总是返回以下内容:

Error calling POST https://www.googleapis.com/webmasters/v3/sites/example.com/searchAnalytics/query: (500) Backend Error

为了确保它不是由PHP代码引起的,我还尝试使用Google Api Explorer .

这里的结果相同:http://i.imgur.com/Qrm3VhS.png

我目前正在使用https://github.com/google/google-api-php-client的dev-master版本

一定有什么我做错了,我只是想弄清楚 .

1 回答

相关问题