ScavioScavio
Pricing
Tools
Sign InsGet Startedg
  1. Home
  2. Tutorials
  3. How to Replace Your Amazon Scraper with Search API
Tutorial

How to Replace Your Amazon Scraper with Search API

Migrate from fragile Selenium or Puppeteer Amazon scrapers to the Scavio API. Get structured product data without bot detection, CAPTCHAs or proxy management.

Get Free API KeyAPI Docs

Amazon scrapers built with Selenium or Puppeteer break constantly. Bot detection updates, CAPTCHA challenges, and layout changes mean you spend more time maintaining the scraper than using the data. The Scavio API provides structured Amazon product data through a stable endpoint that handles all the extraction complexity. This tutorial migrates a typical Amazon scraping setup to API calls, showing the before-and-after for product search, ASIN lookup, and price extraction. Each API call costs $0.005 with no proxy costs.

Prerequisites

  • Python 3.9+ installed
  • requests library installed
  • A Scavio API key from scavio.dev
  • An existing Amazon scraper to migrate (optional)

Walkthrough

Step 1: Compare the old scraper vs. API approach

See how a typical Selenium Amazon scraper looks versus the equivalent API call. The API version is shorter, faster, and does not break.

Python
import os, requests

SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
H = {'Authorization': f'Bearer {SCAVIO_KEY}', 'Content-Type': 'application/json'}
SEARCH_URL = 'https://api.scavio.dev/api/v1/amazon/search'
PRODUCT_URL = 'https://api.scavio.dev/api/v1/amazon/product'

# OLD: Selenium scraper (30+ lines, breaks monthly)
# from selenium import webdriver
# driver = webdriver.Chrome()
# driver.get(f'https://amazon.com/s?k={query}')
# time.sleep(3)  # Wait for page load
# products = driver.find_elements(By.CSS_SELECTOR, '[data-component-type="s-search-result"]')
# ... parse each product, handle pagination, CAPTCHAs, etc.

# NEW: API call (5 lines, stable). There is no result-count param - one page
# per call - so slice locally.
def search_amazon(query: str, num: int = 5) -> list:
    resp = requests.post(SEARCH_URL, headers=H,
        json={'query': query, 'country': 'us'})
    resp.raise_for_status()
    return resp.json()['data'].get('products', [])[:num]

results = search_amazon('wireless earbuds')
print(f'Found {len(results)} products')
for r in results[:3]:
    print(f'  {r.get("title", "")[:60]}')
    print(f'  Price: {r.get("price", "N/A")} | Rating: {r.get("rating", "N/A")}')

Step 2: Migrate ASIN lookup to API

Replace direct ASIN page scraping with an API call. The API returns structured price, rating, review count, and availability data.

Python
def lookup_asin(asin: str) -> dict:
    """Look up a specific ASIN's product data."""
    resp = requests.post(PRODUCT_URL, headers=H,
        json={'asin': asin, 'country': 'us'})
    resp.raise_for_status()
    product = resp.json()['data']
    return {
        'asin': asin,
        'title': product.get('title', ''),
        'price': product.get('price'),
        'currency': product.get('currency'),
        'rating': product.get('rating'),
        'reviews': product.get('reviews_count', 0),
        'availability': product.get('availability', ''),
    }

product = lookup_asin('B09G9FPHY6')
for k, v in product.items():
    print(f'  {k}: {v}')

Step 3: Batch migrate multiple ASINs

Migrate a list of ASINs from your scraper queue to API lookups. Add rate limiting to stay within your plan's credit budget.

Python
import time

def batch_lookup(asins: list, delay: float = 0.3) -> list:
    results = []
    for asin in asins:
        try:
            product = lookup_asin(asin)
            results.append(product)
            print(f'[OK] {asin}: {product["price"]} - {product["title"][:40]}')
        except Exception as e:
            print(f'[ERR] {asin}: {e}')
            results.append({'asin': asin, 'error': str(e)})
        time.sleep(delay)
    success = sum(1 for r in results if 'error' not in r)
    print(f'\nBatch complete: {success}/{len(asins)} succeeded')
    print(f'Cost: ${len(asins) * 0.005:.3f}')
    return results

asins = ['B09G9FPHY6', 'B07FZ8S74R', 'B08N5WRWNW']
batch_lookup(asins)

Python Example

Python
import os, requests, time

SCAVIO_KEY = os.environ['SCAVIO_API_KEY']
H = {'Authorization': f'Bearer {SCAVIO_KEY}', 'Content-Type': 'application/json'}

# One page per call - there is no result-count param - so slice locally.
def search_amazon(query, num=5):
    resp = requests.post('https://api.scavio.dev/api/v1/amazon/search', headers=H,
        json={'query': query, 'country': 'us'})
    return resp.json()['data'].get('products', [])[:num]

def lookup_asin(asin):
    resp = requests.post('https://api.scavio.dev/api/v1/amazon/product', headers=H,
        json={'asin': asin, 'country': 'us'})
    return resp.json()['data']

results = search_amazon('wireless earbuds')
print(f'{len(results)} products found')
for r in results[:3]:
    print(f'  {r.get("title", "")[:50]} | {r.get("price", "N/A")}')

JavaScript Example

JavaScript
const SCAVIO_KEY = process.env.SCAVIO_API_KEY;

const H = { Authorization: `Bearer ${SCAVIO_KEY}`, 'Content-Type': 'application/json' };

// One page per call - there is no result-count param - so slice locally.
async function searchAmazon(query) {
  const resp = await fetch('https://api.scavio.dev/api/v1/amazon/search', {
    method: 'POST', headers: H,
    body: JSON.stringify({ query, country: 'us' })
  });
  return ((await resp.json()).data?.products || []).slice(0, 5);
}

async function lookupAsin(asin) {
  const resp = await fetch('https://api.scavio.dev/api/v1/amazon/product', {
    method: 'POST', headers: H,
    body: JSON.stringify({ asin, country: 'us' })
  });
  return (await resp.json()).data || {};
}

searchAmazon('wireless earbuds').then(r => {
  r.slice(0, 3).forEach(p => console.log(`${p.title?.slice(0, 50)} | ${p.price}`));
});

Expected Output

JSON
Found 5 products
  Sony WF-1000XM5 Truly Wireless Noise Cancelling Ea
  Price: $248.00 | Rating: 4.6
  Apple AirPods Pro 2nd Generation with USB-C
  Price: $189.99 | Rating: 4.7
  Samsung Galaxy Buds3 Pro
  Price: $159.99 | Rating: 4.4

[OK] B09G9FPHY6: $29.99 - Echo Dot (5th Gen) | Smart speaker
[OK] B07FZ8S74R: $24.99 - Fire TV Stick 4K with Alexa Voice
[OK] B08N5WRWNW: $89.99 - Kindle Paperwhite (11th Generatio

Batch complete: 3/3 succeeded
Cost: $0.015

Related Tutorials

    Frequently Asked Questions

    Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

    Python 3.9+ installed. requests library installed. A Scavio API key from scavio.dev. An existing Amazon scraper to migrate (optional). A Scavio API key gives you 50 free credits on signup.

    Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

    Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

    Related Resources

    Best Of

    Best Amazon Product Data APIs (No Scraping) 2026

    Read more
    Comparison

    Search APIs (Scavio, Tavily, SerpAPI) vs Headless Browser (Playwright, Puppeteer, Browserbase)

    Read more
    Best Of

    Best Search APIs Under $5 per 1K Queries in 2026

    Read more
    Glossary

    Web Scraping vs Search API

    Read more
    Comparison

    Scavio vs Apify

    Read more
    Solution

    Reddit Data Without Direct API

    Read more

    Start Building

    Migrate from fragile Selenium or Puppeteer Amazon scrapers to the Scavio API. Get structured product data without bot detection, CAPTCHAs or proxy management.

    Get Free API KeyRead the Docs
    ScavioScavio

    One scraper API for every social, search, e-commerce and real estate platform. Built for AI agents.

    Product

    • Features
    • Pricing
    • Dashboard
    • Affiliates

    Developers

    • Documentation
    • API Reference
    • Quickstart
    • MCP Integration
    • Python SDK

    Alternatives

    • Tavily Alternative
    • SerpAPI Alternative
    • Firecrawl Alternative
    • Exa Alternative
    • Serper Alternative
    • Tavily vs Scavio
    • SerpAPI vs Scavio
    • All alternatives
    • Compare Scavio vs alternatives

    Search APIs

    • Google Search API
    • Amazon Product API
    • YouTube API
    • Reddit API
    • Walmart Product API
    • TikTok API
    • Instagram API

    Tools

    • All Tools

    © 2026 Scavio. All rights reserved.

    Featured on TAAFT
    Terms of ServicePrivacy Policy