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

[Google Shopping API] Fix Pagination Parameters and Clarify Documentation

Open schaferyan opened this issue 1 year ago • 6 comments

A potential Enterprise Customer reached out to ask for clarification on the pagination for the Google Shopping API.

The num parameter currently seems to be ignored for US searches. If it's not possible to fix this, we should note this in the documentation and disable it in the Playground.

Also, our documentation now states that for searches in the US, start should be incremented by 10. This seems to be accurate but could use further clarification since 40 results are returned per page.

Here is a suggestion for what the revised documentation could look like:

Screenshot 2024-08-20 at 4 13 34 PM

Front | Documentation | Playground

schaferyan avatar Aug 20 '24 23:08 schaferyan

The customer also noted that the serpapi_pagination.next URL also seems to have a value of start=20 on the first page.

I experimented in the playground and saw some strange behavior for serpapi_pagination. It seemed to increment by 20 for the first several pages, then stopped changing (the same start value was suggested to be used again).

initial page start=10 start=30 start=40

schaferyan avatar Aug 20 '24 23:08 schaferyan

The user shared another example of another weird behavior related to Google Shopping's pagination.

  • pagination.next value showed a plain Google link
  • serpapi_pagination showed the current link

2e45b9cb0121c864f617c88b93eccbbe7386a130

Inspect

hilmanski avatar Aug 21 '24 05:08 hilmanski

A customer reported a similar bug in their search.

Inspect

hilmanski avatar Sep 10 '24 04:09 hilmanski

A customer reached out about this: Intercom

sonika-serpapi avatar Sep 10 '24 16:09 sonika-serpapi

@Krugloff Any estimate on the completion of this issue

sharjeelm avatar Sep 25 '24 21:09 sharjeelm

@sharjeelm Thank you for your question. The documentation changes have been made. It's difficult to provide an ETA, but the other parts of this issue have been marked in progress and are still being worked on.

sonika-serpapi avatar Sep 25 '24 22:09 sonika-serpapi

@sonika-serpapi Sorry to ping again shortly on this but I have a product build upon Google Shopping API section of SERP API and major section of that product is failing due to pagination issue. I hope you understand my stance as if you can prioritize the fixing of this issue

sharjeelm avatar Oct 08 '24 14:10 sharjeelm

Thank you for following up with us @sharjeelm ! I'm really sorry for the inconvenience this is causing. There is a PR linked to this issue which is currently under review. Unfortunately, I cannot provide an ETA for when it will be merged. However, this issue has been labeled as prioritized and our engineers will try to merge the PR as soon as possible.

martin-serpapi avatar Oct 08 '24 15:10 martin-serpapi

@martin-serpapi @sonika-serpapi Can I please get update on this . As our product is blocked due to pagination issue. If this can take longer I fear we will have to migrate to zenserp .

sharjeelm avatar Oct 21 '24 11:10 sharjeelm

Hi @sharjeelm, thanks for reaching out.

We're still working on the pull request review. While I can't share the exact ETA, I hope this will be resolved sometime this week.

@Krugloff can you perhaps share more details or when we can potentially expect the PR to be merged?

marm123 avatar Oct 21 '24 11:10 marm123

Hi @sharjeelm, we are actively working on this issue. To further understand, I would like to discuss further to see if our latest solution could help. Could you please share more details about it? If you prefer, feel free to email me at [email protected].

tanys123 avatar Oct 22 '24 07:10 tanys123

Thanks a lot for update @Krugloff

sharjeelm avatar Oct 28 '24 12:10 sharjeelm

@sharjeelm We've completed the Google Shopping pagination for the new layout. I recommend using it via the serpapi_pagination.next parameter. I hope it will work well for your needs, but please don’t hesitate to reach out if you encounter any issues!

Screenshot 2024-10-28 at 16 03 36

Krugloff avatar Oct 28 '24 13:10 Krugloff

One thing to note it always takes a difference of 10 in next and then next=20 while giving 40 products

On Mon, Oct 28, 2024 at 6:05 PM Alex Kruglov (Makeev) < @.***> wrote:

@sharjeelm https://github.com/sharjeelm We've completed the Google Shopping pagination for the new layout. I recommend using it via the serpapi_pagination.next parameter. I hope it will work well for your needs, but please don’t hesitate to reach out if you encounter any issues! Screenshot.2024-10-28.at.16.03.36.png (view on web) https://github.com/user-attachments/assets/eb5060ed-d61e-46c4-94ea-d2057b934e9c

— Reply to this email directly, view it on GitHub https://github.com/serpapi/public-roadmap/issues/1858#issuecomment-2441535695, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFJKD3BLX33TE3LTWNL4XLZ5YZCDAVCNFSM6AAAAABM23IWJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBRGUZTKNRZGU . You are receiving this because you were mentioned.Message ID: @.***>

sharjeelm avatar Oct 28 '24 19:10 sharjeelm

Thank you @sharjeelm. Yes, this is now how the start parameter now works on Google's side. We understand it's not intuitive, which is why we recommend using serpapi_pagination.next instead of incrementing start directly.

schaferyan avatar Oct 28 '24 19:10 schaferyan

@schaferyan @Krugloff Can you please clarify one more thing how I can make sure that google shopping search API will always provide response as per new version of google shopping as I was unable to see any parameter in google shopping search api to do so .

sharjeelm avatar Nov 14 '24 14:11 sharjeelm

Sorry to ping again Can you please clarify one more thing how I can make sure that google shopping search API will always provide response as per new version of google shopping as I was unable to see any parameter in google shopping search api to do so .

On Tue, Oct 29, 2024 at 12:26 AM Ryan Schafer @.***> wrote:

Thank you @sharjeelm https://github.com/sharjeelm. Yes, this is now how the start parameter now works on Google's side. We understand it's not intuitive, which is why we recommend using serpapi_pagination.next instead of incrementing start directly.

— Reply to this email directly, view it on GitHub https://github.com/serpapi/public-roadmap/issues/1858#issuecomment-2442441904, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFJKD6EEDJ4YYN6EHAUCE3Z52FWBAVCNFSM6AAAAABM23IWJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBSGQ2DCOJQGQ . You are receiving this because you were mentioned.Message ID: @.***>

sharjeelm avatar Nov 14 '24 14:11 sharjeelm

Hi @sharjeelm , thank you for your follow-up question.

Unfortunately, we don't support a parameter with our Google Shopping API that will force it to use the new layout for all of your searches. This depends on the actual Google Shopping engine and we don't have control over it. Whether results using the new layout are returned for your search depends on the location you used for it.

Google has released the new shopping layout in the US, and a few other countries. You can view a list of the countries supporting the new layout in our Google Shopping API documentation.

Searches for these locations will return results using the new shopping layout.

I hope this makes sense. If you have any follow-up questions, please let me know.

martin-serpapi avatar Nov 14 '24 16:11 martin-serpapi

I am trying only for US still getting old version data

On Thu, Nov 14, 2024, 9:35 PM Martin Kaldramov @.***> wrote:

Hi @sharjeelm https://github.com/sharjeelm , thank you for your follow-up question.

Unfortunately, we don't support a parameter with our Google Shopping API that will force it to use the new layout for all of your searches. This depends on the actual Google Shopping engine and we don't have control over it. Whether results using the new layout are returned for your search depends on the location you used for it.

Google has released the new shopping layout in the US, and a few other countries. You can view a list of the countries supporting the new layout in our Google Shopping API documentation https://serpapi.com/google-shopping-api.

Searches for these locations will return results using the new shopping layout.

I hope this makes sense. If you have any follow-up questions, please let me know.

— Reply to this email directly, view it on GitHub https://github.com/serpapi/public-roadmap/issues/1858#issuecomment-2476891735, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGFJKD3ZMEQRE3G4CTDEPMT2ATGODAVCNFSM6AAAAABM23IWJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWHA4TCNZTGU . You are receiving this because you were mentioned.Message ID: @.***>

sharjeelm avatar Nov 14 '24 16:11 sharjeelm

Thank you for sharing this information @sharjeelm , and apologies for the inconvenience.

Can you please share the ID of a search for which you're experiencing this? It can be found at https://serpapi.com/searches or in the search_metadata block of the JSON response.

martin-serpapi avatar Nov 14 '24 16:11 martin-serpapi