How to Query the Google Search Console API

How to Query the Google Search Console API


If you have been an Search engine marketing for even a limited time, you’re very likely acquainted with Google Look for Console (GSC). It is a important device for receiving facts about your internet site and its general performance in organic look for. That mentioned, it does have its limits.

In this article, you will learn how to get superior-related information out of Google Search Console as very well as enhance the dimension of your exports by 400%.

Google Search Console limitations

When GSC has a quantity of sections, we’ll be concentrating on the “Performance” report. From the GSC dashboard, there are two strategies you can entry this report:

After within the “Performance” report, facts for queries and webpages can be accessed:

How to Query the Google Search Console API

This reveals one particular of the challenges with GSC: Question and webpage details is separated.

In other words and phrases, if I want to see the queries a certain website page is rating for, I have to to start with click on “Pages,” pick out the webpage, and then click “back” to “Queries.” It’s a quite cumbersome practical experience.

The other (two-portion) issue is with exporting:

  • General performance details for queries and webpages will have to be exported separately.
  • Exports are confined to 1,000 rows.

We’ll appear to resolve these challenges by making use of the GSC API.

What is the Google Lookup Console API?

Now we know the GSC user interface does have limitations: Connecting question knowledge with webpage facts is tricky, and exports are limited.

If the GSC UI signifies the manufacturing facility default, the GSC API represents our custom made configurations. It takes a little bit far more work, but provides us a lot more regulate and opens up extra possibilities (at minimum in the realm of question and webpage details).

The GSC API is a way for us to hook up to the knowledge within our account, make more custom made requests, and get extra tailored output. We can even bypass these manufacturing unit default configurations like exports limited to 1,000 rows, for instance.

Why use it?

Try to remember how I claimed earlier that query and page knowledge is separated in the “vanilla” GSC UI? Perfectly, with the API, we can join query info with the website page that question ranks for, so no more clicking back and forth and waiting around for things to load.

Additionally, we saw that exports are constrained to 1,000 rows. With the API, we can ask for up to 5,000 rows, an increase of 400%!

So let’s hook in, make our ask for, and get back again a additional strong and significant information set.

Set up

Log in to the acceptable GSC account on this page (higher correct corner). For occasion, if my web-site is instance.com and I can perspective that Search Console account underneath admin@e-mail.com, that’s the account I’ll indication into.

Enter the URL of the suitable GSC account:

How to Query the Google Search Console API

Established up your request:

  1. Established startDate. This need to be formatted as: YYYY-MM-DD.
  2. Set endDate.
  3. Established proportions. A dimension can be:
      • query
      • web site
      • system
      • and/or country
  4. Established filters (optional). A filter have to incorporate:
      • dimension (a dimension can be: query, website page, unit, or region)
      • operator (an operator can be: contains, notContains, equals, notEquals)
      • expression (an expression can be any price affiliated with the proportions)
    1. Established the rowLimit. With the GSC API, you can ask for up to 5,000!
    2. The web page shared in phase a single would make all of this set up pretty easy, but it can be tedious and even confusing for some. I have completed all the fussing for you and have developed JSON you can edit speedily and effortlessly to get the API return you’d like.

      Unfiltered request

      The subsequent request will be unfiltered. We’ll established our preferred dates, dimensions, and a row limit, and then make our request.

      The get in which you location your dimensions is the order in which they’ll be returned.

      The API will return knowledge for desktop, mobile, and pill, separated out. The figures you see in the GSC person interface — clicks, for instance — are an combination of all 3 (unless of course you apply gadget filtering).

      Don’t forget, your dimensions can also incorporate “country” if you’d like.

      “startDate”: “2019-11-01”,

      “endDate”: “2020-01-31”,

      “dimensions”:

      [

      “query”,

      “page”,

      “device”

      ],

      “rowLimit”: 3000

      Filtered request

      This version of our request will consist of filters in purchase to be a lot more certain about what is returned.

      Filters are said as dimension/operator/expression. In this article are some illustrations to demonstrate what is attainable:

      • question has go fish electronic
      • webpage equals https://gofishdigital.com/
      • device notContains tablet

      It appears to be like you can only use one particular filter for each dimension, just like in the regular GSC consumer interface, but if you know otherwise, enable us know in the comments!

      “startDate”: “2019-11-01”,

      “endDate”: “2020-01-31”,

      “dimensions”:

      [

      “query”,

      “page”,

      “device”

      ],

      “dimensionFilterGroups”:

      [

      “filters”:

      [

      “dimension”: “device”,

      “operator”: “notContains”,

      “expression”: “tablet”

      ]

      ],

      “rowLimit”: 3000

      Select a template, unfiltered or filtered, and fill in your custom made values (anything at all after a colon should be updated as your own worth, unless you like my presets).

      Execute the request

      So there you have it! Two ask for templates for you to choose from and edit to your liking. Now it’s time to make the ask for. Click into the “Request body”, select all, and paste in your custom JSON:

      How to Query the Google Search Console API

      This is where by you could manually set up your ask for keys and values, but as I stated previously, this can be monotonous and a minimal puzzling, so I have completed that operate for you.

      Scroll down and click “Execute.” You may be prompted to sign-in here as effectively.

      If every little thing was entered appropriately and the ask for could be glad, the API will return your details. If you get an error, audit your request to start with, then any other ways and inputs if needed.

      Click into the box in the reduce proper (this is the response from the API), pick out all, and duplicate the details.

      How to Query the Google Search Console API

      Change from JSON to CSV

      Excel or Sheets will be a a great deal far better way to function with the information, so let us change our JSON output to CSV.

      Use a converter like this a person and paste in your JSON output. You can now export a CSV. Update your column headers as wanted.

      Question your possess information

      Most SEOs are pretty cozy in Excel, so you can now question your request output any way you’d like.

      One of the most prevalent duties carried out is hunting for info connected with a specific set of web pages. This is completed by incorporating a sheet with your web page set and employing VLOOKUP to show a match.

      The API output staying in a spreadsheet also allows for the most typical steps in Excel like sorting, filtering, and chart creation.

      Get much more out of Google Lookup Console

      GSC delivers essential details for SEOs, and the GSC API output features not only a lot more of that data, but in a structure that is much significantly less cumbersome and far more cohesive.

      These days, we overcame two road blocks we generally confront in the conventional GSC user interface: the question/site connection and confined exports. My hope is that utilizing the Google Search Console API will acquire your analyses and insights to the following degree.

      While my JSON templates will cover the most popular scenarios in terms of what you’ll be intrigued in requesting, Google does offer documentation that covers a little bit additional floor if you’re intrigued.

      Do you have an additional way of making use of the GSC API? Is there yet another API you frequently use as an Website positioning? Permit me know in the responses!



Supply connection