public-roadmap icon indicating copy to clipboard operation
public-roadmap copied to clipboard

[Google Search API] `num` Ignored for Some Searches

Open schaferyan opened this issue 1 year ago • 13 comments

A customer reported the num parameter seems to be ignored for some searches. For example, when supplying 50 as the value of num, only 8 organic results are provided. This seems to mostly be happening with searches for famous individuals and entities that produce extensive knowledge graphs, i.e "Reese Witherspoon", "Bill Gates", "Led Zeppelin".

Screenshot 2023-03-29 at 11 13 27 AM

Playground | Search Inspector

schaferyan avatar Mar 29 '23 18:03 schaferyan

The user reported that the issue persists. I'm marking this as urgent as it's connected to Google search results and num parameter which is used by many customers.

Intercom

Playground | Inspect Playground | Inspect Playground | Inspect Playground | Inspect Playground | Inspect

marm123 avatar May 22 '23 05:05 marm123

To be more precise. This happens when knowledge graph appear on the top like this image

Inspect

So it also affects searches for tv series, movies, etc.

But it only affects the first page. num work on page 2 and after.

Setting the start=1 can remove the knowledge graph so num work again. The downside is the first organic result gets lost.

zyc9012 avatar May 22 '23 06:05 zyc9012

Related to the endless scrolling pagination (https://github.com/serpapi/public-roadmap/issues/537).

ilyazub avatar May 22 '23 16:05 ilyazub

The num parameter is ignored when Google decides to respond with the continuous scroll instead of the regular pagination.

It's possible to disable continuous scroll by using an outdated user-agent. Example:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19042

image (ref: https://www.google.com/search?q=Beyonce&num=100&hl=en&gl=us with an outdated user-agent)

Also related:

  • https://news.ycombinator.com/item?id=36370725
  • https://www.reddit.com/r/techsupport/comments/1436h13/is_there_any_way_to_turn_of_google_infinite/
  • https://support.google.com/websearch/thread/191811385/how-to-turn-off-infinite-scroll-get-pagination-back-4-google-search-disability-accessibility-need?hl=en
  • https://www.reddit.com/r/google/comments/zolrif/turn_off_infinite_scroll/

It should be possible to disable the continuous scroll in settings.

image (ref: https://www.google.com/preferences?hl=en&fg=1#tabVal=1)

But it only adds the "See More" button instead.

image

ilyazub avatar Sep 13 '23 14:09 ilyazub

@ilyazub could using an outdated user agent have other possibly undesired effects, such as omitting certain new elements from searches?

schaferyan avatar Sep 13 '23 18:09 schaferyan

@ilyazub could using an outdated user agent have other possibly undesired effects, such as omitting certain new elements from searches?

Unfortunately, yes — lots of new SERP features would be missing in that case. Even using a work-around with start=1 reduces the number of SERP features.

ilyazub avatar Sep 14 '23 16:09 ilyazub

But it only affects the first page. num work on page 2 and after.

Setting the start=1 can remove the knowledge graph so num work again. The downside is the first organic result gets lost.

My understanding is that it's already not advisable to use the num parameter if you want to get the knowledge_graph or other special elements. We already advise our customers that using num may cause Knowledge Graph elements not to appear.

Perhaps we could apply start =1 if num!=10 and just make it explicit in our documentation that using num will not return the knowledge_graph?

schaferyan avatar Sep 29 '23 16:09 schaferyan

Perhaps we could apply start =1 if num!=10 and just make it explicit in our documentation that using num will not return the knowledge_graph?

This workaround is best done on the client side, not on the SerpApi. I'm not sure all SerpApi users want this and it totally depends on the Google Search output. (Similar to https://github.com/serpapi/public-roadmap/issues/658.)

ilyazub avatar Oct 02 '23 11:10 ilyazub

Another customer with this issue:

Intercom

schaferyan avatar Dec 06 '23 21:12 schaferyan

We could also use gbv=1 to retrieve no-js version of the page. This would mainly be for users interested in only organic results.

No-js version of the page has normal pagination, and num and start parameters work as expected.

This would mean that we would have to support no-js parser.

aciddjus avatar Jan 02 '24 12:01 aciddjus

Another higher volume customer reported this:

Intercom

schaferyan avatar Feb 27 '24 19:02 schaferyan

Another high volume customer reported this:

Intercom

schaferyan avatar May 06 '24 15:05 schaferyan

While we are still exploring the feasibility of resolving this issue, you may want to try our Google Light Search API. It contains all the most critical data, but without the extra-rich results you usually find on a regular Google Search page. Pagination works with all queries.

aciddjus avatar May 14 '24 11:05 aciddjus

A user reported this issue. The user reported that using start=1 solved their issue, but of course, they'll miss the first result.

Front | Inspect

hilmanski avatar Jun 25 '24 04:06 hilmanski

Another customer reported this issue:

Front

schaferyan avatar Jun 25 '24 21:06 schaferyan

A user reported this issue. The user reported that using start=1 solved their issue, but of course, they'll miss the first result.

Would a workaround be to count the # of results returned, and if less than expected run it again with start=1 and then combine and dedupe the results? Not ideal but that should work, right? Looking for a short-term solution while your team thinks about a long-term implementation.

Garfinkel avatar Jun 25 '24 22:06 Garfinkel

Hi @Garfinkel

Currently, we recommend trying Google Light API as an alternative solution. This is a different API for getting Google search results page. Documentation: https://serpapi.com/google-light-api Example: https://serpapi.com/playground?engine=google_light&q=coffee&gl=us&hl=en&num=100

Our customer mentioned that using start=1 parameter and num=100 can get all the 100 results (but missing the first result) or you can also try start=0 to still get the first result. Example in our playground

We apologize for this issue, and thank you for your patience.

hilmanski avatar Jun 25 '24 22:06 hilmanski