[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"blog-post-en-amazon-keyword-rank-tracking-proxies-1":3},{"success":4,"payload":5,"related":69,"errors":131},true,{"id":6,"slug":7,"title":8,"excerpt":9,"body_html":10,"meta_title":11,"meta_description":12,"canonical_url":13,"canonical_override":14,"og_title":15,"og_description":12,"og_image_url":16,"faq_json":17,"key_takeaways":30,"allow_index":4,"noindex_google_only":36,"allow_follow":4,"published_at":37,"updated_at":37,"content_updated_at":38,"featured_image_url":39,"featured_image_alt":40,"card_image_url":41,"reading_time_minutes":42,"author":43,"categories":47,"tags":54,"alternates":55,"locale_paths":58,"views":68},155,"amazon-keyword-rank-tracking-proxies-1","Marketplace Keyword Rank Tracking with Proxies: A Developer's Guide (Amazon Example)","Learn how to build an Amazon keyword rank tracker with Python, residential proxies, and geo-targeting. Parse search results, separate organic from Sponsored, and track ASIN positions over time.","\u003Cp>\u003Cstrong>Legal note:\u003C\u002Fstrong> This guide covers collecting publicly visible Amazon search results for legitimate rank-tracking purposes. In the US, the \u003Ca href=\"https:\u002F\u002Fwww.law.cornell.edu\u002Fuscode\u002Ftext\u002F18\u002F1030\" rel=\"noopener noreferrer\">Computer Fraud and Abuse Act (CFAA)\u003C\u002Fa> can apply to unauthorized access; stick to public data and respect Amazon's Terms of Service. In the EU, the \u003Ca href=\"https:\u002F\u002Fgdpr-info.eu\u002F\" rel=\"noopener noreferrer\">GDPR\u003C\u002Fa> governs personal data — search result pages generally contain no personal data, but be mindful if you log user-generated content. Always consult legal counsel for your specific use case.\u003C\u002Fp>\n\n\u003Ch2>Why Amazon Keyword Rank Tracking with Proxies Matters\u003C\u002Fh2>\n\n\u003Cp>Amazon's search engine — internally called A9 (now part of Amazon's broader search and recommendation systems) — is fundamentally different from Google's. Ranking is driven by a combination of \u003Cstrong>text relevance\u003C\u002Fstrong> and \u003Cstrong>sales velocity\u003C\u002Fstrong>. A product that converts well for a keyword climbs the ranks, which in turn drives more impressions and sales, creating a feedback loop. For sellers, this means knowing your organic position for a keyword, on a specific marketplace, for a specific ASIN, is mission-critical.\u003C\u002Fp>\n\n\u003Cp>Unlike Google SERPs, Amazon results are heavily commercial: every page mixes organic results with Sponsored placements. If you don't separate the two, your rank-tracking data is polluted. An ASIN might appear in position 1 as a Sponsored ad while sitting at position 12 organically — those are very different signals for listing optimization.\u003C\u002Fp>\n\n\u003Cp>Amazon also localizes results per marketplace. \u003Ccode>amazon.com\u003C\u002Fcode>, \u003Ccode>amazon.de\u003C\u002Fcode>, \u003Ccode>amazon.co.uk\u003C\u002Fcode>, and \u003Ccode>amazon.co.jp\u003C\u002Fcode> each return different rankings for the same keyword. To track accurately, you need to request pages from an IP in the target country. That's where \u003Ca href=\"\u002Fproxy\u002Fresidential\">residential proxies\u003C\u002Fa> come in.\u003C\u002Fp>\n\n\u003Ch2>How Amazon's SERP Is Structured\u003C\u002Fh2>\n\n\u003Cp>When you search Amazon for a keyword, the results page returns a list of product cards. Each card is a \u003Ccode>&lt;div&gt;\u003C\u002Fcode> with the attribute \u003Ccode>data-component-type=\"s-search-result\"\u003C\u002Fcode>. The ASIN is stored in the \u003Ccode>data-asin\u003C\u002Fcode> attribute. Sponsored listings include a visible \u003Cstrong>\"Sponsored\"\u003C\u002Fstrong> label (often in a \u003Ccode>&lt;span&gt;\u003C\u002Fcode> with class containing \u003Ccode>s-label-popover-default\u003C\u002Fcode> or similar, but the text content is the reliable anchor).\u003C\u002Fp>\n\n\u003Cp>Here's a simplified view of what one result card looks like:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>&lt;div data-component-type=&quot;s-search-result&quot; data-asin=&quot;B0CXYZ1234&quot; class=&quot;s-result-item&quot;&gt;\n  &lt;div class=&quot;puis-card-container&quot;&gt;\n    ...\n    &lt;span class=&quot;a-color-secondary&quot;&gt;Sponsored&lt;\u002Fspan&gt;\n    &lt;h2&gt;&lt;a href=&quot;\u002Fdp\u002FB0CXYZ1234\u002F...&quot;&gt;Product Title&lt;\u002Fa&gt;&lt;\u002Fh2&gt;\n    ...\n  &lt;\u002Fdiv&gt;\n&lt;\u002Fdiv&gt;\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>To compute the organic rank, you iterate all result cards, skip those marked Sponsored, and assign a 1-based position to the remaining ones. The first organic result is rank 1, the second is rank 2, and so on.\u003C\u002Fp>\n\n\u003Ch3>Sponsored vs Organic: Why Separation Matters\u003C\u002Fh3>\n\n\u003Cp>Sponsored placements are paid ads. They appear because a seller bid on that keyword through Amazon Advertising. Organic rank is determined by the A9 algorithm based on relevance, conversion rate, review quality, and sales history. If you track both together, you can't tell whether a rank change came from increased ad spend or genuine organic improvement. For a keyword rank tracker, you should record both separately — Sponsored position and organic position — so sellers can see the full picture.\u003C\u002Fp>\n\n\u003Ch2>Why You Need Residential Proxies with Country Geo-Targeting\u003C\u002Fh2>\n\n\u003Cp>Amazon's anti-bot systems are aggressive. If you send dozens of search requests from a single datacenter IP, you'll hit CAPTCHAs and temporary bans within minutes — often within 50–100 requests. Datacenter IPs are trivially detectable because they belong to known cloud provider ASN ranges. \u003Ca href=\"https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FProxy_server#Anonymous_proxy\" rel=\"noopener noreferrer\">Residential proxies\u003C\u002Fa> route traffic through real ISP-assigned home connections, making requests look like genuine shoppers.\u003C\u002Fp>\n\n\u003Cp>Amazon also localizes results by the IP's country. If you search \u003Ccode>amazon.de\u003C\u002Fcode> from a US IP, you may get redirected or see different results than a German shopper. To get accurate rank data for \u003Ccode>amazon.de\u003C\u002Fcode>, you need a German residential IP. For \u003Ccode>amazon.com\u003C\u002Fcode>, a US residential IP. For \u003Ccode>amazon.co.jp\u003C\u002Fcode>, a Japanese residential IP.\u003C\u002Fp>\n\n\u003Cp>With ProxyHat, you control the country via the username parameter. For Amazon US, you use \u003Ccode>-country-US\u003C\u002Fcode>; for Amazon Germany, \u003Ccode>-country-DE\u003C\u002Fcode>. For stable pagination across multiple result pages (page 1 through 5), you also want a \u003Cstrong>sticky session\u003C\u002Fstrong> so the same IP handles all requests in the batch — otherwise Amazon may serve inconsistent results mid-sequence.\u003C\u002Fp>\n\n\u003Ctable>\n  \u003Cthead>\n    \u003Ctr>\n      \u003Cth>Marketplace\u003C\u002Fth>\n      \u003Cth>Domain\u003C\u002Fth>\n      \u003Cth>ProxyHat Country Flag\u003C\u002Fth>\n      \u003Cth>Example Username\u003C\u002Fth>\n    \u003C\u002Ftr>\n  \u003C\u002Fthead>\n  \u003Ctbody>\n    \u003Ctr>\n      \u003Ctd>United States\u003C\u002Ftd>\n      \u003Ctd>amazon.com\u003C\u002Ftd>\n      \u003Ctd>-country-US\u003C\u002Ftd>\n      \u003Ctd>user-country-US-sid-amz1\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Germany\u003C\u002Ftd>\n      \u003Ctd>amazon.de\u003C\u002Ftd>\n      \u003Ctd>-country-DE\u003C\u002Ftd>\n      \u003Ctd>user-country-DE-sid-amz1\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>United Kingdom\u003C\u002Ftd>\n      \u003Ctd>amazon.co.uk\u003C\u002Ftd>\n      \u003Ctd>-country-GB\u003C\u002Ftd>\n      \u003Ctd>user-country-GB-sid-amz1\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>Japan\u003C\u002Ftd>\n      \u003Ctd>amazon.co.jp\u003C\u002Ftd>\n      \u003Ctd>-country-JP\u003C\u002Ftd>\n      \u003Ctd>user-country-JP-sid-amz1\u003C\u002Ftd>\n    \u003C\u002Ftr>\n    \u003Ctr>\n      \u003Ctd>France\u003C\u002Ftd>\n      \u003Ctd>amazon.fr\u003C\u002Ftd>\n      \u003Ctd>-country-FR\u003C\u002Ftd>\n      \u003Ctd>user-country-FR-sid-amz1\u003C\u002Ftd>\n    \u003C\u002Ftr>\n  \u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\u003Ch2>Setting Up ProxyHat for Amazon Rank Tracking\u003C\u002Fh2>\n\n\u003Cp>ProxyHat provides residential and mobile proxies through a single gateway at \u003Ccode>gate.proxyhat.com\u003C\u002Fcode>. The HTTP port is \u003Ccode>8080\u003C\u002Fcode> and the SOCKS5 port is \u003Ccode>1080\u003C\u002Fcode>. All geo-targeting and session control flags go in the username field, separated by hyphens.\u003C\u002Fp>\n\n\u003Cp>Here's the connection format:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode># HTTP proxy — US residential with sticky session\nhttp:\u002F\u002Fuser-country-US-sid-amz_keyword1:pass@gate.proxyhat.com:8080\n\n# SOCKS5 proxy — Germany residential with sticky session\nsocks5:\u002F\u002Fuser-country-DE-sid-amz_keyword1:pass@gate.proxyhat.com:1080\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Cp>The \u003Ccode>-sid-\u003C\u002Fcode> flag creates a sticky IP. Use a unique session ID per keyword batch so each keyword gets a fresh IP but all pages (1–5) for that keyword share the same IP. This mimics a real shopper browsing through multiple pages of results.\u003C\u002Fp>\n\n\u003Ch2>Code Example 1: Raw Proxy with curl_cffi\u003C\u002Fh2>\n\n\u003Cp>\u003Ca href=\"https:\u002F\u002Fcurl-cffi.readthedocs.io\u002F\" rel=\"noopener noreferrer\">curl_cffi\u003C\u002Fa> is a Python library that wraps libcurl with browser TLS fingerprinting. It's lighter than a full browser automation stack and fast enough for high-volume scraping. Here's how to fetch Amazon search results with ProxyHat residential proxies:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import asyncio\nfrom curl_cffi.requests import AsyncSession\nfrom urllib.parse import quote_plus\nimport json\nimport time\n\nPROXY_USER = &quot;user-country-US-sid-amz_{kw}&quot;\nPROXY_PASS = &quot;your_password&quot;\nPROXY_HOST = &quot;gate.proxyhat.com&quot;\nPROXY_PORT = 8080\n\nasync def fetch_amazon_page(keyword: str, page: int, session_id: str) -&gt; str:\n    &quot;&quot;&quot;Fetch one Amazon search results page via ProxyHat residential proxy.&quot;&quot;&quot;\n    url = f&quot;https:\u002F\u002Fwww.amazon.com\u002Fs?k={quote_plus(keyword)}&amp;page={page}&quot;\n    proxy_url = f&quot;http:\u002F\u002F{PROXY_USER.format(kw=session_id)}:{PROXY_PASS}@{PROXY_HOST}:{PROXY_PORT}&quot;\n\n    async with AsyncSession(impersonate=&quot;chrome&quot;) as s:\n        resp = await s.get(\n            url,\n            proxies={&quot;http&quot;: proxy_url, &quot;https&quot;: proxy_url},\n            timeout=30,\n            headers={\n                &quot;User-Agent&quot;: (\n                    &quot;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) &quot;\n                    &quot;AppleWebKit\u002F537.36 (KHTML, like Gecko) &quot;\n                    &quot;Chrome\u002F120.0.0.0 Safari\u002F537.36&quot;\n                ),\n                &quot;Accept-Language&quot;: &quot;en-US,en;q=0.9&quot;,\n            },\n        )\n        if resp.status_code == 200:\n            return resp.text\n        elif resp.status_code == 503:\n            raise Exception(f&quot;CAPTCHA or block detected (HTTP {resp.status_code})&quot;)\n        else:\n            raise Exception(f&quot;Unexpected status: {resp.status_code}&quot;)\n\nasync def fetch_keyword_pages(keyword: str, max_pages: int = 5) -&gt; list[str]:\n    &quot;&quot;&quot;Fetch pages 1 through max_pages for a keyword with retries.&quot;&quot;&quot;\n    session_id = keyword.replace(&quot; &quot;, &quot;_&quot;)[:20]\n    pages = []\n    for page in range(1, max_pages + 1):\n        attempt = 0\n        while attempt &lt; 3:\n            try:\n                html = await fetch_amazon_page(keyword, page, session_id)\n                pages.append(html)\n                break\n            except Exception as e:\n                attempt += 1\n                wait = 2 ** attempt\n                print(f&quot;  Page {page} attempt {attempt} failed: {e}, retrying in {wait}s&quot;)\n                await asyncio.sleep(wait)\n        else:\n            print(f&quot;  Page {page} failed after 3 attempts, skipping&quot;)\n            pages.append(&quot;&quot;)\n        await asyncio.sleep(2)  # polite delay between pages\n    return pages\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Code Example 2: Parsing Organic and Sponsored Positions\u003C\u002Fh2>\n\n\u003Cp>Once you have the HTML, parse it with BeautifulSoup. Iterate all \u003Ccode>s-search-result\u003C\u002Fcode> divs, read the \u003Ccode>data-asin\u003C\u002Fcode>, detect Sponsored placements, and compute organic rank:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>from bs4 import BeautifulSoup\nfrom dataclasses import dataclass\nfrom typing import Optional\n\n@dataclass\nclass SearchResult:\n    asin: str\n    position: int           # raw position on page (1-based)\n    is_sponsored: bool\n    organic_position: Optional[int]  # organic-only position (None if sponsored)\n    page_number: int\n\ndef parse_amazon_results(html: str, page_number: int) -&gt; list[SearchResult]:\n    &quot;&quot;&quot;Parse an Amazon search results page into structured data.&quot;&quot;&quot;\n    soup = BeautifulSoup(html, &quot;html.parser&quot;)\n    results = []\n    organic_counter = 0\n\n    cards = soup.find_all(&quot;div&quot;, attrs={&quot;data-component-type&quot;: &quot;s-search-result&quot;})\n\n    for idx, card in enumerate(cards, start=1):\n        asin = card.get(&quot;data-asin&quot;, &quot;&quot;)\n        if not asin:\n            continue\n\n        # Detect Sponsored label\n        sponsored_text = card.get_text(separator=&quot; &quot;, strip=True)\n        is_sponsored = &quot;Sponsored&quot; in sponsored_text\n\n        if not is_sponsored:\n            organic_counter += 1\n            organic_pos = organic_counter\n        else:\n            organic_pos = None\n\n        results.append(SearchResult(\n            asin=asin,\n            position=idx,\n            is_sponsored=is_sponsored,\n            organic_position=organic_pos,\n            page_number=page_number,\n        ))\n\n    return results\n\ndef find_asin_position(results: list[SearchResult], target_asin: str) -&gt; dict:\n    &quot;&quot;&quot;Find the organic and sponsored position of a target ASIN.&quot;&quot;&quot;\n    organic_rank = None\n    sponsored_rank = None\n    for r in results:\n        if r.asin == target_asin:\n            if r.is_sponsored and sponsored_rank is None:\n                sponsored_rank = r.position\n            elif not r.is_sponsored and organic_rank is None:\n                organic_rank = r.organic_position\n    return {\n        &quot;asin&quot;: target_asin,\n        &quot;organic_rank&quot;: organic_rank,\n        &quot;sponsored_rank&quot;: sponsored_rank,\n        &quot;page&quot;: results[0].page_number if results else None,\n    }\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Code Example 3: Full Rank Tracking Pipeline\u003C\u002Fh2>\n\n\u003Cp>Combine fetching and parsing into a pipeline that tracks a target ASIN's position across pages 1–5 for a given keyword:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import asyncio\nimport json\nfrom datetime import datetime, timezone\nimport csv\n\nasync def track_keyword_rank(\n    keyword: str,\n    target_asin: str,\n    max_pages: int = 5,\n) -&gt; dict:\n    &quot;&quot;&quot;Fetch and parse Amazon results, return rank data for target ASIN.&quot;&quot;&quot;\n    pages_html = await fetch_keyword_pages(keyword, max_pages)\n\n    all_results = []\n    for page_num, html in enumerate(pages_html, start=1):\n        if not html:\n            continue\n        page_results = parse_amazon_results(html, page_num)\n        all_results.extend(page_results)\n\n    rank_info = find_asin_position(all_results, target_asin)\n    rank_info[&quot;keyword&quot;] = keyword\n    rank_info[&quot;timestamp&quot;] = datetime.now(timezone.utc).isoformat()\n    rank_info[&quot;marketplace&quot;] = &quot;amazon.com&quot;\n    rank_info[&quot;total_organic_results&quot;] = sum(1 for r in all_results if not r.is_sponsored)\n    rank_info[&quot;is_indexed&quot;] = rank_info[&quot;organic_rank&quot;] is not None or rank_info[&quot;sponsored_rank&quot;] is not None\n\n    return rank_info\n\nasync def batch_track(keywords: list[str], target_asin: str, output_csv: str):\n    &quot;&quot;&quot;Track multiple keywords and append results to CSV.&quot;&quot;&quot;\n    with open(output_csv, &quot;a&quot;, newline=&quot;&quot;) as f:\n        writer = csv.DictWriter(f, fieldnames=[\n            &quot;timestamp&quot;, &quot;keyword&quot;, &quot;marketplace&quot;, &quot;asin&quot;,\n            &quot;organic_rank&quot;, &quot;sponsored_rank&quot;, &quot;page&quot;,\n            &quot;total_organic_results&quot;, &quot;is_indexed&quot;,\n        ])\n        if f.tell() == 0:\n            writer.writeheader()\n\n        for kw in keywords:\n            print(f&quot;Tracking: {kw}&quot;)\n            try:\n                data = await track_keyword_rank(kw, target_asin)\n                writer.writerow(data)\n                f.flush()\n                print(f&quot;  Organic rank: {data[&apos;organic_rank&apos;]}, Sponsored: {data[&apos;sponsored_rank&apos;]}&quot;)\n            except Exception as e:\n                print(f&quot;  Error: {e}&quot;)\n            await asyncio.sleep(5)  # delay between keywords\n\n# Example usage\nif __name__ == &quot;__main__&quot;:\n    keywords = [&quot;wireless earbuds&quot;, &quot;bluetooth headphones&quot;, &quot;noise cancelling earbuds&quot;]\n    target_asin = &quot;B0CXYZ1234&quot;\n    asyncio.run(batch_track(keywords, target_asin, &quot;rank_history.csv&quot;))\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Code Example 4: Playwright for JavaScript-Rendered Pages\u003C\u002Fh2>\n\n\u003Cp>Sometimes Amazon serves a JavaScript-heavy version that requires a real browser. \u003Ca href=\"https:\u002F\u002Fplaywright.dev\u002Fpython\u002F\" rel=\"noopener noreferrer\">Playwright\u003C\u002Fa> handles this. Here's how to route Playwright through ProxyHat:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>from playwright.async_api import async_playwright\nimport asyncio\n\nPROXY_USER = &quot;user-country-US-sid-amz_playwright&quot;\nPROXY_PASS = &quot;your_password&quot;\n\nasync def fetch_with_playwright(keyword: str, page_num: int, target_asin: str) -&gt; dict:\n    &quot;&quot;&quot;Use Playwright with ProxyHat residential proxy to fetch Amazon results.&quot;&quot;&quot;\n    from urllib.parse import quote_plus\n    url = f&quot;https:\u002F\u002Fwww.amazon.com\u002Fs?k={quote_plus(keyword)}&amp;page={page_num}&quot;\n\n    async with async_playwright() as p:\n        browser = await p.chromium.launch(\n            headless=True,\n            proxy={\n                &quot;server&quot;: f&quot;http:\u002F\u002Fgate.proxyhat.com:8080&quot;,\n                &quot;username&quot;: PROXY_USER,\n                &quot;password&quot;: PROXY_PASS,\n            },\n        )\n        context = await browser.new_context(\n            user_agent=(\n                &quot;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) &quot;\n                &quot;AppleWebKit\u002F537.36 (KHTML, like Gecko) &quot;\n                &quot;Chrome\u002F120.0.0.0 Safari\u002F537.36&quot;\n            ),\n            locale=&quot;en-US&quot;,\n            viewport={&quot;width&quot;: 1920, &quot;height&quot;: 1080},\n        )\n        page = await context.new_page()\n\n        try:\n            await page.goto(url, wait_until=&quot;domcontentloaded&quot;, timeout=30000)\n            await page.wait_for_selector(&apos;[data-component-type=&quot;s-search-result&quot;]&apos;, timeout=10000)\n\n            # Extract results directly in the browser context\n            results = await page.evaluate(&quot;&quot;&quot;\n                () =&gt; {\n                    const cards = document.querySelectorAll(&apos;[data-component-type=&quot;s-search-result&quot;]&apos;);\n                    const data = [];\n                    let organicCount = 0;\n                    cards.forEach((card, idx) =&gt; {\n                        const asin = card.getAttribute(&apos;data-asin&apos;);\n                        if (!asin) return;\n                        const text = card.textContent || &apos;&apos;;\n                        const isSponsored = text.includes(&apos;Sponsored&apos;);\n                        if (!isSponsored) organicCount++;\n                        data.push({\n                            asin: asin,\n                            position: idx + 1,\n                            isSponsored: isSponsored,\n                            organicPosition: isSponsored ? null : organicCount,\n                        });\n                    });\n                    return data;\n                }\n            &quot;&quot;&quot;)\n\n            # Find target ASIN\n            organic_rank = None\n            sponsored_rank = None\n            for r in results:\n                if r[&quot;asin&quot;] == target_asin:\n                    if r[&quot;isSponsored&quot;] and sponsored_rank is None:\n                        sponsored_rank = r[&quot;position&quot;]\n                    elif not r[&quot;isSponsored&quot;] and organic_rank is None:\n                        organic_rank = r[&quot;organicPosition&quot;]\n\n            return {\n                &quot;asin&quot;: target_asin,\n                &quot;keyword&quot;: keyword,\n                &quot;page&quot;: page_num,\n                &quot;organic_rank&quot;: organic_rank,\n                &quot;sponsored_rank&quot;: sponsored_rank,\n                &quot;total_results&quot;: len(results),\n            }\n        finally:\n            await browser.close()\n\n# Usage\nasync def main():\n    result = await fetch_with_playwright(&quot;wireless earbuds&quot;, 1, &quot;B0CXYZ1234&quot;)\n    print(result)\n\nasyncio.run(main())\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Code Example 5: Production Wrapper with Retry Logic\u003C\u002Fh2>\n\n\u003Cp>For production, wrap the proxy logic in a reusable class with exponential backoff, CAPTCHA detection, and circuit breaker patterns:\u003C\u002Fp>\n\n\u003Cpre>\u003Ccode>import asyncio\nimport logging\nfrom datetime import datetime, timezone\nfrom curl_cffi.requests import AsyncSession\nfrom urllib.parse import quote_plus\n\nlogging.basicConfig(level=logging.INFO, format=&quot;%(asctime)s [%(levelname)s] %(message)s&quot;)\nlogger = logging.getLogger(&quot;amazon_tracker&quot;)\n\nclass ProxyHatAmazonTracker:\n    def __init__(\n        self,\n        username: str,\n        password: str,\n        marketplace: str = &quot;amazon.com&quot;,\n        country: str = &quot;US&quot;,\n    ):\n        self.username = username\n        self.password = password\n        self.marketplace = marketplace\n        self.country = country\n        self.gateway = &quot;gate.proxyhat.com&quot;\n        self.port = 8080\n        self.max_retries = 3\n        self.base_delay = 2\n        self.failure_count = 0\n        self.circuit_open = False\n        self.circuit_threshold = 10  # open circuit after 10 consecutive failures\n\n    def _proxy_url(self, session_id: str) -&gt; str:\n        user = f&quot;{self.username}-country-{self.country}-sid-{session_id}&quot;\n        return f&quot;http:\u002F\u002F{user}:{self.password}@{self.gateway}:{self.port}&quot;\n\n    def _check_captcha(self, html: str) -&gt; bool:\n        captcha_markers = [\n            &quot;Type the characters you see in this image&quot;,\n            &quot;api-services-support@amazon.com&quot;,\n            &quot;To discuss automated access&quot;,\n            &quot;captcha&quot;,\n        ]\n        html_lower = html.lower()\n        return any(marker.lower() in html_lower for marker in captcha_markers)\n\n    async def fetch_page(self, keyword: str, page: int, session_id: str) -&gt; str | None:\n        &quot;&quot;&quot;Fetch a single Amazon search page with retry and circuit breaker.&quot;&quot;&quot;\n        if self.circuit_open:\n            logger.warning(&quot;Circuit breaker open, skipping request&quot;)\n            return None\n\n        url = f&quot;https:\u002F\u002F{self.marketplace}\u002Fs?k={quote_plus(keyword)}&amp;page={page}&quot;\n        proxy = self._proxy_url(session_id)\n\n        for attempt in range(1, self.max_retries + 1):\n            try:\n                async with AsyncSession(impersonate=&quot;chrome&quot;) as s:\n                    resp = await s.get(\n                        url,\n                        proxies={&quot;http&quot;: proxy, &quot;https&quot;: proxy},\n                        timeout=30,\n                        headers={\n                            &quot;User-Agent&quot;: (\n                                &quot;Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) &quot;\n                                &quot;AppleWebKit\u002F537.36 (KHTML, like Gecko) &quot;\n                                &quot;Chrome\u002F120.0.0.0 Safari\u002F537.36&quot;\n                            ),\n                            &quot;Accept-Language&quot;: &quot;en-US,en;q=0.9&quot;,\n                        },\n                    )\n\n                    if resp.status_code == 200:\n                        if self._check_captcha(resp.text):\n                            logger.warning(f&quot;CAPTCHA detected on page {page}, attempt {attempt}&quot;)\n                            self.failure_count += 1\n                            await asyncio.sleep(self.base_delay ** attempt)\n                            continue\n                        self.failure_count = 0\n                        return resp.text\n\n                    elif resp.status_code == 503:\n                        logger.warning(f&quot;HTTP 503 on page {page}, attempt {attempt}&quot;)\n                        self.failure_count += 1\n                        await asyncio.sleep(self.base_delay ** attempt)\n                    else:\n                        logger.error(f&quot;HTTP {resp.status_code} on page {page}&quot;)\n                        return None\n\n            except Exception as e:\n                logger.error(f&quot;Request error on page {page}, attempt {attempt}: {e}&quot;)\n                self.failure_count += 1\n                await asyncio.sleep(self.base_delay ** attempt)\n\n            if self.failure_count &gt;= self.circuit_threshold:\n                self.circuit_open = True\n                logger.error(&quot;Circuit breaker tripped — pausing all requests&quot;)\n                return None\n\n        return None\n\n    async def track_keyword(\n        self,\n        keyword: str,\n        target_asin: str,\n        max_pages: int = 5,\n    ) -&gt; dict:\n        &quot;&quot;&quot;Track a keyword&apos;s rank for a target ASIN across multiple pages.&quot;&quot;&quot;\n        session_id = f&quot;amz_{keyword.replace(&apos; &apos;, &apos;_&apos;)[:15]}&quot;\n        all_results = []\n\n        for page in range(1, max_pages + 1):\n            html = await self.fetch_page(keyword, page, session_id)\n            if html:\n                from bs4 import BeautifulSoup\n                soup = BeautifulSoup(html, &quot;html.parser&quot;)\n                cards = soup.find_all(&quot;div&quot;, attrs={&quot;data-component-type&quot;: &quot;s-search-result&quot;})\n                organic_count = 0\n                for idx, card in enumerate(cards, start=1):\n                    asin = card.get(&quot;data-asin&quot;, &quot;&quot;)\n                    if not asin:\n                        continue\n                    is_sponsored = &quot;Sponsored&quot; in card.get_text(separator=&quot; &quot;, strip=True)\n                    if not is_sponsored:\n                        organic_count += 1\n                    all_results.append({\n                        &quot;asin&quot;: asin,\n                        &quot;position&quot;: idx,\n                        &quot;is_sponsored&quot;: is_sponsored,\n                        &quot;organic_position&quot;: organic_count if not is_sponsored else None,\n                        &quot;page&quot;: page,\n                    })\n            await asyncio.sleep(2)\n\n        # Find target ASIN\n        organic_rank = None\n        sponsored_rank = None\n        for r in all_results:\n            if r[&quot;asin&quot;] == target_asin:\n                if r[&quot;is_sponsored&quot;] and sponsored_rank is None:\n                    sponsored_rank = r[&quot;position&quot;]\n                elif not r[&quot;is_sponsored&quot;] and organic_rank is None:\n                    organic_rank = r[&quot;organic_position&quot;]\n\n        return {\n            &quot;timestamp&quot;: datetime.now(timezone.utc).isoformat(),\n            &quot;keyword&quot;: keyword,\n            &quot;marketplace&quot;: self.marketplace,\n            &quot;asin&quot;: target_asin,\n            &quot;organic_rank&quot;: organic_rank,\n            &quot;sponsored_rank&quot;: sponsored_rank,\n            &quot;total_results&quot;: len(all_results),\n            &quot;is_indexed&quot;: organic_rank is not None or sponsored_rank is not None,\n            &quot;circuit_open&quot;: self.circuit_open,\n        }\n\n# Usage\nasync def main():\n    tracker = ProxyHatAmazonTracker(\n        username=&quot;user&quot;,\n        password=&quot;your_password&quot;,\n        marketplace=&quot;amazon.com&quot;,\n        country=&quot;US&quot;,\n    )\n    result = await tracker.track_keyword(&quot;wireless earbuds&quot;, &quot;B0CXYZ1234&quot;, max_pages=5)\n    print(result)\n\nasyncio.run(main())\u003C\u002Fcode>\u003C\u002Fpre>\n\n\u003Ch2>Production Tips for Amazon SERP Scraping\u003C\u002Fh2>\n\n\u003Ch3>Daily Scheduling\u003C\u002Fh3>\n\n\u003Cp>Amazon rankings change throughout the day, but daily snapshots are sufficient for most tracking needs. Use a task scheduler like \u003Ccode>APScheduler\u003C\u002Fcode> or \u003Ccode>cron\u003C\u002Fcode> to run your tracker once per day per keyword set. Running at off-peak hours (e.g., 3 AM ET for amazon.com) reduces the chance of hitting rate limits.\u003C\u002Fp>\n\n\u003Ch3>Retries with Exponential Backoff\u003C\u002Fh3>\n\n\u003Cp>Network hiccups and transient CAPTCHAs are inevitable. Always implement exponential backoff: wait 2 seconds, then 4, then 8. After 3 failures, skip the page and log the error. Don't retry indefinitely — a persistent block means you need a fresh session ID or a different proxy.\u003C\u002Fp>\n\n\u003Ch3>CAPTCHA Detection\u003C\u002Fh3>\n\n\u003Cp>Amazon's CAPTCHA pages typically return HTTP 503 or contain phrases like \"Type the characters you see in this image\" or \"api-services-support@amazon.com.\" Detect these in the response body and treat them as a signal to rotate your session. If you see CAPTCHAs on more than 5% of requests, your request rate is too high.\u003C\u002Fp>\n\n\u003Ch3>Indexation Checks\u003C\u002Fh3>\n\n\u003Cp>Before tracking rank, verify the ASIN is indexed at all. If \u003Ccode>organic_rank\u003C\u002Fcode> is \u003Ccode>None\u003C\u002Fcode> across all 5 pages, the ASIN may not be ranking for that keyword. This is normal for new listings or keywords with low relevance. Log \u003Ccode>is_indexed: false\u003C\u002Fcode> so sellers know the difference between \"not ranking\" and \"ranking on page 6+.\"\u003C\u002Fp>\n\n\u003Ch3>Concurrency\u003C\u002Fh3>\n\n\u003Cp>Don't send more than 5–10 concurrent requests per proxy session. Amazon's rate limits are per-IP, so spreading requests across multiple sticky sessions (one per keyword) is safer than hammering a single session. With ProxyHat residential proxies, you can run 50+ keywords in parallel by assigning each a unique session ID.\u003C\u002Fp>\n\n\u003Ch2>Ethics and Compliance\u003C\u002Fh2>\n\n\u003Cp>Track your own listings and publicly visible competitor data for legitimate market research. Don't scrape at rates that degrade Amazon's service. A good rule of thumb: keep total requests under 100 per hour per marketplace. Consider using Amazon's \u003Ca href=\"https:\u002F\u002Fdeveloper-docs.amazon\u002Fsp-api\u002F\" rel=\"noopener noreferrer\">Selling Partner API (SP-API)\u003C\u002Fa> for data that's available through official channels — the SP-API's \u003Ccode>Product Analytics\u003C\u002Fcode> and \u003Ccode>Search Catalog\u003C\u002Fcode> endpoints can supplement or replace scraping for sellers enrolled in Brand Analytics.\u003C\u002Fp>\n\n\u003Cp>For broader web scraping best practices, see our \u003Ca href=\"\u002Fuse-cases\u002Fweb-scraping\">web scraping use case guide\u003C\u002Fa>. For SERP tracking methodology, check our \u003Ca href=\"\u002Fuse-cases\u002Fserp-tracking\">SERP tracking guide\u003C\u002Fa>.\u003C\u002Fp>\n\n\u003Ch2>ProxyHat Setup and Configuration\u003C\u002Fh2>\n\n\u003Cp>To get started with ProxyHat for Amazon rank tracking:\u003C\u002Fp>\n\n\u003Col>\n  \u003Cli>Sign up at \u003Ca href=\"\u002Fpricing\">ProxyHat pricing\u003C\u002Fa> and choose a residential proxy plan.\u003C\u002Fli>\n  \u003Cli>Get your credentials from the \u003Ca href=\"https:\u002F\u002Fdashboard.proxyhat.com\">ProxyHat dashboard\u003C\u002Fa>.\u003C\u002Fli>\n  \u003Cli>Check available \u003Ca href=\"\u002Flocations\">proxy locations\u003C\u002Fa> to confirm your target countries are supported.\u003C\u002Fli>\n  \u003Cli>Review the \u003Ca href=\"https:\u002F\u002Fdocs.proxyhat.com\u002F\" rel=\"noopener noreferrer\">ProxyHat documentation\u003C\u002Fa> for advanced configuration options.\u003C\u002Fli>\n\u003C\u002Fol>\n\n\u003Cp>The key configuration for Amazon tracking:\u003C\u002Fp>\n\n\u003Cul>\n  \u003Cli>Proxy type: Residential (datacenter IPs are too easily detected by Amazon).\u003C\u002Fli>\n  \u003Cli>Country: Match the marketplace (US for amazon.com, DE for amazon.de, GB for amazon.co.uk).\u003C\u002Fli>\n  \u003Cli>Session: Sticky sessions per keyword for consistent pagination.\u003C\u002Fli>\n  \u003Cli>Rotation: Use a new session ID per keyword batch, not per page.\u003C\u002Fli>\n\u003C\u002Ful>","Marketplace Keyword Rank Tracking (Amazon Example) | ProxyHat","Build an Amazon keyword rank tracker with Python and residential proxies. Parse search results, separate organic from Sponsored, and track ASIN positions across marketplaces.","\u002Fblog\u002Famazon-keyword-rank-tracking-proxies-1",null,"Marketplace Keyword Rank Tracking with Proxies | ProxyHat","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Famazon-keyword-rank-tracking-proxies-1-og.webp",[18,21,24,27],{"question":19,"answer":20},"Why does Amazon Keyword Rank Tracking with Proxies matter for proxy users?","Without proxies, Amazon will quickly block your tracking requests — often within 50–100 requests from a single datacenter IP. Residential proxies route requests through real ISP connections, making them appear as genuine shopper traffic. Country-level geo-targeting ensures you see the same results a local shopper would see, which is critical because Amazon's rankings differ by marketplace. Sticky sessions keep the same IP across multiple pages so your pagination is consistent.",{"question":22,"answer":23},"Which proxy type works best for Amazon Keyword Rank Tracking with Proxies?","Residential proxies are the best choice for Amazon keyword rank tracking. Datacenter proxies are easily detected by Amazon's anti-bot systems and typically get blocked within minutes. Mobile proxies also work well but are more expensive and may not be necessary for rank tracking. Residential proxies offer the best balance of reliability, geo-targeting precision, and cost. With ProxyHat, you can specify the country (e.g., \u003Ccode>-country-US\u003C\u002Fcode> for amazon.com, \u003Ccode>-country-DE\u003C\u002Fcode> for amazon.de) and use sticky sessions (\u003Ccode>-sid-\u003C\u002Fcode>) for consistent pagination across result pages.",{"question":25,"answer":26},"How do you avoid blocks when implementing Amazon Keyword Rank Tracking with Proxies?","To avoid blocks: use residential proxies with country geo-targeting, assign a unique sticky session per keyword batch, keep requests under 100 per hour per marketplace, add 2–5 second delays between page requests, implement exponential backoff on failures, detect CAPTCHA pages by checking for known markers in the response body, and rotate session IDs between keyword batches. Also use browser-like TLS fingerprinting and set realistic headers matching the target marketplace.",{"question":28,"answer":29},"Can I use Amazon's SP-API instead of scraping for keyword rank tracking?","Amazon's Selling Partner API (SP-API) offers some analytics data through Brand Analytics for enrolled sellers, including search frequency rank and click share for keywords. However, SP-API does not provide real-time organic rank position for a specific ASIN on a specific keyword — that data is only available by parsing the live search results page. For sellers with Brand Analytics access, combining SP-API data with proxy-based rank tracking gives the most complete picture.",[31,32,33,34,35],"Accurate Amazon rank tracking requires separating organic results from Sponsored ads to avoid misleading data.","Use residential proxies with country geo-targeting to bypass anti-bot systems and access localized search results.","Maintain sticky sessions across multiple result pages to ensure consistent data from a single IP address.","Parse the HTML to extract ASINs and identify Sponsored listings by their visible label for accurate rank computation.","Use tools like curl_cffi or Playwright to fetch pages through the proxy and handle JavaScript rendering if needed.",false,"2026-07-16T16:05:31+00:00","2026-11-17T10:40:54+00:00","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Famazon-keyword-rank-tracking-proxies-1-master.webp","Amazon Keyword Rank Tracking with Proxies: A Developer's Guide","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Famazon-keyword-rank-tracking-proxies-1-card.webp",13,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},"ProxyHat Team","proxyhat-team","The ProxyHat editorial team covers proxies, web scraping, and data extraction.",[48],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},3,"serp-seo-tracking","SERP & SEO Tracking","SERP & SEO Tracking Guides | ProxyHat Blog","Learn how to track search engine rankings and scrape SERPs with proxies.",[],{"tr":56,"it":57,"en":13,"x-default":13},"\u002Ftr\u002Fblog\u002Fproxy-ile-amazon-anahtar-kelime-siralama-takibi","\u002Fit\u002Fblog\u002Fmonitoraggio-posizionamento-keyword-amazon-proxy",{"tr":56,"pl":59,"pt":60,"ja":61,"zh":62,"es":63,"de":64,"ko":65,"it":57,"ru":66,"en":13,"fr":67},"\u002Fpl\u002Fblog\u002Fsledzenie-rankingu-slow-kluczowych-amazon-proxy","\u002Fpt\u002Fblog\u002Frastreamento-ranking-palavras-chave-amazon-proxies","\u002Fja\u002Fblog\u002Famazon-keyword-rank-tracking-proxy-1","\u002Fcn\u002Fblog\u002Famazon-guanjianci-paiming-zhuizong-daili-1","\u002Fes\u002Fblog\u002Fseguimiento-ranking-palabras-clave-amazon-proxies","\u002Fde\u002Fblog\u002Famazon-keyword-rank-tracking-mit-proxies","\u002Fko\u002Fblog\u002Famazon-keyword-rank-tracker-proxy-guide","\u002Fru\u002Fblog\u002Famazon-treking-pozitsiy-klyuchevyh-slov","\u002Ffr\u002Fblog\u002Fsuivi-classement-amazon-proxy-python",117,[70,86,100,116],{"id":71,"slug":72,"title":73,"excerpt":74,"featured_image_url":75,"featured_image_alt":73,"card_image_url":76,"og_image_url":77,"published_at":78,"updated_at":78,"content_updated_at":79,"reading_time_minutes":80,"is_featured":36,"indexable":4,"views":81,"author":82,"categories":83,"tags":85},198,"geo-targeted-serp-scraping-best-practices","Geo-Targeted SERP Scraping Best Practices for Local SEO Data","Learn how to build city-precise SERP datasets using uule, gl, hl, and residential proxies. Includes Python code for uule construction, result parsing, sticky sessions, and retry logic.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgeo-targeted-serp-scraping-best-practices-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgeo-targeted-serp-scraping-best-practices-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fgeo-targeted-serp-scraping-best-practices-og.webp","2026-07-31T16:11:16+00:00","2026-10-03T23:52:59+00:00",12,77,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[84],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":87,"slug":88,"title":89,"excerpt":90,"featured_image_url":91,"featured_image_alt":89,"card_image_url":92,"og_image_url":93,"published_at":94,"updated_at":94,"content_updated_at":95,"reading_time_minutes":80,"is_featured":36,"indexable":36,"views":87,"author":96,"categories":97,"tags":99},153,"scrape-google-paa-autocomplete-keyword-research-1","Scrape Google People Also Ask and Autocomplete for Keyword Research (Python Guide)","A code-first guide to extracting Google Autocomplete suggestions, People Also Ask questions, and Related Searches at scale using Python, Playwright, and residential proxies for clean localized keyword research.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fscrape-google-paa-autocomplete-keyword-research-1-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fscrape-google-paa-autocomplete-keyword-research-1-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fscrape-google-paa-autocomplete-keyword-research-1-og.webp","2026-07-14T16:06:25+00:00","2026-10-03T08:29:54+00:00",{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[98],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":101,"slug":102,"title":103,"excerpt":104,"featured_image_url":105,"featured_image_alt":103,"card_image_url":106,"og_image_url":107,"published_at":108,"updated_at":108,"content_updated_at":109,"reading_time_minutes":110,"is_featured":36,"indexable":4,"views":111,"author":112,"categories":113,"tags":115},154,"track-brand-google-ai-overviews-1","How to Track Your Brand in Google AI Overviews: A Strategic Guide for SEO & Data Teams","Generative search has made citation share the new ranking KPI. Here's how to track your brand in Google AI Overviews with a proxy-powered, headless-browser pipeline—plus build-vs-buy economics and governance guardrails.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftrack-brand-google-ai-overviews-1-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftrack-brand-google-ai-overviews-1-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Ftrack-brand-google-ai-overviews-1-og.webp","2026-07-14T10:05:37+00:00","2026-10-03T08:29:51+00:00",10,81,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[114],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],{"id":117,"slug":118,"title":119,"excerpt":120,"featured_image_url":121,"featured_image_alt":119,"card_image_url":122,"og_image_url":123,"published_at":124,"updated_at":124,"content_updated_at":125,"reading_time_minutes":80,"is_featured":36,"indexable":36,"views":126,"author":127,"categories":128,"tags":130},152,"build-rank-tracker-python-proxies","Build a Google Rank Tracker in Python with Residential Proxies","A complete, code-first guide to building a production Google rank tracker in Python using curl_cffi for TLS impersonation and ProxyHat residential proxies with city-level geo-targeting, sticky sessions, and SQLite storage.","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fbuild-rank-tracker-python-proxies-master.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fbuild-rank-tracker-python-proxies-card.webp","https:\u002F\u002Fstatic.proxyhat.com\u002Fstorage\u002Fblog-covers\u002Fen\u002Fbuild-rank-tracker-python-proxies-og.webp","2026-07-02T16:04:58+00:00","2026-10-03T23:53:00+00:00",59,{"name":44,"slug":45,"bio":46,"avatar_url":14,"website_url":14,"social_links":14},[129],{"id":49,"slug":50,"name":51,"description":14,"meta_title":52,"meta_description":53,"parent_id":14},[],[]]