From e634f50c45f70b72adaf8f4d1f8fa77ed83d8b90 Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:26:28 +0200 Subject: [PATCH 1/2] docs(google): remove the retired Shopping product and click endpoints, add the offers reference (SCR-764) GET /v1/google/shopping/product and GET /v1/google/shopping/product/click answer 404 (retired by monorepo migrations 059/060), but the docs still listed both; a customer called them from here (SB-001278). Removed: - api-reference/google/google-shopping/resolve-merchant-url-for-a-product and .../product-details (the latter documented GET /v1/google/shopping/product), and the google/shopping-click-enrichment guide, with their nav entries. - Both paths from openapi-google.json, with the schemas only they used (ShoppingClickResponse, ShoppingProductResponse, ShoppingProductDetail, ShoppingSeller) and the click_link field of ShoppingProductResult. - shopping.click()/shopping-click/google_shopping_product_click from the Google overview, CLI pages, MCP overview and eight MCP integration pages. Added: - GET /v1/google/shopping/offers in openapi-google.json (parameters from the live route: barcode, catalog_id, gl, hl, domain; ShoppingOffersResponse and ShoppingOffer schemas; 400/404/422/502 responses) and its API reference page api-reference/google/google-shopping/offers, next to search-products. The offers[].link description is provisional and carries a TODO(SCR-764) marker (an x-todo key in the spec, an MDX comment on the page). - Permanent redirects: the click guide to google/shopping-offers, the resolve-merchant-url page to the new offers page, and product-details to google-products/immersive-product-detail. Checked: mint broken-links (no broken links), mint openapi-check (valid), scripts/check_credit_costs.py (match), and two runs of scripts/sync_endpoint_lifecycle.py against the live catalog leave the tree unchanged. Co-Authored-By: Claude Opus 5.5 --- .../google/google-shopping/offers.mdx | 33 ++ .../google-shopping/product-details.mdx | 5 - .../resolve-merchant-url-for-a-product.mdx | 5 - cli/commands.mdx | 12 +- cli/overview.mdx | 6 +- docs.json | 19 +- google/overview.mdx | 27 +- google/shopping-click-enrichment.mdx | 50 -- mcp/integrations/chatgpt.mdx | 2 +- mcp/integrations/claude-code.mdx | 4 +- mcp/integrations/claude-desktop.mdx | 4 +- mcp/integrations/cline.mdx | 4 +- mcp/integrations/continue-dev.mdx | 4 +- mcp/integrations/gemini.mdx | 2 +- mcp/integrations/openclaw.mdx | 2 +- mcp/integrations/windsurf.mdx | 4 +- mcp/overview.mdx | 3 +- openapi-google.json | 516 ++++++------------ 18 files changed, 245 insertions(+), 457 deletions(-) create mode 100644 api-reference/google/google-shopping/offers.mdx delete mode 100644 api-reference/google/google-shopping/product-details.mdx delete mode 100644 api-reference/google/google-shopping/resolve-merchant-url-for-a-product.mdx delete mode 100644 google/shopping-click-enrichment.mdx diff --git a/api-reference/google/google-shopping/offers.mdx b/api-reference/google/google-shopping/offers.mdx new file mode 100644 index 0000000..b846270 --- /dev/null +++ b/api-reference/google/google-shopping/offers.mdx @@ -0,0 +1,33 @@ +--- +title: "Seller offers" +description: "Get the seller offers Google Shopping lists for one product, by catalog ID or barcode." +openapi: "GET /v1/google/shopping/offers" +--- + +Returns the sellers Google Shopping lists for one product: one entry per merchant `source`, each with its own `price` and `link`. Pass exactly one of `catalog_id` or `barcode`. + +A call costs **25 credits**, whichever identifier you pass. + +## Identifying the product + +- **`catalog_id`**: Google's Shopping catalog identifier. A [Shopping search](/api-reference/google/google-shopping/search-products) result carries it as `catalog_id` when Google ships it on that page, and a Google Shopping product URL carries it as `prds=catalogid:`. The sellers are read from Google's product page, so there is no lookup step and no doubt about which product you get. Up to 60 offers come back, and `total_offers` says how many sellers Google lists. +- **`barcode`**: a GTIN-8, UPC-A, EAN-13 or GTIN-14. Google Shopping does not match raw barcodes, so the barcode is first resolved to a product through a Google web search. The match is returned as `resolved_query`, and the offers come from a Shopping search for it. + +```bash cURL +curl "https://scrapebadger.com/v1/google/shopping/offers?catalog_id=762120719996356571&gl=de&hl=de" \ + -H "x-api-key: YOUR_API_KEY" +``` + +## Offer fields + +{/* TODO(SCR-764): the `offers[].link` row below is provisional wording. What offers[].link contains is being changed; finalize it (and the `link` description in openapi-google.json, ShoppingOffer.link) before merging. */} + +| Field | Description | +|---|---| +| `offers[].source` | The merchant name, for example `Walmart` or `Best Buy`. | +| `offers[].price` | `value`, `currency` and `extracted` (the price as Google shows it). | +| `offers[].link` | The merchant's product page URL. | +| `offers[].delivery` | Shipping line as Google shows it. | +| `offers[].extensions` | Availability, shipping and returns lines. | + +For a product's full detail (description, specs, images, variants) together with its merchant offers, use [Immersive product detail](/api-reference/google/google-products/immersive-product-detail) with `include_offers=true`. The [Shopping offers guide](/google/shopping-offers) has more examples. diff --git a/api-reference/google/google-shopping/product-details.mdx b/api-reference/google/google-shopping/product-details.mdx deleted file mode 100644 index c41a6bb..0000000 --- a/api-reference/google/google-shopping/product-details.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Product details" -description: "Product details" -openapi: "GET /v1/google/shopping/product" ---- diff --git a/api-reference/google/google-shopping/resolve-merchant-url-for-a-product.mdx b/api-reference/google/google-shopping/resolve-merchant-url-for-a-product.mdx deleted file mode 100644 index c00fa08..0000000 --- a/api-reference/google/google-shopping/resolve-merchant-url-for-a-product.mdx +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Resolve merchant URL for a product" -description: "Resolve the direct merchant URL for a product from Google Shopping." -openapi: "GET /v1/google/shopping/product/click" ---- diff --git a/cli/commands.mdx b/cli/commands.mdx index 9ed7394..8ba3bb2 100644 --- a/cli/commands.mdx +++ b/cli/commands.mdx @@ -121,12 +121,12 @@ scrapebadger google jobs "software engineer" \ --location "San Francisco, CA" -- ```bash scrapebadger google shopping # Product search scrapebadger google shopping --min-price 500 --max-price 2000 --sort-by price_low -scrapebadger google shopping-product # Product detail + sellers -scrapebadger google shopping-click "" --source +scrapebadger google shopping-offers --catalog-id # Seller offers for one product +scrapebadger google shopping-offers --gl us # Seller offers by GTIN/UPC/EAN +scrapebadger google product-detail -q --include-offers # Full detail + merchant offers ``` - The `shopping-click` command resolves the real merchant URL for a product by title. Google has removed direct merchant links from organic Shopping HTML; this command uses an "I'm Feeling Lucky" redirect scoped to the source merchant (via `site:` operator) to materialize the product page URL. Costs **1 credit per call**. - ### Patents, Scholar, Finance, Products +### Patents, Scholar, Finance, Products ```bash scrapebadger google patents --inventor Smith --assignee Google @@ -141,8 +141,8 @@ scrapebadger google product-detail # Immersive product ```bash # Export top 20 SERP results as CSV scrapebadger google search "python 3.13" --num 20 -o csv > results.csv # Pipe to jq -scrapebadger google shopping "laptop" | jq '.results[].title' # Full shopping search → click enrichment workflow -scrapebadger google shopping "laptop" | \ jq -r '.results[0] | [.title,.source] | @tsv' | \ while IFS=$'\t' read -r title source; do scrapebadger google shopping-click "$title" --source "$source" done +scrapebadger google shopping "laptop" | jq '.results[].title' # Shopping search → seller offers for the first result +scrapebadger google shopping "laptop" | \ jq -r '.results[0].catalog_id // empty' | \ xargs -I{} scrapebadger google shopping-offers --catalog-id {} ``` --- ## Vinted Commands All Vinted commands are under `scrapebadger vinted`. diff --git a/cli/overview.mdx b/cli/overview.mdx index 89a19a6..b7ac150 100644 --- a/cli/overview.mdx +++ b/cli/overview.mdx @@ -42,9 +42,9 @@ scrapebadger twitter search "AI agents" --output table # Google web search scrapebadger google search "python 3.13" --gl us --num 20 -# Google shopping + per-product merchant URL enrichment +# Google shopping search + seller offers for a product scrapebadger google shopping "laptop" --max-price 2000 -scrapebadger google shopping-click "Lenovo IdeaPad 5" --source "Walmart" +scrapebadger google shopping-offers --catalog-id 762120719996356571 --gl de # Search Vinted in Germany scrapebadger vinted search "nike shoes" --market de @@ -89,7 +89,7 @@ scrapebadger twitter trends -o csv -f name,domain_context |-------|----------| | **Account** | `auth`, `credits`, `logout` | | **Twitter** | `user`, `tweets`, `tweet`, `search`, `followers`, `following`, `mentions`, `trends`, `replies`, `quotes`, `retweeters`, `community`, `list`, `space` + more | -| **Google** | `search`, `maps-search`, `maps-place`, `maps-reviews`, `maps-photos`, `maps-posts`, `news`, `news-topics`, `news-trending`, `hotels`, `hotels-details`, `trends`, `trends-regions`, `trends-related`, `trends-trending`, `jobs`, `shopping`, `shopping-product`, `shopping-click`, `patents`, `patent`, `scholar`, `autocomplete`, `images`, `videos`, `finance`, `ai-mode`, `lens`, `product-detail` (29 commands covering 16 Google products) | +| **Google** | `search`, `maps-search`, `maps-place`, `maps-reviews`, `maps-photos`, `maps-posts`, `news`, `news-topics`, `news-trending`, `hotels`, `hotels-details`, `trends`, `trends-regions`, `trends-related`, `trends-trending`, `jobs`, `shopping`, `shopping-offers`, `patents`, `patent`, `scholar`, `autocomplete`, `images`, `videos`, `finance`, `ai-mode`, `lens`, `product-detail` (28 commands covering 16 Google products) | | **Vinted** | `search`, `item`, `user`, `user-items`, `brands`, `markets` | | **Web** | `scrape`, `detect`, `screenshot`, `extract`, `batch`, `batch-status` | diff --git a/docs.json b/docs.json index 041decb..0059627 100644 --- a/docs.json +++ b/docs.json @@ -104,7 +104,6 @@ "group": "Overview", "pages": [ "google/overview", - "google/shopping-click-enrichment", "google/shopping-offers", "google-light/overview" ] @@ -164,8 +163,7 @@ "group": "Shopping", "pages": [ "api-reference/google/google-shopping/search-products", - "api-reference/google/google-shopping/product-details", - "api-reference/google/google-shopping/resolve-merchant-url-for-a-product" + "api-reference/google/google-shopping/offers" ] }, { @@ -2029,6 +2027,21 @@ "source": "/api-reference/endpoint/facebook/search", "destination": "/api-reference/endpoint/facebook/marketplace-search", "permanent": true + }, + { + "source": "/google/shopping-click-enrichment", + "destination": "/google/shopping-offers", + "permanent": true + }, + { + "source": "/api-reference/google/google-shopping/resolve-merchant-url-for-a-product", + "destination": "/api-reference/google/google-shopping/offers", + "permanent": true + }, + { + "source": "/api-reference/google/google-shopping/product-details", + "destination": "/api-reference/google/google-products/immersive-product-detail", + "permanent": true } ] } diff --git a/google/overview.mdx b/google/overview.mdx index ac95e51..2bc365b 100644 --- a/google/overview.mdx +++ b/google/overview.mdx @@ -55,7 +55,7 @@ retained. See Job listings aggregated across the web with filters for type, date, and location. - Product listings with prices, ratings, filters — plus per-product merchant URL enrichment. + Product listings with prices, ratings, filters — plus seller offers by catalog ID or barcode. Patent document search and full-detail retrieval by patent number. @@ -119,14 +119,14 @@ for (const r of serp.organic_results) { console.log(r.title, r.link); } -// Shopping search + per-product merchant URL enrichment +// Shopping search + product detail with merchant offers const products = await client.google.shopping.search({ q: "laptop" }); const first = products.results[0]; -const enriched = await client.google.shopping.click({ - title: first.title, - source: first.source, +const detail = await client.google.products.detail({ + product_id: first.gpcid, + q: "laptop", + include_offers: true, }); -console.log("Merchant URL:", enriched.merchant_url); ``` ```python Python @@ -141,14 +141,12 @@ async with ScrapeBadger(api_key="YOUR_API_KEY") as client: # Maps search places = await client.google.maps.search("coffee shops in san francisco") - # Shopping search + click enrichment + # Shopping search + product detail with merchant offers products = await client.google.shopping.search("laptop") first = products["results"][0] - enriched = await client.google.shopping.click( - title=first["title"], - source=first["source"], + detail = await client.google.products.detail( + first["gpcid"], q="laptop", include_offers=True ) - print("Merchant URL:", enriched["merchant_url"]) ``` ```bash cURL @@ -160,8 +158,8 @@ curl "https://scrapebadger.com/v1/google/search?q=python+3.13&gl=us&hl=en" \ curl "https://scrapebadger.com/v1/google/shopping/search?q=laptop" \ -H "x-api-key: YOUR_API_KEY" -# Per-product merchant URL enrichment -curl "https://scrapebadger.com/v1/google/shopping/product/click?title=Lenovo+IdeaPad+5&source=Walmart" \ +# Seller offers for a product by catalog ID +curl "https://scrapebadger.com/v1/google/shopping/offers?catalog_id=762120719996356571&gl=de&hl=de" \ -H "x-api-key: YOUR_API_KEY" ``` @@ -226,8 +224,7 @@ A full Search query that contains a `site:` operator, such as `"Jane Doe" "Acme" | Endpoint | Description | |---|---| | `GET /v1/google/shopping/search` | Product search with filters + ads | - | `GET /v1/google/shopping/product` | Product detail with seller list | - | `GET /v1/google/shopping/product/click` | Resolve merchant URL per product (lightweight HTTP lookup) | + | `GET /v1/google/shopping/offers` | Seller offers for one product by `catalog_id` or `barcode` | | Endpoint | Description | diff --git a/google/shopping-click-enrichment.mdx b/google/shopping-click-enrichment.mdx deleted file mode 100644 index 207abbf..0000000 --- a/google/shopping-click-enrichment.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "Shopping Merchant URL Enrichment" -description: "Resolve the real merchant URL for a Google Shopping product on demand." ---- - -# Shopping Merchant URL Enrichment Google has removed direct merchant links from organic Shopping HTML — every click in the real Shopping UI now routes through a JavaScript handler. The `/v1/google/shopping/product/click` endpoint materializes the direct merchant URL for any product title on demand. ## How It Works 1. Call `/v1/google/shopping/search?q=laptop` — you get product listings with title, price, source merchant, rating, thumbnail, and a per-product `click_link`. -2. Call the product's `click_link` (or construct `/v1/google/shopping/product/click?title=...&source=...`) — the endpoint uses Google's "I'm Feeling Lucky" redirect (`btnI=1`), scoped to the card's `source` merchant via a `site:` operator, to return the direct product page URL. The `source`-scoped `site:` query guarantees the resolved URL matches the exact merchant whose price was shown in the card, not a generic top organic match. ## Two-Step Example - - - - -```javascript Node.js -import { ScrapeBadger } from "scrapebadger"; const client = new ScrapeBadger({ apiKey: "YOUR_API_KEY" }); // Step 1: search shopping -const products = await client.google.shopping.search({ q: "laptop" }); -const first = products.results[0]; -console.log(first.title, first.price.extracted, first.source); -// "Lenovo IdeaPad 5 16IRU9 16\" 2-in-1 Laptop" "$599.00" "Walmart" // Step 2: resolve the merchant URL -const enriched = await client.google.shopping.click({ title: first.title, source: first.source, -}); -console.log(enriched.merchant_url); -// "https://www.walmart.com/ip/Lenovo-IdeaPad-5-..." -``` - -```python Python -from scrapebadger import ScrapeBadger async with ScrapeBadger(api_key="YOUR_API_KEY") as client: # Step 1: search shopping products = await client.google.shopping.search("laptop") first = products["results"][0] print(first["title"], first["price"]["extracted"], first["source"]) # Step 2: resolve the merchant URL enriched = await client.google.shopping.click( title=first["title"], source=first["source"], ) print(enriched["merchant_url"]) -``` - -```bash cURL -# Step 1 -curl "https://scrapebadger.com/v1/google/shopping/search?q=laptop" \ -H "x-api-key: YOUR_API_KEY" # Step 2 — use the click_link returned in the first response -curl "https://scrapebadger.com/v1/google/shopping/product/click?title=Lenovo+IdeaPad+5+16IRU9+16%22+2-in-1+Laptop&source=Walmart&gl=us&hl=en" \ -H "x-api-key: YOUR_API_KEY" -``` - - - - ## Response Shape - -```json -{ "product_id": "60c2e6fdb6b3", "title": "Lenovo IdeaPad 5 16IRU9 16\" 2-in-1 Laptop Computer", "merchant_url": "https://www.walmart.com/ip/Lenovo-IdeaPad-5-16IRU9-16-2-in-1-Laptop/12345", "merchant_domain": "www.walmart.com", "source_query": "Lenovo IdeaPad 5 16IRU9 16\" 2-in-1 Laptop Computer site:walmart.com" -} -``` - -| Field | Description | -|---|---| -| `product_id` | Stable MD5 hash of `(title, source, price)` — echoed back so you can correlate with the original search result. | -| `title` | The product title you passed in. | -| `merchant_url` | The direct merchant product page URL, or `null` if no redirect was produced. | -| `merchant_domain` | The host portion of `merchant_url`. | -| `source_query` | The query that was passed to Google's "I'm Feeling Lucky" redirect — useful for debugging. | ## Supported Merchants The endpoint maps common source names to canonical domains for accurate `site:` scoping. Supported out of the box: - **Marketplaces**: Walmart, Best Buy, Amazon (incl. "Amazon.com - Seller"), Target, eBay, Newegg, Costco, Home Depot, Lowe's, Staples, Office Depot, Micro Center, Adorama, B&H Photo-Video-Pro Audio -- **Brand stores**: HP, Dell, Lenovo, Apple, Razer, Asus, Acer, HyperX, MSI, Samsung For sources not in the map, the endpoint falls back to a bare-title query (no `site:` scope) which still resolves a valid merchant URL — just not necessarily the one whose price was shown. ## Pricing The endpoint uses a lightweight HTTP request, not a browser. Per-call credit cost is configured in the admin panel and returned live from `GET /public/pricing` — query that endpoint for the authoritative current rate. ## Why This Exists Google's organic Shopping HTML doesn't contain merchant URLs at all — clicking a product card opens a JavaScript modal that fetches merchant info only when you actually click "Visit site". Attempting to capture that flow in a single synchronous scrape is impractical (~60-90s per query for 50 products). Instead, the ScrapeBadger Shopping click endpoint exposes merchant URL resolution as a **per-product on-demand call** — you only pay for enrichment when you actually need the link. diff --git a/mcp/integrations/chatgpt.mdx b/mcp/integrations/chatgpt.mdx index d51fd06..e59e396 100644 --- a/mcp/integrations/chatgpt.mdx +++ b/mcp/integrations/chatgpt.mdx @@ -44,4 +44,4 @@ Once connected, ChatGPT can call any of ScrapeBadger's 344 tools (Twitter/X, Goo > "Find me a 16-inch laptop on Google Shopping under $1500 and tell me where to buy it" -ChatGPT will pick `google_news_search` and `google_shopping_search` + `google_shopping_product_click` automatically. +ChatGPT will pick `google_news_search` and `google_shopping_search` + `google_shopping_offers` automatically. diff --git a/mcp/integrations/claude-code.mdx b/mcp/integrations/claude-code.mdx index 40aa512..8c53c5c 100644 --- a/mcp/integrations/claude-code.mdx +++ b/mcp/integrations/claude-code.mdx @@ -64,6 +64,6 @@ Once connected, ask Claude Code natural-language questions and it will pick the Claude Code calls `google_search`. -> "Find me a laptop under $1500 on Google Shopping and give me the merchant URL for the cheapest one" +> "Find me a laptop under $1500 on Google Shopping and list the stores selling the cheapest one" -Claude Code chains `google_shopping_search` → `google_shopping_product_click`. +Claude Code chains `google_shopping_search` → `google_shopping_offers`. diff --git a/mcp/integrations/claude-desktop.mdx b/mcp/integrations/claude-desktop.mdx index 1541fbc..8f0517a 100644 --- a/mcp/integrations/claude-desktop.mdx +++ b/mcp/integrations/claude-desktop.mdx @@ -84,6 +84,6 @@ Try asking Claude: Claude will call the `twitter_advanced_search` tool automatically. -> "Find the top 3 laptops on Google Shopping under $1500 and resolve the merchant URL for each" +> "Find the top 3 laptops on Google Shopping under $1500 and list the stores selling each" -Claude will chain `google_shopping_search` with `google_shopping_product_click` for each result. +Claude will chain `google_shopping_search` with `google_shopping_offers` for each result. diff --git a/mcp/integrations/cline.mdx b/mcp/integrations/cline.mdx index 473dd8e..db76a84 100644 --- a/mcp/integrations/cline.mdx +++ b/mcp/integrations/cline.mdx @@ -48,6 +48,6 @@ After saving, Cline automatically detects the available tools. You should see 34 Try asking Cline to use a Google tool: -> "Search Google Shopping for laptops under $1500 and resolve the merchant URL for the top result" +> "Search Google Shopping for laptops under $1500 and list the stores selling the top result" -Cline will call `google_shopping_search` followed by `google_shopping_product_click` automatically. +Cline will call `google_shopping_search` followed by `google_shopping_offers` automatically. diff --git a/mcp/integrations/continue-dev.mdx b/mcp/integrations/continue-dev.mdx index c1163ed..69c2351 100644 --- a/mcp/integrations/continue-dev.mdx +++ b/mcp/integrations/continue-dev.mdx @@ -42,6 +42,6 @@ Continue.dev can import JSON configs from Claude Desktop, Cursor, or Cline direc ScrapeBadger exposes 344 tools to Continue.dev across Twitter/X, Google, YouTube, TikTok, Amazon, eBay, Reddit, real estate, and web scraping. In Agent mode, ask things like: -> "Search Google Shopping for the cheapest 16-inch laptop and resolve the merchant URL" +> "Search Google Shopping for the cheapest 16-inch laptop and list the stores selling it" -Continue.dev will call `google_shopping_search` followed by `google_shopping_product_click`. +Continue.dev will call `google_shopping_search` followed by `google_shopping_offers`. diff --git a/mcp/integrations/gemini.mdx b/mcp/integrations/gemini.mdx index 466d83f..7e7e56f 100644 --- a/mcp/integrations/gemini.mdx +++ b/mcp/integrations/gemini.mdx @@ -43,7 +43,7 @@ gemini "Search Google for 'best react state management 2026' and list the top 5 ``` ```bash -gemini "Find a Razer gaming headset on Google Shopping and resolve the merchant URL" +gemini "Find a Razer gaming headset on Google Shopping and list the stores selling it" ``` Gemini will discover and call the appropriate `google_search` / `google_shopping_*` tools. diff --git a/mcp/integrations/openclaw.mdx b/mcp/integrations/openclaw.mdx index 2faafb8..36f275c 100644 --- a/mcp/integrations/openclaw.mdx +++ b/mcp/integrations/openclaw.mdx @@ -40,4 +40,4 @@ openclaw ## Tools available -ScrapeBadger provides 344 tools to OpenClaw across Twitter/X, Google, YouTube, TikTok, Amazon, eBay, Reddit, real estate, and web scraping. The Google product family alone exposes 29 tools — search, maps, news, shopping (with merchant URL enrichment), trends, jobs, hotels, patents, scholar, and more. +ScrapeBadger provides 344 tools to OpenClaw across Twitter/X, Google, YouTube, TikTok, Amazon, eBay, Reddit, real estate, and web scraping. The Google product family alone exposes 29 tools — search, maps, news, shopping (search and seller offers), trends, jobs, hotels, patents, scholar, and more. diff --git a/mcp/integrations/windsurf.mdx b/mcp/integrations/windsurf.mdx index bd37ede..84d071f 100644 --- a/mcp/integrations/windsurf.mdx +++ b/mcp/integrations/windsurf.mdx @@ -42,6 +42,6 @@ Windsurf has a maximum of 100 tools across all MCP servers. ScrapeBadger exposes Ask Cascade in Agent mode: -> "Search Google Shopping for a gaming headset under $200 and return the merchant URL of the top result" +> "Search Google Shopping for a gaming headset under $200 and list the stores selling the top result" -Cascade will call `google_shopping_search` then `google_shopping_product_click`. +Cascade will call `google_shopping_search` then `google_shopping_offers`. diff --git a/mcp/overview.mdx b/mcp/overview.mdx index c038dde..25e3a29 100644 --- a/mcp/overview.mdx +++ b/mcp/overview.mdx @@ -114,8 +114,7 @@ Google MCP tools are prefixed with `google_` — highlights: | Tool | Description | |---|---| | `google_shopping_search` | Product search with filters + quick_filters + ads | - | `google_shopping_product` | Product detail with seller list | - | `google_shopping_product_click` | Resolve the real merchant URL per product | + | `google_shopping_offers` | Seller offers for one product by catalog_id or barcode | | Tool | Description | diff --git a/openapi-google.json b/openapi-google.json index e80934a..bd6cca3 100644 --- a/openapi-google.json +++ b/openapi-google.json @@ -3082,28 +3082,17 @@ "x-availability": "active" } }, - "/v1/google/shopping/product/click": { + "/v1/google/shopping/offers": { "get": { "tags": [ "Google Shopping" ], - "summary": "Resolve merchant URL for a Google Shopping product", - "description": "Resolve the real merchant URL for a product from Google Shopping.\n\nGoogle has removed direct merchant links from organic Shopping HTML,\nso the public /shopping/search response can only return the product\ntitle + price + source. This endpoint takes a product title (and\noptionally the source merchant) and uses Google's \"I'm Feeling Lucky\"\nredirect (`btnI=1`) to materialize the top merchant URL, mirroring\nthe per-product enrichment pattern exposes via\n`immersive product link`.\n\nWhen `source` is passed, the query is scoped with `site:{domain}`\nso the resolved URL lands on the exact merchant whose price was\nshown in the card (rather than a generic top organic match).\n\nTypical usage:\n 1. Call GET /shopping/search?q=laptop\n 2. Pick a product from the results\n 3. Call the product's click_link field to get the merchant URL\n\nCredits: 1 per call (one secondary HTTP fetch).", - "operationId": "shopping_product_click_api_v1_shopping_product_click_get", + "summary": "Seller offers by barcode or catalog ID", + "description": "Get the seller offers Google Shopping lists for one product: one entry per merchant, each with its own price and link.\n\nIdentify the product with exactly one of `catalog_id` or `barcode`:\n\n- `catalog_id` is Google's Shopping catalog identifier: the `catalog_id` field on a Shopping search result, or `prds=catalogid:` in a Google Shopping product URL. The sellers are read from Google's product page, every page of sellers fetched in parallel, so up to 60 offers come back.\n- `barcode` is a GTIN-8, UPC-A, EAN-13 or GTIN-14. Google Shopping does not match raw barcodes, so the barcode is first resolved to a product through a Google web search (`resolved_query`), and the offers come from a Shopping search for that product.\n\nCredits: 25 per call, whichever identifier you pass.", + "operationId": "shopping_offers_api_v1_shopping_offers_get", "parameters": [ { - "name": "title", - "in": "query", - "required": true, - "schema": { - "type": "string", - "description": "Exact product title from a search result", - "title": "Title" - }, - "description": "Exact product title from a search result" - }, - { - "name": "source", + "name": "barcode", "in": "query", "required": false, "schema": { @@ -3115,13 +3104,16 @@ "type": "null" } ], - "description": "Merchant source name from the shopping card (e.g. 'Walmart', 'Best Buy'). Forces the resolved URL to that merchant via site: operator.", - "title": "Source" + "description": "Product barcode: GTIN-8, UPC-A (12 digits), EAN-13 or GTIN-14. The check digit is validated. Exactly one of `barcode` / `catalog_id` is required.", + "title": "Barcode", + "examples": [ + "0711719541028" + ] }, - "description": "Merchant source name from the shopping card (e.g. 'Walmart', 'Best Buy'). Forces the resolved URL to that merchant via site: operator." + "description": "Product barcode: GTIN-8, UPC-A (12 digits), EAN-13 or GTIN-14. The check digit is validated. Exactly one of `barcode` / `catalog_id` is required." }, { - "name": "q", + "name": "catalog_id", "in": "query", "required": false, "schema": { @@ -3133,13 +3125,16 @@ "type": "null" } ], - "description": "Original search query (optional, improves disambiguation)", - "title": "Q" + "description": "Google Shopping catalog ID: the `catalog_id` on a Shopping search result, or `prds=catalogid:` in a Google Shopping product URL. Digits only. Exactly one of `barcode` / `catalog_id` is required.", + "title": "Catalog Id", + "examples": [ + "762120719996356571" + ] }, - "description": "Original search query (optional, improves disambiguation)" + "description": "Google Shopping catalog ID: the `catalog_id` on a Shopping search result, or `prds=catalogid:` in a Google Shopping product URL. Digits only. Exactly one of `barcode` / `catalog_id` is required." }, { - "name": "product_id", + "name": "gl", "in": "query", "required": false, "schema": { @@ -3151,22 +3146,10 @@ "type": "null" } ], - "description": "Stable product_id from the /shopping/search result", - "title": "Product Id" - }, - "description": "Stable product_id from the /shopping/search result" - }, - { - "name": "gl", - "in": "query", - "required": false, - "schema": { - "type": "string", - "description": "Country code", - "default": "us", + "description": "Country code (ISO 3166-1 alpha-2), for example `us`, `de` or `au`. Sets which merchants and which currency you see. When omitted, the country follows `domain` (`us` for `google.com`).", "title": "Gl" }, - "description": "Country code" + "description": "Country code (ISO 3166-1 alpha-2), for example `us`, `de` or `au`. Sets which merchants and which currency you see. When omitted, the country follows `domain` (`us` for `google.com`)." }, { "name": "hl", @@ -3179,72 +3162,18 @@ "title": "Hl" }, "description": "Language code" - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ShoppingClickResponse" - } - } - } - }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } - } - }, - "x-availability": "active" - } - }, - "/v1/google/shopping/product": { - "get": { - "tags": [ - "Google Shopping" - ], - "summary": "Product details", - "description": "Get detailed product information with seller offers.", - "operationId": "shopping_product_api_v1_shopping_product_get", - "parameters": [ - { - "name": "product_id", - "in": "query", - "required": true, - "schema": { - "type": "string", - "description": "Product ID from search results", - "title": "Product Id" - }, - "description": "Product ID from search results" - }, - { - "name": "gl", - "in": "query", - "required": false, - "schema": { - "type": "string", - "default": "us", - "title": "Gl" - } }, { - "name": "hl", + "name": "domain", "in": "query", "required": false, "schema": { "type": "string", - "default": "en", - "title": "Hl" - } + "description": "Google domain", + "default": "google.com", + "title": "Domain" + }, + "description": "Google domain" } ], "responses": { @@ -3253,20 +3182,22 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ShoppingProductResponse" + "$ref": "#/components/schemas/ShoppingOffersResponse" } } } }, + "400": { + "description": "Neither or both of `barcode` and `catalog_id` were passed." + }, + "404": { + "description": "The barcode did not resolve to a product, or Google lists no sellers for the catalog ID." + }, "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HTTPValidationError" - } - } - } + "description": "The barcode is malformed or fails its check digit, or `catalog_id` is not all digits." + }, + "502": { + "description": "Google did not return the product page. Not billed; retry." } }, "x-availability": "active" @@ -12659,64 +12590,6 @@ "title": "SearchInformation", "description": "Metadata about the search query." }, - "ShoppingClickResponse": { - "properties": { - "product_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Product Id" - }, - "title": { - "type": "string", - "title": "Title" - }, - "merchant_url": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Merchant Url" - }, - "merchant_domain": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Merchant Domain" - }, - "source_query": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Source Query" - } - }, - "type": "object", - "required": [ - "title" - ], - "title": "ShoppingClickResponse", - "description": "Response for GET /api/v1/shopping/product/click.\n\nReturns the direct merchant URL for a given product title by using\nGoogle's \"I'm Feeling Lucky\" redirect. Mirrors \nimmersive product link pattern \u2014 an on-demand per-product\nenrichment that materializes the merchant link that Google strips from\norganic Shopping HTML." - }, "ShoppingFilter": { "properties": { "name": { @@ -12785,20 +12658,26 @@ "title": "ShoppingFilterOption", "description": "A single filter option." }, - "ShoppingPrice": { + "ShoppingOffer": { "properties": { - "value": { + "position": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Value" + "title": "Position", + "description": "Place of the offer in Google's seller list." }, - "currency": { + "title": { + "type": "string", + "title": "Title", + "description": "The product title as the merchant lists it." + }, + "source": { "anyOf": [ { "type": "string" @@ -12807,31 +12686,33 @@ "type": "null" } ], - "title": "Currency" + "title": "Source", + "description": "The merchant (seller) name, for example `Walmart` or `Best Buy`." }, - "extracted": { + "price": { "anyOf": [ { - "type": "string" + "$ref": "#/components/schemas/ShoppingPrice" }, { "type": "null" } ], - "title": "Extracted" - } - }, - "type": "object", - "title": "ShoppingPrice", - "description": "Product price." - }, - "ShoppingProductDetail": { - "properties": { - "title": { - "type": "string", - "title": "Title" + "description": "The merchant's price: `value`, `currency` and `extracted` (the price as Google shows it)." }, - "description": { + "extracted_price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Extracted Price", + "description": "Numeric price, the same as `price.value`." + }, + "link": { "anyOf": [ { "type": "string" @@ -12840,9 +12721,11 @@ "type": "null" } ], - "title": "Description" + "title": "Link", + "description": "The merchant's product page URL.", + "x-todo": "TODO(SCR-764): provisional wording. What offers[].link contains is being changed; finalize this description before merging." }, - "brand": { + "delivery": { "anyOf": [ { "type": "string" @@ -12851,7 +12734,16 @@ "type": "null" } ], - "title": "Brand" + "title": "Delivery", + "description": "Shipping line as Google shows it." + }, + "extensions": { + "items": { + "type": "string" + }, + "type": "array", + "title": "Extensions", + "description": "Availability, shipping and returns lines Google shows for the offer." }, "rating": { "anyOf": [ @@ -12862,42 +12754,56 @@ "type": "null" } ], - "title": "Rating" - }, - "reviews_count": { + "title": "Rating", + "description": "Product rating on that merchant, when Google shows one." + } + }, + "type": "object", + "required": [ + "title" + ], + "title": "ShoppingOffer", + "description": "One merchant's offer for the product. In barcode mode an offer also carries the other fields of a Shopping search result (for example `thumbnail`, `product_id`, `gpcid`); fields Google does not show are `null`." + }, + "ShoppingOffersResponse": { + "properties": { + "barcode": { "anyOf": [ { - "type": "integer" + "type": "string" }, { "type": "null" } ], - "title": "Reviews Count" + "title": "Barcode", + "description": "The normalised barcode that was looked up (barcode mode)." }, - "price_range_low": { + "catalog_id": { "anyOf": [ { - "type": "number" + "type": "string" }, { "type": "null" } ], - "title": "Price Range Low" + "title": "Catalog Id", + "description": "The catalog ID that was looked up (catalog mode)." }, - "price_range_high": { + "total_offers": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" } ], - "title": "Price Range High" + "title": "Total Offers", + "description": "Total sellers Google lists for the catalog entry (catalog mode)." }, - "currency": { + "resolved_query": { "anyOf": [ { "type": "string" @@ -12906,49 +12812,73 @@ "type": "null" } ], - "title": "Currency" - }, - "sellers": { - "items": { - "$ref": "#/components/schemas/ShoppingSeller" - }, - "type": "array", - "title": "Sellers" + "title": "Resolved Query", + "description": "The product name the barcode resolved to through Google web search (barcode mode)." }, - "specs": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "title": "Specs" + "product_title": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Product Title", + "description": "Title of the matched product." }, - "images": { + "offers": { "items": { - "type": "string" + "$ref": "#/components/schemas/ShoppingOffer" }, "type": "array", - "title": "Images" + "title": "Offers", + "description": "One entry per merchant." } }, "type": "object", - "required": [ - "title" - ], - "title": "ShoppingProductDetail", - "description": "Detailed product information." + "title": "ShoppingOffersResponse", + "description": "Response for GET /v1/google/shopping/offers." }, - "ShoppingProductResponse": { + "ShoppingPrice": { "properties": { - "product": { - "$ref": "#/components/schemas/ShoppingProductDetail" + "value": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "Value" + }, + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Currency" + }, + "extracted": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Extracted" } }, "type": "object", - "required": [ - "product" - ], - "title": "ShoppingProductResponse", - "description": "Response for GET /api/v1/shopping/product." + "title": "ShoppingPrice", + "description": "Product price." }, "ShoppingProductResult": { "properties": { @@ -13103,17 +13033,6 @@ ], "title": "Link" }, - "click_link": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Click Link" - }, "page_token": { "anyOf": [ { @@ -13416,119 +13335,6 @@ "title": "ShoppingSearchResponse", "description": "Response for GET /api/v1/shopping/search." }, - "ShoppingSeller": { - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "link": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Link" - }, - "logo": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Logo" - }, - "price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Price" - }, - "original_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Original Price" - }, - "shipping": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Shipping" - }, - "tax": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "Tax" - }, - "total_cost": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Total Cost" - }, - "rating": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "Rating" - }, - "reviews_count": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "Reviews Count" - } - }, - "type": "object", - "required": [ - "name" - ], - "title": "ShoppingSeller", - "description": "A seller offering the product." - }, "ShortVideoResult": { "properties": { "position": { From 737dd828296d77db7b461bc4e711f1fb3a067d6a Mon Sep 17 00:00:00 2001 From: kasparasizi1 <132673909+kasparasizi1@users.noreply.github.com> Date: Tue, 1 Dec 2026 03:43:55 +0200 Subject: [PATCH 2/2] docs(SCR-764): offers[].link is the resolved merchant URL (Google redirect as fallback); stock/delivery in extensions Co-Authored-By: Claude Opus 5.5 --- api-reference/google/google-shopping/offers.mdx | 4 +--- google/shopping-offers.mdx | 2 +- openapi-google.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/api-reference/google/google-shopping/offers.mdx b/api-reference/google/google-shopping/offers.mdx index b846270..7573e46 100644 --- a/api-reference/google/google-shopping/offers.mdx +++ b/api-reference/google/google-shopping/offers.mdx @@ -20,13 +20,11 @@ curl "https://scrapebadger.com/v1/google/shopping/offers?catalog_id=762120719996 ## Offer fields -{/* TODO(SCR-764): the `offers[].link` row below is provisional wording. What offers[].link contains is being changed; finalize it (and the `link` description in openapi-google.json, ShoppingOffer.link) before merging. */} - | Field | Description | |---|---| | `offers[].source` | The merchant name, for example `Walmart` or `Best Buy`. | | `offers[].price` | `value`, `currency` and `extracted` (the price as Google shows it). | -| `offers[].link` | The merchant's product page URL. | +| `offers[].link` | The merchant's product page URL, resolved from Google's redirect. If Google does not release the destination in time, it is Google's redirect (`https://www.google.com/goto?url=…`), which still opens the merchant page in a browser. | | `offers[].delivery` | Shipping line as Google shows it. | | `offers[].extensions` | Availability, shipping and returns lines. | diff --git a/google/shopping-offers.mdx b/google/shopping-offers.mdx index 99a7356..4d4185f 100644 --- a/google/shopping-offers.mdx +++ b/google/shopping-offers.mdx @@ -5,7 +5,7 @@ description: "Get multi-seller Google Shopping prices for a product looked up by # Shopping Offers by Barcode or Catalog ID -`/v1/google/shopping/offers` returns a product's Google Shopping **seller offers** — one entry per merchant `source`, each with its own `price` and merchant `link`. Identify the product one of two ways (exactly one is required): +`/v1/google/shopping/offers` returns a product's Google Shopping **seller offers** — one entry per merchant `source`, each with its own `price`, merchant `link` (the product page on the merchant's site, resolved from Google's redirect) and `extensions` such as stock and delivery (`"In stock online"`, `"Free delivery"`). Identify the product one of two ways (exactly one is required): - **`barcode`** — Google Shopping no longer matches raw GTIN/UPC/EAN codes, so the barcode is first **resolved to a product** via a Google web search, then the Shopping seller list is fetched. - **`catalog_id`** — Google's own Shopping catalog identifier: what a Google Shopping product URL carries as `prds=catalogid:`, and the `catalog_id` field on [Shopping Search](/api-reference/google/google-shopping/search-products) tiles when Google exposes it there (for example `https://www.google.com/search?ibp=oshop&prds=catalogid:762120719996356571&gl=de&hl=de`). The seller list is read straight off Google's product page, every page of sellers fetched in parallel, so there is no resolve hop and no ambiguity about which product you get. diff --git a/openapi-google.json b/openapi-google.json index bd6cca3..ced01cb 100644 --- a/openapi-google.json +++ b/openapi-google.json @@ -12722,8 +12722,7 @@ } ], "title": "Link", - "description": "The merchant's product page URL.", - "x-todo": "TODO(SCR-764): provisional wording. What offers[].link contains is being changed; finalize this description before merging." + "description": "The merchant's product page URL, resolved from Google's redirect. If Google does not release the destination in time, Google's redirect URL (https://www.google.com/goto?url=...), which still opens the merchant page in a browser." }, "delivery": { "anyOf": [