E-Commerce Data Extraction: API vs Browser Automation
March 3, 2026 · 7 min read
There are three main approaches to extracting product data from e-commerce stores. Each has tradeoffs. Here's how to choose.
Approach 1: Browser Automation (Puppeteer/Playwright)
How it works: Launch a headless browser, navigate to pages, wait for JavaScript to render, parse the DOM.
Pros:
- Works on any website
- Can handle JavaScript-rendered content
- Can interact with the page (click, scroll)
Cons:
- Slow (2-10 seconds per page)
- Resource-intensive (each browser tab uses 100MB+ RAM)
- Fragile (breaks when layouts change)
- Easily detected and blocked
- Expensive at scale (proxy costs, compute costs)
Approach 2: HTML Parsing (BeautifulSoup/Cheerio)
How it works: Fetch raw HTML with HTTP requests, parse with CSS selectors or XPath.
Pros:
- Fast (milliseconds per page)
- Low resource usage
- Simple to implement
Cons:
- Misses JavaScript-rendered content
- Still fragile to layout changes
- Still gets blocked by anti-bot systems
Approach 3: Platform API Extraction
How it works: Detect the e-commerce platform (Shopify, WooCommerce, etc.) and use its native data endpoints.
Pros:
- Fastest (structured JSON, no parsing)
- Most reliable (endpoints rarely change)
- Complete data (all products, not just visible ones)
- Standardized output across platforms
Cons:
- Only works for supported platforms
- Some stores disable API access
ShelfRun Uses Approach 3
ShelfRun automatically detects the store's platform and uses the optimal extraction method. For Shopify stores, we use the products.json API. For stores with sitemaps, we use structured data (JSON-LD). For everything else, we fall back to intelligent HTML parsing.
The Numbers
| Method | Speed | Cost per 1K products | Reliability |
|---|---|---|---|
| Browser automation | ~5 min | $2-5 (proxy + compute) | 60-80% |
| HTML parsing | ~30 sec | $0.50-1 (proxy) | 70-85% |
| ShelfRun API | <3 sec | $0.20 | 95%+ |