> 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/track-prices-api.md).

# Track Prices

API Playground is ScraperAPI's request builder for testing and configuring scraping requests. In this tutorial, you will use the API Playground to monitor prices across Amazon and Walmart. By the end, you will have a scheduled batch job that returns structured JSON with pricing and availability for every product you monitor, so you can detect price changes and stock issues before they affect your margins.

***

## Step 1: Configure the Amazon product 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 **Amazon Product**.
3. Enter ASIN `B0BFC7WQ6R`. 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 full structured response inline. Key fields include `name`, `pricing`, `list_price`, `availability_status`, `average_rating`, `total_reviews`, `feature_bullets`, `images`, `sold_by`, and per-star rating percentages.

{% 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 Amazon or Walmart results.
* **Domain** adds `domain`. Sets the Amazon domain (e.g. `co.uk`, `com.au`).
* **Output format** adds `output_format`. Returns results as `json` (default) or `csv`.
* **Activate retrying 404 responses** adds `retry_404`. Retries requests that return a 404 instead of treating them as final.

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

## Step 3: Add Walmart

1. Back in the Playground, switch the endpoint dropdown to **Walmart product**.
2. Enter a Walmart product ID — for example `946796118`.
3. Click **Try it**.

Once you have reviewed both responses, you are ready to batch across your full product list.

## Step 4: Submit a batch

For a full product list across retailers, switch the scraping method to **Async** in the Playground. Paste your ASINs and product IDs as full structured endpoint URLs, one per line:

```
https://api.scraperapi.com/structured/amazon/product?asin=B0BFC7WQ6R&country=us
https://api.scraperapi.com/structured/amazon/product?asin=B09B8V1LZ3&country=us
https://api.scraperapi.com/structured/walmart/product?product_id=946796118
https://api.scraperapi.com/structured/walmart/product?product_id=741412707
```

The response returns an array, one object per URL, each with an `id` and a `statusUrl`.

## Step 5: 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 6: Deliver to cloud storage and skip polling

Instead of polling, configure a destination in your dashboard under **Destinations** and add a `callback` to your batch request. Results land in your bucket automatically when each job finishes.

```bash
curl -X POST "https://async.scraperapi.com/batchjobs" \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "API_KEY",
    "urls": ["..."],
    "callback": {
      "type": "s3",
      "url": "my-destination-name"
    }
  }'
```

## Step 7: 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/curl -X POST "https://async.scraperapi.com/batchjobs" \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"API_KEY","urls":[...],"callback":{"type":"s3","url":"my-destination-name"}}'
```

***

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

## More API tutorials

* [Scrape any URL](/getting-started/tutorials/api-tutorials/any-url-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)
* [Monitor Google Shopping prices](/getting-started/tutorials/api-tutorials/google-shopping-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/track-prices-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.
