---
title: "Amazon Search Scraper: Track Keyword Rankings with Python"
url: https://www.datawebot.com/blog/amazon-search-scraper
description: "Scrape Amazon search results for any keyword: every slot with its page, position, organic rank and ad flag as JSON, plus a tested Python rank tracker."
published: 2026-11-17
updated: 2026-11-17
author: Wilhendra Akmam
---

Blog

# Amazon search scraper: track keyword rankings and ads on Amazon search results, with Python

Scrape Amazon search results for any keyword: every slot with its page, position, organic rank and ad flag as JSON, plus a tested Python rank tracker.

[Wilhendra Akmam](https://www.datawebot.com/about#wilhendra-akmam) Published November 17, 2026

An Amazon search scraper reads the results page Amazon shows for a keyword and turns it into data: every product on the page, in order, with its ASIN, title, price, rating, review count and whether the slot is an ad. One read tells you what a shopper sees. The same read every day tells you where your products rank, who is buying the ad slots above them, and when that changes.

This guide shows how to do that with one API call per keyword. It starts with what a search results page holds and how ranks work when ads sit between organic results, then gives a tested Python script of about 120 lines that tracks a brand across several keywords in two Amazon countries and appends every slot to a CSV file, one row per slot per day. Every number below comes from a real run on 17 November 2026.

## What does an Amazon search scraper return?

Amazon's results page is a grid of slots. Most hold organic results, the products Amazon ranks for the keyword. Some hold sponsored products, which sellers pay for, and they sit in fixed groups between the organic ones. A useful scraper keeps every slot in the order Amazon showed it, and tells you which is which.

The datawebot Amazon search endpoint returns one record per slot with these fields:

| Field | What it holds |
| --- | --- |
| `asin` | Amazon's 10-character product code |
| `page` | The results page the slot was on, from 1 |
| `position` | The slot's place on that page, counting ads and organic results together |
| `sponsored` | `true` for an ad, `false` for an organic result |
| `title`, `url` | The listing title and its `/dp/ASIN` link |
| `price` | Amount, currency and the price as Amazon printed it |
| `rating`, `review_count` | The star rating and number of reviews shown on the results page |

You send the search URL, such as `https://www.amazon.com/s?k=insulated+water+bottle`, and how many result pages to read, from 1 to 25. Each page costs 5 credits.

## Why does the organic rank differ from the slot?

Because ads come first. This is the top of the results for "insulated water bottle" on amazon.com, read on 17 November 2026 a little after 04:30 UTC:

| Slot | Organic rank | Ad? | ASIN | Title (shortened) | Price | Rating (reviews) |
| --- | --- | --- | --- | --- | --- | --- |
| 1 |   | Yes | B07DKJ2NVR | Drinco Stainless Steel Water Bottle, Spout Lid | $22.95 | 4.7 (7,100) |
| 2 |   | Yes | B0GTFTVD9S | DYSANKY 64oz Insulated Water Bottle w/Straw | $27.99 | 4.6 (4,800) |
| 3 |   | Yes | B0B2JQPNVR | Farsea Insulated Water Bottle With Paracord Handle | $20.99 | 4.4 (3,400) |
| 4 |   | Yes | B0D2W1MKZX | Fijinhom Insulated Water Bottle with Handle | $13.99 | 4.4 (2,100) |
| 5 | 1 | No | B0BZYCJK89 | Owala FreeSip Stainless Steel Water Bottle 24 oz | $29.99 | 4.6 (146,000) |
| 6 | 2 | No | B0D8J2ZB8P | POWCAN 26 oz Insulated Water Bottle | $16.99 | 4.5 (13,600) |
| 7 | 3 | No | B0F2SJ3LRC | Amazon Basics Insulated Stainless Steel Water Bottle | $13.58 | 4.4 (741) |
| 8 | 4 | No | B085DV8T75 | Owala FreeSip Stainless Steel Water Bottle 24 oz | $29.99 | 4.6 (146,000) |

The first organic result sits in slot 5, below four ads. Page one held 59 slots in all, 12 of them ads, in groups of four at slots 1 to 4, 11 to 14 and 19 to 22. If you count slots, Owala's top bottle ranks fifth; if you count organic results, it ranks first. Both numbers matter, and they answer different questions:

- **Organic rank** is where Amazon's own ranking put the product. It is what SEO work on a listing moves.
- **Slot** is where a shopper actually sees it. It is what ads above you push down.

That is why a rank tracker needs every slot in order, ads included, and not only a list of organic results. The script below stores both.

## How do you track Amazon keyword rankings with Python?

The script takes a brand name and a list of keywords, searches each keyword on amazon.com and amazon.co.uk at the same time, and appends every slot of the first two result pages to `rankings.csv`. It then prints, for each search, how many page-one slots the brand holds and the brand's best organic rank. It uses the standard library only and needs Python 3.9 or later.

### Get access

Every account starts with 200 free credits, and sign-in is by email. The quickest way is to give your coding agent (Claude Code, Cursor or similar) this line:

```
set up https://mcp.datawebot.com/setup.md
```

The agent asks for your email and you approve the sign-in from the email datawebot sends. The key is saved to `~/.datawebot/credentials`, readable only by you, and the script reads it from there. That key lasts 30 days. For a script that runs every day, create a key that lasts 90 or 365 days on the [dashboard](https://www.datawebot.com/dashboard) under API keys, and put it in an environment variable named `DATAWEBOT_API_KEY` from your secret store. Never commit it.

### The script

```
"""Track where a brand's products rank in Amazon search, organic and sponsored,
for several keywords and Amazon countries. Appends every slot to rankings.csv
so each run adds to the history. Standard library only."""
import csv, datetime, json, os, re, sys, time, urllib.parse, urllib.request
from concurrent.futures import ThreadPoolExecutor

API = "https://api.datawebot.com/v1/requests"
MARKETS = [("amazon.com", "US"), ("amazon.co.uk", "GB")]  # (Amazon site, country)
PAGES = int(os.environ.get("PAGES", "2"))  # result pages per keyword, 5 credits each
FIELDS = ["date", "as_of", "site", "keyword", "page", "slot", "organic_rank",
          "sponsored", "asin", "title", "price", "currency", "price_text",
          "rating", "reviews", "url"]

def api_key():
    key = os.environ.get("DATAWEBOT_API_KEY")
    if key:
        return key
    # Written by the agent setup (https://mcp.datawebot.com/setup.md).
    with open(os.path.expanduser("~/.datawebot/credentials")) as f:
        return json.load(f) · ["profiles"]["https://mcp.datawebot.com"]["api_key"]

def call(method, url, body=None):
    req = urllib.request.Request(url, method=method,
        data=json.dumps(body).encode() if body else None,
        headers={"Authorization": "Bearer " + api_key(),
                 "Content-Type": "application/json",
                 "User-Agent": "amazon-rank-tracker-example/1.0"})
    with urllib.request.urlopen(req, timeout=180) as r:
        return json.loads(r.read())

def wait(res):
    """When an answer is "working", poll until it is done."""
    for _ in range(90):
        if res.get("status") != "working":
            return res
        time.sleep(res.get("check_after_seconds") or 4)
        res = call("GET", f"{API}/{res['request_id']}")
    raise RuntimeError("still working after six minutes; try again later")

def search(site, country, keyword, today):
    """Every slot on the first PAGES result pages, in the order Amazon shows them."""
    url = f"https://www.{site}/s?k={urllib.parse.quote_plus(keyword)}"
    key = re.sub(r"[^a-zA-Z0-9_-]", "-", f"{today}-{site}-{keyword}") · [:128]
    res = wait(call("POST", API, {
        "capability": "endpoint", "endpoint": "amazon.search_items",
        "url": url, "country": country, "max_pages": PAGES,
        "format": "raw", "request_key": key}))
    if res.get("status") != "done":
        print(f"{site} '{keyword}': {res.get('status')} {res.get('error')}")
        return []
    as_of = res["meta"]["as_of"]
    raw, products = list(res.get("raw") or []), list(res.get("products") or [])
    while res.get("next_cursor"):  # results come in parts; reading them is free
        cursor = urllib.parse.quote(res["next_cursor"])
        res = call("GET", f"{API}/{res['request_id']}?cursor={cursor}")
        raw += res.get("raw") or []
        products += res.get("products") or []
    rows, organic = [], 0
    for record, product in zip(raw, products):
        if not product["url"].endswith(record["asin"]):
            continue  # the two lists should line up; skip a slot if they don't
        if not record["sponsored"]:
            organic += 1
        price = product.get("price") or {}
        rows.append({
            "date": today, "as_of": as_of, "site": site, "keyword": keyword,
            "page": record["page"], "slot": record["position"],
            "organic_rank": "" if record["sponsored"] else organic,
            "sponsored": record["sponsored"], "asin": record["asin"],
            "title": product["title"], "price": price.get("amount"),
            "currency": price.get("currency"), "price_text": price.get("text"),
            "rating": product.get("rating"),
            "reviews": product.get("review_count"), "url": product["url"]})
    return rows

def summary(rows, brand):
    """Best organic rank for the brand and how much of page one it holds."""
    site, keyword = rows[0]["site"], rows[0]["keyword"]
    ours = [r for r in rows if brand.lower() in r["title"].lower()]
    page1 = [r for r in rows if r["page"] == 1]
    ours1 = [r for r in ours if r["page"] == 1]
    ads1 = sum(r["sponsored"] for r in page1)
    best = next((r for r in ours if not r["sponsored"]), None)
    line = (f"{site} '{keyword}': {len(page1)} slots on page 1 ({ads1} ads); "
            f"{brand} holds {len(ours1)} of them "
            f"({sum(r['sponsored'] for r in ours1)} sponsored)")
    if best:
        line += (f"; best organic rank {best['organic_rank']} (page {best['page']}, "
                 f"slot {best['slot']}): {best['asin']} {best['price_text']}, "
                 f"{best['rating']} from {best['reviews']} reviews")
    else:
        line += f"; no organic result in the first {PAGES} pages"
    return line

def main(brand, *keywords):
    today = datetime.date.today().isoformat()
    jobs = [(site, country, k) for site, country in MARKETS for k in keywords]
    with ThreadPoolExecutor(max_workers=4) as pool:
        results = list(pool.map(lambda j: search(*j, today), jobs))
    new = not os.path.exists("rankings.csv")
    with open("rankings.csv", "a", newline="", encoding="utf-8") as f:
        writer = csv.DictWriter(f, fieldnames=FIELDS)
        if new:
            writer.writeheader()
        for rows in results:
            writer.writerows(rows)
    print(f"Appended {sum(map(len, results))} slots to rankings.csv")
    for rows in results:
        if rows:
            print(summary(rows, brand))

if __name__ == "__main__":
    if len(sys.argv) < 3:
        sys.exit('usage: python amazon_rank_tracker.py BRAND "keyword" ["keyword" ...]')
    main(*sys.argv[1:])
```

Save it as `amazon_rank_tracker.py` and run it with a brand and one or more keywords:

```
python amazon_rank_tracker.py Owala "insulated water bottle" "water bottle with straw" "kids water bottle"
```

### How it works

`search` sends one request per keyword and country to the `amazon.search_items` endpoint, the same Amazon search endpoint every time, so each day's run reads the results the same way. It asks for two formats in one answer: `raw`, the endpoint's own records with `page`, `position` and `sponsored` for each slot, and the standard `products` list with the price as a number and its currency. The two lists come back in the same order, one entry per slot, and the script joins them.

Results come back in parts of 50. The script follows `next_cursor` until it runs out; reading the parts costs nothing more. It counts organic results as it goes to give each one its `organic_rank`, and leaves that column empty for ads.

`MARKETS` sets the Amazon countries. To add one, add a line such as `("amazon.de", "DE")` or `("amazon.ca", "CA")`; the endpoint reads 20 Amazon country stores, listed on the [Amazon scraper page](https://www.datawebot.com/scraper/amazon). `PAGES` sets how deep to read: one page is about 60 slots, and two pages is about 110 to 115.

Every request carries a `request_key` made of the date, the store and the keyword. If the script runs a second time on the same day, it gets the same answers back without paying again. Run it once a day, from cron or a scheduled task, and `rankings.csv` grows by one set of rows per keyword per day. Our guide to [running datawebot on your own schedule](https://www.datawebot.com/docs/schedule) shows how to set that up.

### What it printed

This is the real output of the run on 17 November 2026, a little after 04:30 UTC, three keywords in two countries:

```
Appended 676 slots to rankings.csv
amazon.com 'insulated water bottle': 59 slots on page 1 (12 ads); Owala holds 11 of them (1 sponsored); best organic rank 1 (page 1, slot 5): B0BZYCJK89 $29.99, 4.6 from 146000 reviews
amazon.com 'water bottle with straw': 59 slots on page 1 (12 ads); Owala holds 8 of them (0 sponsored); best organic rank 2 (page 1, slot 6): B0BZYCJK89 $29.99, 4.6 from 146000 reviews
amazon.com 'kids water bottle': 59 slots on page 1 (12 ads); Owala holds 7 of them (0 sponsored); best organic rank 1 (page 1, slot 5): B0CRC8MQZL $20.00, 4.6 from 146000 reviews
amazon.co.uk 'insulated water bottle': 58 slots on page 1 (12 ads); Owala holds 6 of them (0 sponsored); best organic rank 1 (page 1, slot 7): B0C59C39PV £30.99, 4.6 from 43600 reviews
amazon.co.uk 'water bottle with straw': 59 slots on page 1 (12 ads); Owala holds 6 of them (0 sponsored); best organic rank 1 (page 1, slot 6): B0FJN3BTPV £31.99, 4.6 from 43600 reviews
amazon.co.uk 'kids water bottle': 60 slots on page 1 (12 ads); Owala holds 1 of them (0 sponsored); best organic rank 2 (page 1, slot 5): B0FK124QCT £26.68, 4.6 from 4800 reviews
```

Each row of `rankings.csv` is one slot. Three rows from the first search, with titles shortened:

```
date,as_of,site,keyword,page,slot,organic_rank,sponsored,asin,title,price,currency,price_text,rating,reviews,url
2026-11-17,2026-11-17T04:33:41.382Z,amazon.com,insulated water bottle,1,4,,True,B0D2W1MKZX,"Fijinhom Insulated Water Bottle with Handle, 304",13.99,USD,$13.99,4.4,2100,https://www.amazon.com/dp/B0D2W1MKZX
2026-11-17,2026-11-17T04:33:41.382Z,amazon.com,insulated water bottle,1,5,1,False,B0BZYCJK89,Owala FreeSip Stainless Steel Water Bottle 24 oz,29.99,USD,$29.99,4.6,146000,https://www.amazon.com/dp/B0BZYCJK89
2026-11-17,2026-11-17T04:33:41.382Z,amazon.com,insulated water bottle,1,6,2,False,B0D8J2ZB8P,POWCAN 26 oz Insulated Water Bottle with 2-in-1 ,16.99,USD,$16.99,4.5,13600,https://www.amazon.com/dp/B0D8J2ZB8P
```

Put side by side, the six searches tell a clear story for this brand:

| Store | Keyword | Best organic rank | Its slot | Brand slots on page 1 |
| --- | --- | --- | --- | --- |
| amazon.com | insulated water bottle | 1 | 5 | 11 of 59 |
| amazon.com | water bottle with straw | 2 | 6 | 8 of 59 |
| amazon.com | kids water bottle | 1 | 5 | 7 of 59 |
| amazon.co.uk | insulated water bottle | 1 | 7 | 6 of 58 |
| amazon.co.uk | water bottle with straw | 1 | 6 | 6 of 59 |
| amazon.co.uk | kids water bottle | 2 | 5 | 1 of 60 |

Owala's products are the first or second organic result in all six searches, yet never higher than slot 5, because in these reads every page one opened with three to five ads. In the US it fills between 7 and 11 page-one slots per keyword, almost all organic: its only ad among them was a travel coffee cup, in slot 11 for "insulated water bottle". In the UK it holds the top organic spot for two keywords but only one page-one slot for "kids water bottle", and that one is its 890 ml Sway bottle, not a kids' model. That is the kind of gap a rank tracker is for: a keyword where a brand that wins elsewhere has almost no presence.

## How do you scrape Amazon search results from an AI agent?

If you work in Claude, ChatGPT, Cursor or another agent that supports MCP, you can ask instead of writing the script. After the setup line above:

```
Use datawebot's Amazon search endpoint (amazon.search_items) to read the first
two pages of amazon.com results for "insulated water bottle". List every slot in
order with its position, whether it is sponsored, ASIN, price and rating, then
tell me the organic rank of each Owala product.
```

The agent finds the endpoint with `find_endpoints` and runs it with `submit_job`, the same endpoint the script uses, so the agent gets the same fields the script saves. That makes it a quick way to try a keyword before adding it to the daily run. For a plain product search, where you only want the organic results and not the slot order, the agent's `search_products` tool returns organic results and ads in separate lists. The [MCP server page](https://www.datawebot.com/mcp) lists every tool and how to connect each client.

## What should you check in Amazon search data?

The run above shows six things to check, whichever Amazon search scraper you use:

1. **Store the slot and the organic rank.** Organic rank 1 sat in slot 5 on amazon.com and slot 7 on amazon.co.uk. Reports that show only one of them hide either the effect of ads or the effect of the listing itself.
2. **Count the ads per page.** Every page one in this run held 12 ads, in groups of four on amazon.com and with a group of five at the top for two UK keywords. A change in that number moves every organic result up or down a slot without any change in ranking.
3. **Matching a brand by its name in the title is a start, not an answer.** It catches every product with the brand in its title, including models that are not the one you mean, such as the Sway bottle that came up for "kids water bottle". For exact tracking, keep a list of your own ASINs and match on `asin`.
4. **Review counts are shared across variants.** Eleven different Owala FreeSip listings in the US results, in sizes from 16 to 40 ounces and several colors, each showed 146,000 reviews, because the variants of one product share its reviews. Do not add them up. Our [ASIN lookup guide](https://www.datawebot.com/blog/asin-lookup) explains parent and child ASINs.
5. **Keep the price text with the price.** The `price_text` column keeps the price as Amazon printed it, with its currency sign, next to the number and currency code. When you combine countries, convert before you compare: $29.99 and £30.99 are different amounts.
6. **Compare searches made at the same time.** Results change during the day as stock, prices and ad bids change. A search made five minutes before the run above had different products in slots 4 and 7. Run all your keywords together, as the script does, and keep `as_of` with every row.

Each ASIN appears once in a search's results, and a few slot numbers can be missing from a page, mostly on page two. Use `organic_rank` for organic positions and `slot` for where a product appeared.

## How do you choose an Amazon search scraper?

Use this checklist when you compare providers. For a wider view of the options, see our [comparison of ecommerce data APIs](https://www.datawebot.com/blog/best-ecommerce-data-apis).

| Question | Why it matters |
| --- | --- |
| Does it return every slot in order, ads included? | Without the slot order you cannot see where ads push your products |
| Does it mark which slots are sponsored? | Mixing ads into organic results breaks any ranking |
| Does it return the page and position of each slot? | You need both to compare ranks across days |
| Can it read more than one page? | Page one holds about 60 slots, and a product can rank well beyond it |
| Does it cover the Amazon countries you sell in? | Ranks differ by country, as the UK results above show |
| Does it return the ASIN for every slot? | The ASIN is the only reliable way to track one product |
| Are prices numbers with a currency? | You cannot sort or convert `"£30.99"` without parsing it |
| Can a repeat request return the same answer without charging again? | A retry or second run should not pay twice |
| Can an AI agent call it, not only your code? | Testing keywords in an agent first saves writing code for dead ends |

## What does it cost?

A page of Amazon search results costs 5 credits, whether it holds 50 slots or 60. One run of the script above, three keywords in two countries at two pages each, costs 60 credits. The 200 free credits every account starts with cover three such runs, or 40 single-page searches. A daily run of the same 6 searches uses about 1,800 credits a month. More credits are one-time packs with no subscription, listed on the [pricing page](https://www.datawebot.com/pricing).

To read product pages for the ASINs you find, such as the seller, every variant and exact review counts, see our [Amazon scraper API guide](https://www.datawebot.com/blog/amazon-scraper-api) and the [Amazon product data API](https://www.datawebot.com/solutions/amazon-product-data-api). To watch prices rather than ranks, see our guide to [building a price tracker in Python](https://www.datawebot.com/blog/price-tracker-python).

## Need this at volume?

If you track hundreds of keywords, many Amazon countries or deep result pages, [send a volume request](https://www.datawebot.com/volume) and we will size it in credits. Our [published samples](https://www.datawebot.com/samples) show the result format.

## Frequently asked questions

### What is an Amazon search scraper?

A program or API that reads the Amazon results page for a keyword and returns it as data: every product on the page in order, with its ASIN, title, price, rating, review count and whether it is an ad. You send a keyword, or the search URL, and get JSON back without parsing Amazon's pages yourself.

### How do I scrape Amazon search results with Python?

Send the search URL to an Amazon search endpoint and write the slots to a CSV file. The script in this guide does that for several keywords and two Amazon countries at once, in about 120 lines of standard-library Python, at 5 credits per results page.

### How do I track my product's rank for a keyword on Amazon?

Read the results for the keyword every day, find your ASIN, and record its organic rank and its slot. The script in this guide appends both to `rankings.csv` on each run, so the file becomes a daily history you can chart or load into a spreadsheet.

### Does it include sponsored products?

Yes. Every slot comes back in the order Amazon showed it, and each one is marked `sponsored: true` or `false`. In the run above, every page one held 12 ads. You can count them, follow which ASINs buy the top slots, or leave them out and keep only organic results.

### How many pages of Amazon results can I read?

Up to 25 pages per request with the `amazon.search_items` endpoint, at 5 credits a page. One page held about 60 slots in the run above, so two pages cover roughly the first 110 to 115 products.

### Which Amazon countries are supported?

The endpoint reads 20 Amazon country stores, including the US, the UK, Germany, France, Italy, Spain, Canada, Mexico, Japan and Australia. Set the Amazon domain in the search URL and the matching country code. The full list is on the [Amazon scraper page](https://www.datawebot.com/scraper/amazon).

### Is there a free Amazon search scraper?

You can start free: every datawebot account gets 200 free credits with no card, enough for 40 pages of Amazon search results. After that, credits are one-time packs with no subscription.

## Sources

1. [https://www.datawebot.com/llms.txt](https://www.datawebot.com/llms.txt)
2. [https://mcp.datawebot.com/setup.md](https://mcp.datawebot.com/setup.md)
3. [https://www.datawebot.com/openapi.json](https://www.datawebot.com/openapi.json)
4. [https://www.datawebot.com/scraper/amazon](https://www.datawebot.com/scraper/amazon)
5. [https://www.datawebot.com/solutions/amazon-product-data-api](https://www.datawebot.com/solutions/amazon-product-data-api)
6. [https://docs.python.org/3/library/csv.html](https://docs.python.org/3/library/csv.html)
7. [https://docs.python.org/3/library/urllib.parse.html](https://docs.python.org/3/library/urllib.parse.html)
8. [https://docs.python.org/3/library/concurrent.futures.html](https://docs.python.org/3/library/concurrent.futures.html)
9. [https://modelcontextprotocol.io/specification/2025-06-18/server/tools](https://modelcontextprotocol.io/specification/2025-06-18/server/tools)

## Read Amazon search results and product pages as JSON.

Every account starts with 200 free credits, with no subscription: a search costs 5 credits and a product read 1. Failed requests are free.

[See the Amazon product data API](https://www.datawebot.com/solutions/amazon-product-data-api) · [See pricing](https://www.datawebot.com/pricing)

[← All articles](https://www.datawebot.com/blog)
