# Integrate HasData Google Shopping API
## Task
Add the requested product search, shopping visibility or listing comparison workflow using HasData Google Shopping API.
Inspect project instructions, the server-side runtime, existing HTTP client, and tests first.
Follow the project's conventions and preserve unrelated code. No new SDK is required.
Implement only the requested workflow. If it is unclear, ask which query, market and product research workflow the application needs.
Keep the integration as REST API calls; do not replace it with an MCP connection or a custom Google scraper.
## References
Read the endpoint documentation before implementing:
- Product search, localization and filters: https://docs.hasdata.com/apis/google-serp/shopping.md
- Optional detailed product lookup: https://docs.hasdata.com/apis/google-serp/immersive-product.md
- Error handling: https://docs.hasdata.com/api-codes.md
- Documentation index: https://docs.hasdata.com/llms.txt
- Full documentation (fallback): https://docs.hasdata.com/llms-full.txt
Start with the endpoint reference. Use `llms.txt` to find additional pages.
Use `llms-full.txt` only when needed; extract relevant sections instead of loading everything into context.
If a `.md` reference is unavailable, try its HTML URL without `.md`.
If it is still unavailable, ask for the missing documentation rather than guessing.
## Optional agent skill
If the official `hasdata` skill is already available, use its relevant guidance.
Otherwise, if this agent supports skills, ask before installing it in this project:
```sh
npx skills add hasdata/agent-skills --skill hasdata
```
Run from the project directory and select the coding agent in use.
The `hasdata-cli` skill is not required. If installation is declined or unsupported, continue with the docs.
Flag conflicts between skill guidance and current API docs rather than guessing.
## Implementation
- Use `GET https://api.hasdata.com/scrape/google/shopping` with required `q`. Use the project’s HTTP client to encode query parameters.
- Expose only requested documented options such as `location`, `gl`, `hl` and `deviceType`. Preserve query, market, language and device context with saved observations. Do not invent a currency-conversion parameter.
- Read `shoppingResults` separately from optional `inlineShoppingResults`, `filters` and `refineSearchFilters`. Missing blocks, ratings, delivery text or product tokens are valid; do not promise a fixed result count.
- Preserve `productId` as a string. Product IDs, matching titles and shared Google groupings do not prove identical pack sizes, models, condition or seller offers.
- Keep display prices and numeric `extractedPrice` together. Validate currency, variants and quantities before comparisons; listed prices are not final checkout totals. Price histories, alerts and currency normalization belong to the application.
- For filters, use the returned camelCase `hasdataLink` and its query context. The prose docs call it `hasdata_link`; inspect the actual response and do not silently assume snake_case. Do not combine opaque `shoprs` values using invented rules.
- Before following any returned API link, require the exact `https://api.hasdata.com` origin and the intended endpoint path. Do not forward credentials to Google, merchants or arbitrary redirects.
- For requested pagination, use only documented parameters and inspect `pagination.next`. This is a Google URL, not an authenticated API endpoint. Prevent repeated-page loops and stop if no new results are returned; never promise an exhaustive inventory.
- Only identify sponsored listings from explicit returned labels. Do not infer ad status from position, product category or the presence of a shopping filter.
- Only if detailed product information is requested, send a returned `immersiveProductPageToken` as `pageToken` to `GET https://api.hasdata.com/scrape/google/immersive-product`. This is a separate API request, not included seller detail. Never manufacture or truncate tokens.
- Handle timeouts and documented errors before reading data. Keep requests server-side. If no suitable runtime exists, discuss options before changing the architecture.
## Credentials
- Implement the integration and mocked tests without requiring a live API key.
- Read `HASDATA_API_KEY` from the project's existing environment or secret store and send it as `x-api-key`.
- If the key is missing before live verification, ask the user to configure it from https://app.hasdata.com/api-keys.
- Never ask the user to paste the key into chat. Check only that it is configured, without printing its value.
- Never put the key in browser code, logs, or version control. Add only a placeholder to the project's example configuration.
- If using a local `.env` file, make sure it is gitignored.
- Send the key only to `https://api.hasdata.com`. Never forward it to documentation, Google, retailer links, media links, or redirects to another origin.
## Verification
- Add mocked tests for query encoding, market context, optional fields, large string IDs, duplicate listings, currency and pack-size mismatches, safe link handling, missing product tokens, repeated pagination, empty results and errors. Include a usage example and run local checks.
- With a configured key and explicit user approval, including approval already given for this task, make one live verification request with agreed inputs. A successful Google Shopping API request consumes 10 credits.
- Verify the requested Shopping search only. Do not automatically expand product tokens or follow filters and pagination.
- Validate the HTTP status, documented API status, and response structure. An empty result set can be valid.
- Do not automatically repeat paid requests to obtain a nonempty response.
- Report changed files, setup commands, and test results. State separately whether live verification passed, failed, or was skipped.
- Ask before deploying.Google Shopping Results API
with products, prices, and seller ratings
Search Google Shopping and get the whole grid as clean JSON. One request returns every listing with title, price, seller, rating, and delivery across the sponsored, organic, and comparison blocks, with geo-targeting handled for you.
of requests succeed
median response
95% finish faster
per 1k shopping searches at volume
Google reshuffles Shopping constantly. Your parser shouldn't care.
- Prices in a dozen currencies and formats
- Sponsored and organic listings mixed together
- Sellers and ratings nested per product
- Immersive product pages behind tokens
- Re-parse the grid after each redesign
One GET Request. That's the whole integration.
Start with just a query. Add more parameters when your use case needs them.
Google Shopping API
curl -G 'https://api.hasdata.com/scrape/google/shopping' \
--data-urlencode 'q=Coffee' \
--data-urlencode 'location=Austin,Texas,United States' \
--data-urlencode 'deviceType=desktop' \
--header 'x-api-key: <YOUR_API_KEY>' \
--header 'Content-Type: application/json'q * Search Querylocation Locationuule Encoded Locationdomain Domaingl Countryhl Languagetbs Advanced Search Parametersshoprs Search Filter IDstart Result OffsetdeviceType DeviceAdd Google Shopping API with your AI agent
Paste a ready-to-use integration prompt into your coding agent. It includes API references, setup requirements, and testing instructions.
Build with Google Shopping API
Build price comparison, product discovery and retail intelligence tools with structured Google Shopping results.
Compare listed product prices
Build price comparison tools from Google Shopping listings, keeping retailer, product and currency context alongside each price.
- Maud's Medium Roast Coffee Pods
- Product ID: 16423636685550094143
| Retailer | Listed price |
|---|---|
| SERA | $74.24 |
| Maud's | $14.45 |
| Maud's | $27.90 |
- API data
shoppingResults[].titleshoppingResults[].productIdshoppingResults[].sourceshoppingResults[].extractedPrice- Your app
- Match pack sizes, variants and conditions before comparing offers. Save repeated observations to calculate price changes and trigger alerts.
Track visibility for product searches
Track Google Shopping positions for target keywords to understand where your products and competing listings appear.
- Coffee
- Austin, TX
- United States
| Position | Product |
|---|---|
| 11 | Maud's Decaf Dark Medium Roast Coffee Pods |
| 12 | Maud's Purely Organic Dark Roast Coffee Pods |
| 19 | Intelligent Blends Caramel Macchiato Coffee Pods 32ct |
- API data
shoppingResults[].positionshoppingResults[].titleshoppingResults[].productId- Your app
- Store query, location, device and observation time with each result. Calculate position changes from comparable saved searches.
Shortlist products for market research
Use product ratings and review counts to shortlist items for assortment research and ecommerce catalog expansion.
- Coffee
- Austin, TX
- United States
| Product | Rating | Reviews |
|---|---|---|
| Maud's Purely Organic Dark Roast Coffee Pods | 5 | 79 |
| Intelligent Blends Caramel Macchiato Coffee Pods 32ct | 5 | 145 |
| Maud's Holiday Blend Coffee Pods Variety Pack 42 ct 6 Assorted Flavors | 4.5 | 663 |
- API data
shoppingResults[].titleshoppingResults[].ratingshoppingResults[].reviewsshoppingResults[].immersiveProductPageToken- Your app
- Apply your own selection criteria, then request detailed seller offers or specifications for products with an immersive product token.
Build a more focused shopping search
Turn available shopping filters into product discovery controls for shoppers researching categories, attributes or price ranges.
- Coffee
- Austin, TX
- United States
| Filter group | Option |
|---|---|
| Type | Whole Bean |
| Type | Ground |
| Type | Instant |
- API data
refineSearchFilters[].typerefineSearchFilters[].options[].titlerefineSearchFilters[].options[].hasdataLink- Your app
- Render the returned options and make the next filtered request when a user chooses one, retaining its query and location context.
Find retailers appearing in your category
Identify sellers in Google Shopping results to research retail coverage, distribution opportunities and competing offers.
- Coffee
- Austin, TX
- United States
| Retailer | Product |
|---|---|
| Maud's | Intelligent Blends Caramel Macchiato Coffee Pods 32ct |
| eBay | Maud's Decaf Espresso Dark Roast Coffee Pods |
| Blue Bottle Coffee | Blue Bottle Coffee Kitchen New Blue Bottle Coffee Craft Instant Espresso Multiserve |
- API data
shoppingResults[].sourceshoppingResults[].titleshoppingResults[].position- Your app
- Group listings by seller in your application, review relevant offers and verify business identity before adding retailers to your research list.
Every block, one predictable schema
Inspect product listings, refine the search, and find the next results page. Available blocks depend on the query.
shoppingResults
[
{
"position": 1,
"title": "Apple MacBook Air M1 Chip",
"productId": "1434325277585982111",
"immersiveProductPageToken": "eyJyZHMiOiJQQ18xMTUyMzM4MDc3ODU0NDE0ODQx...",
"price": "$419.00",
"extractedPrice": 419,
"source": "Walmart - Seller",
"rating": 4.6,
"reviews": 18000,
"delivery": "Free delivery",
"extensions": ["LOW PRICE"],
"thumbnail": "https://files.hasdata.com/1a268bee-f995-47dc-bf45-4db0e738eba2.webp"
}
]position numberRank within the shopping grid
title stringProduct name as listed
productId stringGoogle's product identifier
price / extractedPrice string / numberDisplay price and its numeric value
source stringSeller or retailer behind the listing
rating / reviews numberAverage rating and review count
delivery stringDelivery terms shown on the card
extensions string[]Badges like LOW PRICE or SALE
immersiveProductPageToken stringToken to pull the full product page
inlineShoppingResults
The comparison strip Google shows above the main grid.
[
{
"position": 1,
"title": "Apple MacBook Neo (A18 Pro, 2026) Laptop - 256GB, Indigo",
"link": "https://www.target.com/p/apple-macbook-neo-a18-pro-2026-laptop/",
"source": "Target",
"price": "$699.99",
"extractedPrice": 699.99,
"thumbnail": "https://files.hasdata.com/c1fe8843-16e2-4645-9a1d-6824879647d9.png"
}
]position numberOrder within the inline strip
title stringProduct name
link stringDirect URL to the retailer's page
source stringRetailer name
price / extractedPrice string / numberDisplay price and its numeric value
thumbnail stringProduct image URL
filters
[
{
"type": "Sponsored products",
"inputType": "link_with_icon",
"options": [
{
"text": "On sale",
"hasdataLink": "https://api.hasdata.com/scrape/google/shopping?q=macbook+air+sale"
}
]
}
]type stringFilter group name, e.g. Price or Brand
inputType stringHow the filter is rendered
options[] object[]Selectable values in the group
options[].text stringLabel of the filter option
options[].hasdataLink stringReady-made request for the filtered view
refineSearchFilters
[
{
"type": "Type",
"options": [
{
"title": "Whole Bean",
"link": "https://www.google.com/search?q=whole+bean+coffee&hl=en&gl=us&udm=28&shoprs=CAEYASoGY29mZmVlMhoIARIKV2hvbGUgQmVhbjoKCO7-OBDx_jgwAli3yx9gAg&sa=X&ved=2ahUKEwjCyqu8i--WAxVw7skDHQipCDUQ268JKAB6BAgYEAs",
"hasdataLink": "https://api.hasdata.com/scrape/google/shopping?q=whole+bean+coffee&hl=en&gl=us&shoprs=CAEYASoGY29mZmVlMhoIARIKV2hvbGUgQmVhbjoKCO7-OBDx_jgwAli3yx9gAg"
}
]
}
]type stringRefinement category
options[].title stringSuggested refinement
options[].link stringGoogle Shopping URL for the refinement
options[].hasdataLink stringAPI URL for the refined search
pagination
This is a Google search URL, not an API request URL.
{
"next": "https://www.google.com/search?q=Coffee&sca_esv=8f75b58b20ab037a&hl=en&gl=us&udm=28&prmd=ivnsmb&ei=FXGoaoLsMPDcp84PiNKiqAM&start=10&sa=N"
}next stringGoogle search URL for the next results page
An all-in-one scraping service
Every feature you need to collect data from thousands to millions of requests.
Discover similar
scrapers and APIs
to expand your projects.
Google Immersive Product API
Price Monitoring • $0.42 / 1k Request
Google SERP API
Live SERP Data • $0.83 / 1k Request
Fits right into your stack.
Works with the tools you already use.
View Documentation ->Teams that deleted their scraper
Now it's the part of the pipeline they don't think about
HasData delivers exactly what we need: speed and comprehensive search features. It's the fastest API we've used in this space. Plus, their customer support is fantastic.
We rely on HasData for search performance data and broader scraping needs. Their APIs deliver highly structured data that integrates directly into our platforms.
Great web scraping API which is incredibly easy to use. It requires minimal effort to get up and running, and the documentation is very clear and helpful.
I needed to scrape some information they didn't already support, and they wrote the code for me right away, which was super nice of them.
We were particularly impressed with how easily we could integrate HasData into our existing workflow.
Plans that get cheaper at scale
Fixed price, fixed volume, no surprises at the end of the month. Upgrade when you need more.
Free
Startup
Basic
RecommendedGrowth
Monthly shopping search volume
Custom price based on required volume
Past 20M credits a month, or terms the self-serve plans do not cover. We shape the contract around your workload. Past 20M credits a month, or need terms the self-serve plans do not cover? We shape the contract, concurrency, and support around your workload.
HasData accesses publicly available data only. Google Shopping's terms may restrict automated access; you are responsible for compliance. Where data includes personal information, ensure a lawful basis under GDPR/CCPA.
Questions, answered
The full shopping grid in shoppingResults, the comparison strip in inlineShoppingResults, and the available filters, each with title, price, seller, rating, delivery, and images. One request covers the whole page.
Use explicit sponsored labels when they are present in the response. Not every result layout provides a reliable paid-versus-organic distinction. A listing's position, category or the presence of a shopping filter is not enough to classify it as an ad.
Each card carries a price, seller, rating, and images, and a page has dozens of them. Median response is around 5.7 seconds. Run searches concurrently and it scales fine.
Per successful request. One request is one shopping search and returns the whole grid. A failed request costs nothing.
Yes. The free plan renews 1,000 credits every month, which is 100 shopping searches with every field included. No credit card required. When you outgrow it, pick a plan that fits your volume.
One shopping search costs 10 credits. The unit price drops with volume, from about $2.45 down to $0.75 per 1,000 searches. Need more than the top plan covers? We'll set a custom rate.
No. Requests run on HasData's infrastructure, so there's nothing to provision or maintain. You're responsible for using the results in line with each target site's terms and applicable law.
Yes, you can cancel your subscription at any time from your dashboard in a few seconds. Once cancelled, there are no recurring payments.
Your first shopping search
is minutes away
100 shopping searches free · no credit card