0

I am working on Google search console data to get more than 1000 rows of data through the search analytics API request.

Below is the request

request = {
    'startDate': single_date,
    'endDate': single_date,
    'dimensions': ['query', 'page', 'date', 'country', 'device'],
    'rowLimit': 5000,
    'startRow': 0
}

According to the documentation specified in the below link.

https://developers.google.com/webmaster-tools/search-console-api-original/v3/how-tos/search_analytics#getting-more-than-5000-rows

If the result to the request sent has more than 5000 rows then it should display 5000 rows in the first request and then we can request more 5000 rows after setting the start row to 5000 in the second request.

My Use case:

The request i am sending has more than 5000 rows but my result shown is as below:

-----Executing the first request---------start row as 0 row count 409

-----Executing the second request -------start row as 5000 row count 807 (adding the first and second request row count)

-----Executing the third request --------start row as 10000 row count 1218 (adding the first,second and third request row count )

this is continued till 10 requests ..

second Question related to the search console data

The total clicks displayed in the UI of the search analytics API is not same with - when we download the excel sheet at the bottom and add all the clicks. In this case the data is present till the clicks become zero .

Could you please explain,

Thank you.

Bhavana
  • 68
  • 12
  • Why do you have so many dimensions? I usually only have one dimension per query. Querying all of those dimensions at the same time doesn't make sense. – eyedar Aug 04 '17 at 20:38
  • My requirement list needs all the dimensions (query, page, date , country , device) to be extracted. – Bhavana Aug 07 '17 at 18:22
  • can you do them one at a time? what's happening is that in the backend it's querying each dimension separately and getting 5000 rows, but then when it merges the results across all of those dimensions you get less results...solution is to query one dimension at a time – eyedar Aug 10 '17 at 05:49
  • But how should i relate if i request each query separately ? I need all the queries per particular page on a date in a particular country and the particular device . thank you for responding . – Bhavana Aug 10 '17 at 15:15

1 Answers1

0

Since you need "all the queries per particular page on a date in a particular country and the particular device" (based on your comment), your dimension should be query and everything else should be a filter. Your request should look something like this:

request = {
    'startDate': single_date,
    'endDate': single_date,
    'dimensions': ['query'],
    'dimensionFilterGroups': [ {'groupType': 'and', 
       'filters': [{'dimension': 'country','operator': 'equals', 'expression': 'FRA'},
                   {'dimension': 'page', 'operator': 'equals', 'expression': '/about'},
                   {'dimension': 'device', 'operator': 'equals', 'expression': 'DESKTOP'}],
    'rowLimit': 5000,
    'startRow': 0
}

This request will give you up to 5000 queries that led to the page /about in France on desktop devices. You can change the filter expressions to the values you'd like to query.

eyedar
  • 101
  • 2
  • If i have to specify each individual page separately, the time it takes to execute the complete program would be high in case the no.pages are high in number. – Bhavana Aug 10 '17 at 18:23
  • that's true but then I would ask why you need 5000 queries for a high number of pages – eyedar Aug 10 '17 at 18:25
  • I need all queries for a particular page (that doesn't mean a number 5000). So that i can find no. of clicks for the particular query to page. – Bhavana Aug 10 '17 at 18:39
  • when you use the query dimension, the number of clicks for each query is already part of the result set – eyedar Aug 10 '17 at 18:58