{"id":25169,"date":"2020-12-09T00:00:00","date_gmt":"2020-12-09T00:00:00","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/updates-to-search-consoles-api\/"},"modified":"2020-12-09T00:00:00","modified_gmt":"2020-12-09T00:00:00","slug":"updates-to-search-consoles-api","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/updates-to-search-consoles-api\/","title":{"rendered":"Updates to Search Console&#8217;s API"},"content":{"rendered":"<p class=\"gargardate\">Wednesday, December 9, 2020<\/p>\n<p>\nA few months ago we announced an <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/search-console-api-announcements\/\">API infrastructure upgrade<\/a><br \/>\n  to improve the performance of the <a href=\"https:\/\/developers.google.com\/webmaster-tools\">Search Console API<\/a> as demand grows. Today we&#8217;re happy to announce<br \/>\n  some more updates coming your way:\n<\/p>\n<ul>\n<li>Addition of fresh data and news filter in the Search Console API<\/li>\n<li>Domain property support in the Sitemaps API<\/li>\n<li>Guidelines on how to <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/search-console-api-announcements\/#discovery-document-changes\" class=\"external-link\">migrate the Discovery doc<\/a><\/li>\n<\/ul>\n<p>\nIf you make your own calls to the API, read on.\n<\/p>\n<h2 id=\"fresh-data-and-news-filter-in-the-search-console-api\" tabindex=\"-1\">Fresh data and news filter in the Search Console API<\/h2>\n<p>\n  The <a href=\"https:\/\/support.google.com\/webmasters\/answer\/7576553\" class=\"external-link\">Performance report<\/a> already supports fresh data that is less than a day old. You can now access this data through the API by passing the request parameter<br \/>\n  <code>dataState<\/code> with value set to <code>all<\/code>. The data you get for this value will also include fresh data that is not yet final. If you wish to get only final data,<br \/>\n  you can either pass this parameter with value set to <code>final<\/code> or not pass it at all and you will get only final data by default.\n<\/p>\n<p>\nA few months ago, we added a <a href=\"https:\/\/twitter.com\/googlesearchc\/status\/1285559587576467456\" class=\"external-link\">News tab on Search filter<\/a> to the<br \/>\n  Performance report. This information is now also available in the API, and you can access it by setting the value of <code>searchType<\/code><br \/>\n  parameter in the request to <code>news<\/code>.\n<\/p>\n<h2 id=\"domain-property-support-in-the-sitemaps-api\" tabindex=\"-1\">Domain property support in the Sitemaps API<\/h2>\n<p>\nThe Sitemaps API now supports domain properties, as other Search Console APIs already do. You can query, add, and delete your sitemaps on<br \/>\n  <a href=\"https:\/\/support.google.com\/webmasters\/answer\/34592#domain_property\" class=\"external-link\">domain properties<\/a>, for example:\n<\/p>\n<p><code>GET https:\/\/www.googleapis.com\/webmasters\/v3\/sites\/sc-domain:example.com\/sitemaps<\/code><\/p>\n<h2 id=\"discovery-doc-migration\" tabindex=\"-1\">Discovery doc migration<\/h2>\n<p>\nWe&#8217;ll drop the support in the Webmasters discovery document. If you&#8217;re querying the Search Console API using an <a href=\"https:\/\/developers.google.com\/api-client-library\">external API library<\/a>, or querying<br \/>\n  the <a href=\"https:\/\/www.googleapis.com\/discovery\/v1\/apis\/webmasters\/v3\/rest\" class=\"external-link\">Webmasters API discovery document<\/a> directly, you will<br \/>\n  need to update your API calls to include the following changes.\n<\/p>\n<h3 id=\"api-library-changes\" tabindex=\"-1\">API library changes<\/h3>\n<p>\nFor updates on the API library changes, refer to the <a href=\"https:\/\/developers.google.com\/webmaster-tools\/search-console-api-original\/v3\/quickstart\/quickstart-java\">Java<\/a> and<br \/>\n  <a href=\"https:\/\/developers.google.com\/webmaster-tools\/search-console-api-original\/v3\/quickstart\/quickstart-python\">Python<\/a> quickstart guides,<br \/>\n  for an updated API usage guide.\n<\/p>\n<h4 id=\"java\" tabindex=\"-1\">Java<\/h4>\n<p>\nFor all Webmasters service-related imports, change the <code>webmasters<\/code> package to the <code>searchconsole.v1<\/code> package,<br \/>\n  and the service name, <code>Webmasters<\/code>, to <code>SearchConsole<\/code>. Examples:\n<\/p>\n<ul>\n<li>Importing the API service:\n<p><span class=\"compare-no\"><\/span><code>import com.google.api.services.webmasters.Webmasters;<\/code><\/p>\n<p><span class=\"compare-yes\"><\/span><code>import com.google.api.services.searchconsole.v1.SearchConsole;<\/code><\/p>\n<\/li>\n<li>Importing a response object:\n<p><span class=\"compare-no\"><\/span><code>import com.google.api.services.webmasters.model.WmxSite;<\/code><\/p>\n<p><span class=\"compare-yes\"><\/span><code>import com.google.api.services.searchconsole.v1.model.WmxSite;<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\nNote that besides the service object, other API objects are exactly the same as before, only the <strong>package<\/strong> changes.\n<\/p>\n<h4 id=\"python\" tabindex=\"-1\">Python<\/h4>\n<p>\nWhen building the Webmasters service object, make the following change:\n<\/p>\n<p><span class=\"compare-no\"><\/span><code>webmasters_service = build('webmasters', 'v3', http=http)<\/code><\/p>\n<p><span class=\"compare-yes\"><\/span><code>webmasters_service = build('searchconsole', 'v1', http=http)<\/code><\/p>\n<p>\nAgain, there&#8217;s no change in how objects behave.\n<\/p>\n<h3 id=\"direct-discovery-document-query\" tabindex=\"-1\">Direct discovery document query<\/h3>\n<p>\nThe discovery document querying changes include:\n<\/p>\n<ul>\n<li>URL change\n<p><span class=\"compare-no\"><\/span><code>https:\/\/www.googleapis.com\/discovery\/v1\/apis\/webmasters\/v3\/rest<\/code><\/p>\n<p><span class=\"compare-yes\"><\/span><code>https:\/\/searchconsole.googleapis.com\/$discovery\/rest<\/code><\/p>\n<\/li>\n<li>Content change\n<ul>\n<li>The <code>name<\/code> field changed from <code>webmasters<\/code> to <code>searchconsole<\/code>.<\/li>\n<li>The <code>version<\/code> field changed from <code>v3<\/code> to <code>v1<\/code>.<\/li>\n<\/ul>\n<\/ul>\n<p>\nIf you have any questions, you can ask in the <a href=\"https:\/\/support.google.com\/webmasters\/community\" class=\"external-link\">Buscar<br \/>\n  Central community<\/a> o <a href=\"https:\/\/twitter.com\/googlesearchc\" class=\"external-link\">on Twitter<\/a>.\n<\/p>\n<p>\n    <span class=\"byline-author\">Posted by Nati Yosephian, Gilad Amar, and Michael Huzman, Search Console team<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wednesday, December 9, 2020 A few months ago we announced an API infrastructure upgrade to improve the performance of the Search Console API as demand grows. Today we&#8217;re happy to announce some more updates coming your way: Addition of fresh data and news filter in the Search Console API Domain property support in the Sitemaps [&hellip;]<\/p>\n","protected":false},"menu_order":81395,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[665],"ar_kb_etiket":[],"class_list":["post-25169","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\/25169","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\/25169\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/27290"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=25169"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=25169"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=25169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}