How to Query the Google Search Console API

If you’ve been an web optimization for even a short while, you’re possible acquainted with Google Search Console (GSC). It’s a helpful device for getting details about your web site and its efficiency in natural search. That stated, it does have its limitations.

In this text, you’ll find out how to get better-connected knowledge out of Google Search Console in addition to improve the dimension of your exports by 400%.

Google Search Console limitations

While GSC has various sections, we’ll be specializing in the “Performance” report. From the GSC dashboard, there are two methods you possibly can entry this report:

Once inside the “Performance” report, knowledge for queries and pages will be accessed:

This reveals one in every of the points with GSC: Query and web page knowledge is separated.

In different phrases, if I would like to see the queries a particular web page is rating for, I’ve to first click on “Pages,” choose the web page, after which click on “back” to “Queries.” It’s a really cumbersome expertise.

The different (two-part) concern is with exporting:

  • Performance knowledge for queries and pages have to be exported individually.
  • Exports are restricted to 1,000 rows.

We’ll look to resolve these points by using the GSC API.

What is the Google Search Console API?

Now we all know the GSC person interface does have limitations: Connecting question knowledge with web page knowledge is difficult, and exports are restricted.

If the GSC UI represents the manufacturing facility default, the GSC API represents our customized settings. It takes a bit extra effort, however offers us extra management and opens up extra potentialities (not less than in the realm of question and web page knowledge).

The GSC API is a method for us to join to the knowledge inside our account, make extra personalized requests, and get extra personalized output. We may even bypass these manufacturing facility default settings like exports restricted to 1,000 rows, as an illustration.

Why use it?

Remember how I stated earlier that question and web page knowledge is separated in the “vanilla” GSC UI? Well, with the API, we are able to join question knowledge with the web page that question ranks for, so no extra clicking forwards and backwards and ready for issues to load.

Additionally, we noticed that exports are restricted to 1,000 rows. With the API, we are able to request up to 5,000 rows, a rise of 400%!

So let’s hook in, make our request, and get again a extra strong and significant knowledge set.


Log in to the applicable GSC account on this web page (higher proper nook). For occasion, if my web site is and I can view that Search Console account below admin@electronic, that’s the account I’ll signal into.

Enter the URL of the applicable GSC account:

Set up your request:

  1. Set startDate. This must be formatted as: YYYY-MM-DD.
  2. Set endDate.
  3. Set dimensions. A dimension will be:
      • question
      • web page
      • system
      • and/or nation
  4. Set filters (non-obligatory). A filter should embody:
      • dimension (a dimension will be: question, web page, system, or nation)
      • operator (an operator will be: accommodates, notContains, equals, notEquals)
      • expression (an expression will be any worth related to the dimensions)
    1. Set the rowLimit. With the GSC API, you possibly can request up to 5,000!
    2. The web page shared in the first step makes all of this setup fairly simple, however it may be tedious and even complicated for some. I’ve executed all the fussing for you and have created JSON you possibly can edit rapidly and simply to get the API return you’d like.

      Unfiltered request

      The following request can be unfiltered. We’ll set our most popular dates, dimensions, and a row restrict, after which make our request.

      The order by which you place your dimensions is the order by which they’ll be returned.

      The API will return knowledge for desktop, cell, and pill, separated out. The numbers you see in the GSC person interface — clicks, as an illustration — are an mixture of all three (until you apply system filtering).

      Remember, your dimensions also can embody “country” should you’d like.

      Filtered request

      This model of our request will embody filters so as to be extra particular about what’s returned.

      Filters are said as dimension/operator/expression. Here are some examples to present what’s doable:

      • question accommodates go fish digital
      • web page equals
      • system notContains pill

      It seems like you possibly can solely apply one filter per dimension, similar to in the regular GSC person interface, but when you already know otherwise, tell us in the feedback!

      Choose a template, unfiltered or filtered, and fill in your customized values (something after a colon must be up to date as your personal worth, until you want my presets).

      Execute the request

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

      This is the place you would manually arrange your request keys and values, however as I said earlier, this may be tedious and a bit complicated, so I’ve executed that be just right for you.

      Scroll down and click on “Execute.” You could also be prompted to sign-in right here as nicely.

      If the whole lot was entered accurately and the request could possibly be happy, the API will return your knowledge. If you get an error, audit your request first, then some other steps and inputs if mandatory.

      Click into the field in the decrease proper (that is the response from the API), choose all, and replica the info.

      Convert from JSON to CSV

      Excel or Sheets can be a significantly better method to work with the knowledge, so let’s convert our JSON output to CSV.

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

      Query your personal knowledge

      Most SEOs are fairly comfy in Excel, so now you can question your request output any method you’d like.

      One of the most typical duties carried out is searching for knowledge related to a particular set of pages. This is completed by including a sheet along with your web page set and utilizing VLOOKUP to point out a match.

      The API output being in a spreadsheet additionally permits for the most typical actions in Excel like sorting, filtering, and chart creation.

      Get extra out of Google Search Console

      GSC presents necessary knowledge for SEOs, and the GSC API output presents not solely extra of that knowledge, however in a format that’s far much less cumbersome and extra cohesive.

      Today, we overcame two obstacles we frequently face in the customary GSC person interface: the question/web page connection and restricted exports. My hope is that using the Google Search Console API will take your analyses and insights to the subsequent degree.

      While my JSON templates will cowl the most typical situations when it comes to what you’ll be all in favour of requesting, Google does provide documentation that covers a bit extra floor should you’re .

      Do you may have one other method of utilizing the GSC API? Is there one other API you generally use as an web optimization? Let me know in the feedback!

Source hyperlink Internet Marketing