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

[Google Search API] `shopping_results` `link` field returns a Google URL instead of direct product link

Open alexbarron opened this issue 10 months ago • 8 comments

A customer reported that the link field for shopping_results in normal Google Search is coming back as a Google URL instead of the direct link to the seller. The customer's queries as recently as Jan 16th, 2025 were all returning direct links.

For example: https://www.google.es/aclk?sa=...

Issue is intermittent. Some queries still return direct links.

Can we still scrape the direct link as we did previously? Or is it technically possible to do what we did with direct_link=true on the Google Shopping API?

Previous link example: Image

Current link example with Google URL: Image

Current link example with correct direct link: Image

Public links: Playground w/ Google link | Playground w/ direct link | Documentation

Internal links: Intercom | Search Inspect w/ direct link | Search Inspect w/ Google link

alexbarron avatar Feb 03 '25 11:02 alexbarron

We are also influenced by that. Even when specifying the direct_link param - the link is not present or is directing to the google page - not the product page.

roman-bartusiak-yohana avatar Feb 06 '25 19:02 roman-bartusiak-yohana

Another user is interested in this.

Intercom | Inspect

hilmanski avatar Feb 26 '25 01:02 hilmanski

Hi @roman-bartusiak-yohana I wanted to mention it sounds like the issue you've described is closer to #1889, as the Google Search API does not support a direct_link param.

NateSkiles avatar Feb 26 '25 17:02 NateSkiles

We are able to workaround it async def get_redirect_url(session, url): res = await session.head(url, allow_redirects=True) return res.url

But we would prefer to get the direct url from API call in the first place.

99xAgency avatar Feb 27 '25 03:02 99xAgency

Thank you for sharing your workaround @99xAgency. We'll let you know once we have any update on this.

hilmanski avatar Feb 27 '25 03:02 hilmanski

@NateSkiles oh, i see now, yep that is true, it is same as #1889

roman-bartusiak-yohana avatar Mar 04 '25 16:03 roman-bartusiak-yohana

After investigating the issue, I found that it specifically affects mobile layouts. When the device is set to desktop, the link points directly to the product. However, on mobile, the link redirects through a Google URL instead.

As for retrieving direct links in the mobile layout, I’m fairly certain it’s not possible with the current version Google is serving, as the direct URLs simply aren’t present in the page content—unlike in the desktop version.

vedovati-matteo avatar Apr 23 '25 13:04 vedovati-matteo

Another user reported this. Their example is a desktop search. I was able to replicate it as well.

Intercom | Playground | Inspector

schaferyan avatar May 01 '25 16:05 schaferyan

Another user report:

Intercom

oceansize avatar Jul 17 '25 13:07 oceansize