【问题标题】:How get period index status google api?如何获取期间索引状态google api?
【发布时间】:2018-01-04 14:41:38
【问题描述】:

debug($sitemaps->listSitemaps("http://example.com", ['内容'=> '索引']));

返回

object(Google_Service_Webmasters_SitemapsListResponse) {
    [protected] collection_key => 'sitemap'
    [protected] internal_gapi_mappings => array()
    [protected] sitemapType => 'Google_Service_Webmasters_WmxSitemap'
    [protected] sitemapDataType => 'array'
    [protected] modelData => array(
        'sitemap' => array(
            (int) 0 => array(
                'path' => 'http://example.com/sitemap.xml',
                'lastSubmitted' => '2017-12-31T17:06:56.592Z',
                'isPending' => false,
                'isSitemapsIndex' => false,
                'type' => 'sitemap',
                'lastDownloaded' => '2018-01-03T11:42:39.262Z',
                'warnings' => '0',
                'errors' => '0',
                'contents' => array(
                    (int) 0 => array(
                        'type' => 'web',
                        'submitted' => '4',
                        'indexed' => '0'
                    )
                )
            )
        )
    )
    [protected] processed => array()
}

modeldata 应该返回一个包含日期和索引值的数据数组

【问题讨论】:

    标签: google-search-console google-api-webmasters


    【解决方案1】:

    我担心它还不是 Search Console API 的一部分。 Google 产品论坛上也有这个帖子:https://productforums.google.com/forum/?hl=en#!topic/webmasters/KIUsaXpquKY;context-place=topicsearchin/webmasters/category$3Awebmaster-tools%7Csort:relevance%7Cspell:false

    从那以后我没有看到任何变化,所以如果我是你,我不会屏住呼吸。

    您可以从 API 中获得的最接近某个数字(表示被 Google 索引的页面数量)是对您提交的所有站点地图和/或站点地图索引的所有 contents[].indexed 求和。可能您只提交了一个引用所有站点地图的站点地图索引,因此如果您使用 Sitemaps:get (https://developers.google.com/webmaster-tools/search-console-api-original/v3/sitemaps/get) 请求该索引,您将获得被索引的页面总数。

    但该数字与实际索引状态的相关性很差,您可以在 Search Console 用户界面中以我无法正确理解的方式找到它。

    我认为,如果您的 sitemap.xml 包含您网站的每个页面,contents[].indexed 的总和将与索引页面的总数非常接近。好像不是这样的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-27
      • 1970-01-01
      • 1970-01-01
      • 2012-08-29
      • 1970-01-01
      • 1970-01-01
      • 2021-04-13
      • 1970-01-01
      相关资源
      最近更新 更多