> For the complete documentation index, see [llms.txt](https://docs.scraperapi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scraperapi.com/getting-started/tutorials/api-tutorials/google-shopping-api.md).

# Google Shopping

API Playground is ScraperAPI's request builder for testing and configuring scraping requests. In this tutorial, you will use the API Playground to monitor Google Shopping prices for any query list. By the end, you will have shopping results with price, retailer, and delivery options for every query you track, so you can spot pricing shifts and new entrants before they affect your positioning.

***

## Step 1: Configure the Google Shopping endpoint

Open the [**API Playground**](https://dashboard.scraperapi.com/apiplayground) from the left sidebar.

1. Select scraping method: **Structured Data Endpoints**.
2. In the endpoint dropdown, select **Google Shopping**.
3. Enter query `running shoes`. Set **Country code** to `us`.
4. Review the Summary panel on the right to understand the cost of the job before you run it.
5. Scroll down to the generated code and click **Try it**.

The Playground runs the request and shows the response inline. Each entry in `shopping_results` includes `position`, `title`, `price`, `extracted_price`, `source`, and `delivery_options`. Use `extracted_price` for numeric comparisons — `price` is a formatted string.

{% hint style="info" %}
Use the language dropdown to switch to Python, Node.js, PHP, Ruby, or Java. Click **Copy to clipboard** to run the request in your own terminal instead.
{% endhint %}

## Step 2: Additional options and filters

Use **Additional options & filters** to fine-tune your request. The Playground adds the relevant parameters to the generated code automatically.

* **Country code** adds `country_code`. Targets a specific country's Google Shopping results.
* **Domain** adds `domain`. Sets the Google domain to search (e.g. `co.uk`, `com.au`).
* **Output format** adds `output_format`. Returns results as `json` (default) or `csv`.
* **UULE** adds `uule`. Encodes a specific city for local search results. Generate a UULE value using a UULE encoder tool.
* **Number of results** adds `num`. Sets how many shopping results to return per page.

{% hint style="info" %}
Some parameters increase the cost per request. Check the Summary panel before committing to a configuration at scale.
{% endhint %}

## Step 3: Batch across queries and markets

Switch the scraping method to **Async** in the Playground and paste your queries as full structured endpoint URLs, one per line:

```
https://api.scraperapi.com/structured/google/shopping?query=running+shoes&country_code=us
https://api.scraperapi.com/structured/google/shopping?query=running+shoes&country_code=gb
https://api.scraperapi.com/structured/google/shopping?query=trail+running+shoes&country_code=us
https://api.scraperapi.com/structured/google/shopping?query=trail+running+shoes&country_code=gb
```

The response returns a `statusUrl` per job that you can use to track progress.

## Step 4: Poll for results

Async jobs run in the background. Use the `statusUrl` from the batch response to check progress. When `status` is `finished`, the `response.body` field contains your scraped data.

```bash
for STATUS_URL in \
  "https://async.scraperapi.com/jobs/JOB_ID_1" \
  "https://async.scraperapi.com/jobs/JOB_ID_2"; do
  while true; do
    STATUS=$(curl -s "$STATUS_URL" | python3 -c "import sys,json; print(json.load(sys.stdin)['status'])")
    echo "$STATUS_URL: $STATUS"
    if [ "$STATUS" = "finished" ]; then break; fi
    sleep 5
  done
done
```

## Step 5: Schedule daily runs

To run your batch automatically on a recurring schedule, add it to your crontab. The example below runs every day at 6am.

```bash
0 6 * * * /usr/bin/bash /path/to/submit_shopping_batch.sh >> /var/log/shopping_monitor.log 2>&1
```

***

{% hint style="info" %}
Prefer a no-code setup? [Monitor Google Shopping prices with DataPipeline instead](/getting-started/tutorials/no-code-tutorials/google-shopping-no-code.md).
{% endhint %}

## More API tutorials

* [Scrape any URL](/getting-started/tutorials/api-tutorials/any-url-api.md)
* [Track prices across Amazon and Walmart](/getting-started/tutorials/api-tutorials/track-prices-api.md)
* [Monitor unauthorized sellers and MAP violations](/getting-started/tutorials/api-tutorials/monitor-sellers-api.md)
* [Track daily keyword rankings](/getting-started/tutorials/api-tutorials/keyword-rankings-api.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scraperapi.com/getting-started/tutorials/api-tutorials/google-shopping-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
