
Shopee Data API: Extract Structured JSON in 2026
TL;DR You can retrieve structured Shopee data as typed JSON by posting a URL and schema to AlterLab’s Extract API. The service validates output, handles...
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeRun a live request from this page. No sign-up needed.
TL;DR
You can retrieve structured Shopee data as typed JSON by posting a URL and schema to AlterLab’s Extract API. The service validates output, handles anti‑bot bypass, and returns a predictable JSON payload ready for pipelines.
Disclaimer: This guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.
Why use Shopee data?
E‑commerce teams need fresh product information for multiple purposes. Common use cases include:
- Training machine‑learning models on real‑time pricing trends.
- Building competitive intelligence dashboards that monitor competitor catalogs.
- Feeding analytics pipelines that aggregate inventory levels across categories.
Because the data is publicly listed, it can be collected without authentication, but the volume and variability of Shopee’s pages make a reliable extraction method essential.
What data can you extract?
Shopee exposes several fields that are safe to scrape when they appear in the public product card. Typical fields include:
- title – the human‑readable product name.
- price – the numeric price value.
- currency – the three‑letter currency code (e.g., USD, SGD).
- sku – the stock‑keeping unit identifier used by Shopee.
- availability – stock status such as "In stock" or "Out of stock".
- rating – average customer rating, often shown as a star count.
All of these appear in the HTML of a product detail page and are safe to collect as long as you respect Shopee’s robots.txt and rate limits.
The extraction approach
Raw HTTP requests followed by CSS selectors are fragile. Site redesigns, dynamic JavaScript rendering, and anti‑bot defenses can break a scraper overnight. A modern data API solves these problems by:
- Providing a stable endpoint that abstracts away HTTP details.
- Offering automatic anti‑bot bypass and rotating proxies.
- Returning validated, typed JSON instead of raw HTML.
With a data API you spend time building logic for your application, not debugging HTML changes.
Quick start with AlterLab Extract API
AlterLab lets you call /v1/extract to receive structured data in a single request. Below are minimal examples in Python and cURL.
from alterlab import AlterLabSync
client = AlterLabSync("YOUR_API_KEY")
schema = {
"type": "object",
"properties": {
"title": {"type": "string", "description": "The title field"},
"price": {"type": "string", "description": "The price field"},
"currency": {"type": "string", "description": "The currency field"},
"sku": {"type": "string", "description": "The sku field"},
"availability": {"type": "string", "description": "The availability field"},
"rating": {"type": "string", "description": "The rating field"}
}
}
result = client.scrape(
url="https://shopee.com/example-page",
extraction_schema=schema,
)
print(result["filtered_content"])curl -X POST https://api.alterlab.io/v1/extract \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://shopee.com/example-page",
"schema": {"properties": {"title": {"type": "string"}, "price": {"type": "string"}, "currency": {"type": "string"}}}
}'The response body is a JSON object that matches the schema you supplied, eliminating the need for post‑processing. For full documentation see the Extract API reference. Beginners can follow the Getting started guide to install the SDK and set up API keys.
Batch and async usage
When you need to harvest hundreds of product pages, sending requests sequentially hits rate limits. AlterLab supports asynchronous batches:
import asyncio
from alterlab import AlterLab
async def extract_product(url):
schema = {"properties": {"title": {"type": "string"}, "price": {"type": "string"}}}
return await AlterLab("YOUR_API_KEY").extract(url=url, schema=schema)
async def main():
urls = ["https://shopee.com/p/123", "https://shopee.com/p/456", "https://shopee.com/p/789"]
tasks = [extract_product(u) for u in urls]
results = await asyncio.gather(*tasks)
for r in results:
print(r.data)
asyncio.run(main())This pattern scales horizontally, respects built‑in throttling, and lets you process results as they arrive.
Define your schema
The schema is a JSON object that describes the fields you expect. AlterLab validates the extracted payload against this schema and returns only the fields you declared. Here’s a concise example for a Shopee product:
{
"title": {"type": "string"},
"price": {"type": "string"},
"currency": {"type": "string"},
"sku": {"type": "string"},
"availability": {"type": "string"},
"rating": {"type": "string"}
}When you submit this schema, the API guarantees that the data field in the response contains exactly those keys with correctly typed values. This eliminates manual parsing and reduces errors in downstream pipelines.
Handle pagination and scale
Sho
Was this article helpful?
Frequently Asked Questions
Related Articles

Oxylabs Alternative: Practical Developer Guide for Web Scraping Pipelines
Build reliable scraping pipelines with anti-bot handling, auto-escalation, and monitoring using a practical AltLab-compatible solution. Follow the 3-step setup, integrate with your existing workflow, and control costs at $0.0002 per request.
Herald Blog Service

Python aiohttp vs. httpx for High-Throughput Web Scraping
A benchmark‑driven comparison of aiohttp and httpx for asynchronous scraping, with concrete numbers, code snippets, and guidance on when to choose each library.
Herald Blog Service

MCP Servers Explained: How AI Tools Access the Real-Time Web in 2026
Learn how Model Context Protocol servers enable AI agents to fetch live data via scraping APIs, with architecture, code examples, and best practices for 2026.
Herald Blog Service
Popular Posts
Recommended

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Why Your Headless Browser Gets Detected (and How to Fix It)

Playwright Stealth and Anti-Bot Techniques for RAG Pipelines

Mastering Playwright Stealth for Agentic Web Workflows

How to Scrape E-Commerce Sites for AI Agents Using Playwright and LLMs
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

Selenium Bot Detection: Why You Get Flagged and How to Fix It

Why Your Headless Browser Gets Detected (and How to Fix It)

Playwright Stealth and Anti-Bot Techniques for RAG Pipelines

Mastering Playwright Stealth for Agentic Web Workflows

How to Scrape E-Commerce Sites for AI Agents Using Playwright and LLMs
Stay in the Loop
Get scraping insights, API tips, and platform updates. No spam — we only send when we have something worth reading.
Explore AlterLab
Anti-Bot Handling API
Automatic challenge handling for protected sites — works out of the box.
JavaScript Rendering API
Render SPAs and dynamic content with headless Chromium.
Pricing
5-tier pricing from $0.0002/page. Up to 5,000 free requests to start.
Documentation
API reference, SDKs, quickstart guides, and tutorials.
Web Scraping API Resources
Part of the Web Scraping API Documentation cluster
Complete API reference with 5-tier auto-escalation — Curl to challenge resolution.
Pillar pageConfigure Tier 4 browser rendering for SPAs and dynamic content.
Scrape pages behind login using session management.
Real success rates and cost data across all 5 tiers.
MCP Server, Python SDK, and Firecrawl-compatible API for AI agent workflows.