
H&M Data API: Extract Structured JSON in 2026
Extract publicly listed H&M product data as typed JSON via AlterLab’s structured API. Simple schema, clear cost, no bot work.
AlterLab handles this automatically — scrape any URL with one API call. No infrastructure required.
Try it freeThis guide covers extracting publicly accessible data. Always review a site's robots.txt and Terms of Service before scraping.
Why use H&M data?
You may need H&M product data for several practical purposes. AI models can train on up‑to‑date pricing trends. Analytics pipelines can track inventory changes across regions. Competitive intelligence tools can compare listings without manual copy‑paste. All of these use cases rely on clean, typed data that a data API can deliver.
What data can you extract?
Publicly listed product pages expose a predictable set of fields. Typical extraction targets include:
- title – the product name displayed on the page
- price – the listed price string
- currency – the three‑letter currency code
- sku – the stock‑keeping unit identifier
- availability – in‑stock, out‑of‑stock or limited status
- rating – average customer rating when shown
These fields are consistent across H&M’s storefront layout, making them suitable for downstream processing.
The extraction approach
Scraping raw HTML with libraries like BeautifulSoup works for simple pages but quickly breaks when H&M updates its markup. A data API removes that fragility. It fetches the page, runs the extraction, and returns validated JSON. You no longer need to maintain CSS selectors or handle layout drift. The service also handles IP rotation, CAPTCHA solving and request throttling behind the scenes.
Quick start with AlterLab Extract API
Getting started requires only a few steps. Install the SDK, define a schema and call the extract endpoint. Full installation instructions are in the Getting started guide.
import alterlab
client = alterlab.Client("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.extract(
url="https://hm.com/example-page",
schema=schema,
)
print(result.data)curl -X POST https://api.alterlab.io/v1/extract \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://hm.com/example-page",
"schema": {"properties": {"title": {"type": "string"}, "price": {"type": "string"}, "currency": {"type": "string"}}}
}'The endpoint returns an estimated cost before execution. Cost is clamped to a minimum of $0.001 and a maximum of $0.50. Pricing details are on the AlterLab pricing page. When a BYOK key is registered, the orchestration fee is 300 µ¢; otherwise the platform rate of 1000 µ¢ applies.
Define your schema
The schema parameter tells the API which fields to return and how to type them. AlterLab validates the output against the schema and rejects malformed responses. This guarantees that downstream code can safely access result.data["price"] without additional parsing.
Handle pagination and scale
High‑volume pipelines often need to process many product URLs. Use batch requests to send multiple URLs in a single POST. For asynchronous workflows, enqueue jobs and poll the status endpoint until completion. This pattern scales without hitting rate limits and keeps your balance predictable.
Extract structured e-commerce data from H&M
Batch and async usage example
import alterlab
import asyncio
client = alterlab.Client("YOUR_API_KEY")
urls = [
"https://hm.com/product/1",
"https://hm.com/product/2",
"https://hm.com/product/3",
]
async def extract_one(url):
schema = {
"type": "object",
"properties": {
"title": {"type": "string"},
"price": {"type": "string"},
"currency": {"type": "string"},
"sku": {"type": "string"},
"availability": {"type": "string"}
}
}
resp = client.extract(url=url, schema=schema)
return resp.data
async def main():
results = await asyncio.gather(*[extract_one(u) for u in urls])
print(results)
asyncio.run(main())Key takeaways
- Public product data on H&M can be retrieved as typed
Was this article helpful?
Frequently Asked Questions
Related Articles

Engineering Update: Atomic State, SDK Parsing, and Infrastructure
A technical breakdown of recent updates to AlterLab: implementing atomic state persistence for workers, resolving Node.js SDK template literal parsing, and infra fixes.
Herald Blog Service

Best Python web scraping API 2026: unbiased comparison
Discover how managed APIs compare to DIY and open‑source options for Python scraping in 2026. See success rates, latency, cost, and anti‑bot handling in a clear, data‑driven review.
Herald Blog Service

Building LLM-Ready Data Pipelines: From Raw HTML to Structured Records
Learn how to turn scraped web pages into clean, structured data ready for LLMs using reliable retrieval, cleaning, AI extraction, and validation steps.
Herald Blog Service
Popular Posts
Recommended
Newsletter
Scraping insights and API tips. No spam.
Recommended Reading

How to Scrape AliExpress: Complete Guide for 2026

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

AlterLab vs Firecrawl: Which Scraping API Is Better in 2026?

How to Scrape Twitter/X Data: Complete Guide for 2026

How to Scrape Cloudflare-Protected Sites in 2026
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
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.