How to Scrape Shopee Data: Complete Guide for 2026
Tutorials

How to Scrape Shopee Data: Complete Guide for 2026

Learn how to scrape Shopee data efficiently using Python and Node.js. This guide covers handling anti-bot protections, using Cortex AI for extraction, and scaling pipelines.

H
Herald Blog Service
4 min read
11 views

AlterLab handles this automaticallyscrape any URL with one API call. No infrastructure required.

Try it free

Disclaimer: This guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.

TL;DR

To scrape Shopee data, use the AlterLab API to handle JavaScript rendering and anti-bot challenges. Use the Cortex AI feature to extract structured JSON directly from public product pages without writing complex CSS selectors.

Try it yourself

Try scraping Shopee with AlterLab

Why collect e-commerce data from Shopee?

E-commerce data is the backbone of modern market intelligence. For engineers building data pipelines, Shopee represents a massive, high-velocity dataset. Practical use cases include:

  • Price Monitoring: Track competitor price fluctuations in real-time to inform dynamic pricing engines.
  • Market Research: Analyze product trends, category growth, and new product launches across specific regions.
  • Inventory Analysis: Monitor stock availability patterns to predict supply chain shifts.

Technical challenges

Scraping modern e-commerce platforms is no longer as simple as sending a GET request. Shopee uses sophisticated anti-bot measures designed to identify non-human behavior.

Standard HTTP clients often fail because they lack the browser fingerprints required to pass initial security checks. You will encounter:

  1. JavaScript Rendering: Much of the product data is injected into the DOM via complex JS bundles after the initial page load.
  2. Fingerprinting: Detection of headless browsers or inconsistent header patterns.
  3. IP Reputation: Rapid requests from the same IP will trigger CAPTCHAs or blocks.

To handle these, you often need a Smart Rendering API that can simulate a full browser environment and manage rotating proxies automatically.

Quick start with AlterLab API

You can integrate Shopee scraping into your existing stack using our Python or Node.js SDKs. Follow our Getting started guide to set up your environment.

Python Implementation

Python
import alterlab

client = alterlab.Client("YOUR_API_KEY")
response = client.scrape("https://shopee.com/example-product-page")
print(response.text)

Node.js Implementation

JAVASCRIPT
import { AlterLab } from "alterlab";

const client = new AlterLab({ apiKey: "YOUR_API_KEY" });
const response = await client.scrape("https://shopee.com/example-product-page");
console.log(response.text);

cURL Implementation

Bash
curl -X POST https://api.alterlab.io/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"url": "https://shopee.com/example-product-page"}'

Extracting structured data

Once you have the raw HTML, you need to parse it. For Shopee, you typically target specific CSS selectors for product names, prices, and ratings.

For a standard product page, you might look for:

  • Product Title: div.Vp_S_ (Note: classes change frequently)
  • Price: div.price
  • Rating: div.rating-count

However, relying on CSS selectors is fragile. If Shopee updates their frontend framework, your selectors will break.

Structured JSON extraction with Cortex

To solve the fragility of CSS selectors, use Cortex AI. Instead of writing selectors, you provide a schema, and Cortex extracts the data into typed JSON.

Python
import alterlab

client = alterlab.Client("YOUR_API_KEY")
result = client.extract(
    url="https://shopee.com/example-product-page",
    schema={
        "type": "object",
        "properties": {
            "title": {"type": "string"},
            "price": {"type": "number"},
            "rating": {"type": "number"},
            "description": {"type": "string"}
        }
    }
)
print(result.data)  # Typed JSON output

This approach turns unstructured HTML into a reliable data contract for your downstream applications.

99.2%Success Rate
1.2sAvg Response
$0.002Per Request (T3)

Cost breakdown

For Shopee, we recommend starting with Tier 3 (Stealth) to handle anti-bot protections effectively.

TierUse CaseCost per RequestCost per 1,000Requests per $1
T1 — CurlStatic HTML, no JS needed$0.0002$0.205,000
T2 — HTTPStandard pages with headers$0.0003$0.303,333
T3 — StealthProtected pages, anti-bot active$0.002$2.00500
T4 — BrowserFull JS rendering required$0.004$4.00250
T5 — CAPTCHACAPTCHA solving + JS rendering$0.02$20.0050

Note: AlterLab auto-escalates tiers. Start at T1 and the API promotes automatically if a lower tier fails. You only pay for the tier that succeeds. See full AlterLab pricing for details.

Best practices

To build a resilient scraping pipeline for Shopee, follow these engineering principles:

  1. Respect robots.txt: Always check the site's crawl rules.
  2. Implement Rate Limiting: Do not flood the server. Spread requests over time to mimic human browsing patterns.
  3. Handle Dynamic Content: Use browser-based rendering for pages that rely heavily on React or Vue for data injection.
  4. Monitor Success Rates: Track the ratio of T1 vs T3 requests to optimize your cost-to-success ratio.

Scaling up

When moving from a single script to a production pipeline, consider these scaling strategies:

  • Batch Requests: Group your target URLs and process them asynchronously.
  • Scheduling: Use cron-based scheduling to scrape product updates at specific intervals.
  • Webhooks: Instead of polling the API, use webhooks to have AlterLab push results directly to your server as they complete.

Key takeaways

  • Shopee requires handling JS rendering and anti-bot measures.
  • Use Cortex AI to avoid the maintenance burden of CSS selectors.
  • Automate your workflow with the AlterLab Python or Node.js SDKs.
  • Scale responsibly by implementing rate limits and monitoring tiers.

For more advanced implementation details, see our Shopee scraping guide.

Share

Was this article helpful?

Frequently Asked Questions

Scraping publicly accessible data is generally legal, but you must comply with the site's robots.txt and Terms of Service. Always implement rate limiting and avoid attempting to access private or non-public user data.
Shopee employs advanced anti-bot protections that detect standard HTTP requests. You often need rotating proxies, proper header management, and full JavaScript rendering to access content.
Costs vary by tier, from $0.0002 for static content to $0.004 for full browser rendering. AlterLab uses auto-escalation, so you only pay for the specific tier that successfully retrieves the data.