In this blog I wanted to focus on a peculiar happening on Google that was reported by a user of the API. It definitely rose a couple eyebrows and this is a step by step guide to how I investigated this bug.
When one of our clients had a search query of "olympics 2021" with a num
parameter set to 35 (which would give 35 results), only 9 results were parsed into the JSON response.
SerpApi can only scrape what is provided on Google’s HTML and while this matched the HTML, this type of search is not as niche or with additional parameters to receive so little organic_results
.
JSON:
With some discussion from our engineers. We thought there may have been a switch to multiples of 10’s for organic_results
10, 20, 30, 40, 50, all the way to 100. If you go to https://www.google.com/preferences, you should see:
Since I’ve seen the num
parameter used all across the and have made a blog to see the maximum:
I created a very basic script to test if test all the num
's between 1–100 for our search for “coffee” in the Austin, TX area:
You can see with the results the requested num
was usually 1 or 2 off from the actual results provided from the JSON.
And this worked perfectly fine, it was able to be queried with an “odd” num
parameter between the multiple of 10.
So I ran this same testing query with our “olympics 2021” peculiar search that was brought to our attention by a customer. Also adding the no_cache
parameter to get non-cached results.
Our search for “olympics 2021” is only providing at maximum 10 results. When you provide a num
less than 10. you get approximately that number, but anything above that…Google is just not serving that many results for this query.
You can sign-up for SerpApi here: https://serpapi.com/
You can find the SerpApi user forum here: https://forum.serpapi.com/
You can find the API documentation here: https://serpapi.com/search-api/