# H\&M Scraper (`scraptivo/h-and-m-scraper`) Actor

H\&M product listings from search queries, search URLs, and category URLs, with optional product details including description, composition, and colours.

- **URL**: https://apify.com/scraptivo/h-and-m-scraper.md
- **Developed by:** [Scraptivo](https://apify.com/scraptivo) (community)
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 product scrapeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**H\&M Scraper** collects product catalogs from [H\&M](https://www2.hm.com) and turns them into structured data for price tracking, assortment research, and merchandising feeds. Provide category or search URLs, or search queries, then export product names, prices, discounts, colors, sizes, and availability — with optional descriptions, composition, and materials — to JSON, CSV, Excel, or your integration. Use it to monitor prices, compare assortment across markets, and keep product feeds current. Pricing starts at **$1.50 per 1,000 products**, with optional details billed at **$2.50 per 1,000**.

### What can you automate with H\&M Scraper?

- **Build category or search catalogs** — from H\&M start URLs, search terms, or both in one run.
- **Monitor prices and discounts** — capture current price, original price, currency, and availability.
- **Track sizes and color variants** — collect per-size stock, swatches, and gallery images.
- **Enrich with product details** — add descriptions, composition, materials, and care information when enabled.
- **Scale across markets** — use locale paths in URLs (`de_de`, `en_us`, and more) or the `locale` field for search.
- **Automate exports** — feed pricing and merchandising tools, dashboards, and pipelines.

### Who is this scraper for?

| Team | Workflow |
|---|---|
| Retail analytics teams | Comparing assortment and pricing across categories and search terms. |
| Merchandising and feed teams | Keeping PIM or marketplace listings aligned with H\&M's live catalog. |
| Price monitoring teams | Scheduling runs on key categories and tracking markdowns over time. |
| Market researchers | Running Germany, US, UK, and other locales with local currency. |

### What data can you collect from H\&M?

| Data group | Example fields | How it helps |
|---|---|---|
| Product identity | `productName`, `brandName`, `articleId`, `productId`, `url` | Identify and deduplicate records with the stable `articleId`. |
| Pricing | `price`, `formattedPrice`, `originalPrice`, `percentageDiscount`, `currency` | Track current price and markdowns. |
| Availability | `availability`, `sizes`, `newArrival` | See stock status and size labels. |
| Color and media | `colorName`, `imageUrl`, `images`, `swatches` | Preview colorways and gallery images. |
| Provenance | `locale`, `sourceQuery`, `sourceUrl` | Trace the market and source query or URL. |
| Details | `details` with description, composition, colors, materials | Enrich records when details are enabled. |

The `details` object appears only when **Include Product Details** is enabled. Listing-level data is always returned.

### How to use H\&M Scraper

1. Open the [H\&M Scraper](https://apify.com/scraptivo/h-and-m-scraper) on Apify.
2. Add `startUrls` and/or `searchQueries`, and set `locale` for search queries.
3. Set `maxItems` to cap the run.
4. Optionally enable **Include Product Details** to add descriptions and composition.
5. Run the Actor and export the dataset to JSON, CSV, or Excel, or connect it to your workflow.

```json
{
    "searchQueries": ["jackets"],
    "startUrls": [
        { "url": "https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html" }
    ],
    "locale": "de_de",
    "includeProductDetails": true,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
}
```

### Example workflow

#### Track seasonal markdowns in a category

1. Schedule a weekly run on a category URL such as the men's new arrivals page.
2. Compare `price` against `originalPrice` and `percentageDiscount` per `articleId`.
3. Enable **Include Product Details** once per season to capture composition and materials.
4. Deduplicate on `articleId`, then push price changes to your monitoring dashboard.

### Automate and integrate your results

- **Schedules** — set weekly runs on key categories to track markdowns and new arrivals.
- **Webhooks** — trigger a webhook on run completion to push fresh products into your PIM, Google Sheets, or pricing tool.
- **Exports and API** — download JSON, CSV, or Excel from the Console, or call the Actor from the API. One cURL example:

```shell
curl "https://api.apify.com/v2/acts/scraptivo/h-and-m-scraper/runs?token=YOUR-APIFY-TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchQueries": ["jackets"],
    "locale": "de_de",
    "maxItems": 10,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"]
    }
  }'
```

- **Deduplication** — use the stable `articleId` (or `productId`) as the key when merging results across runs.

### Input reference

| Field | Type | Required | Default | What it controls |
|---|---:|---|---|---|
| `startUrls` | Array of URLs | No\* | — | H\&M search, category, or product URLs. The locale in the path (`de_de`, `en_us`) selects the market. |
| `searchQueries` | Array of strings | No\* | — | Product search terms (e.g. "jackets"). Uses the `locale` field. |
| `locale` | String | No | `de_de` | Market for search queries (e.g. `de_de`, `en_us`). |
| `includeProductDetails` | Boolean | No | `false` | Fetch description, composition, colors, and materials. Charged as `product-details`. |
| `detailConcurrency` | Integer | No | `5` | Parallel detail requests when details are enabled (1–8). |
| `maxItems` | Integer | No | `10` | Maximum products to scrape (`0` = no limit). |
| `proxyConfiguration` | Proxy object | No | Residential Apify proxy | Proxy settings. Residential proxies are recommended. |

\* Provide at least one `startUrls` entry or `searchQueries` entry.

### Output example

Each dataset item is one product. With details enabled, a record looks like this:

```json
{
    "imageUrl": "https://lp2.hm.com/example.jpg",
    "productName": "Loose Fit Denim Jacket",
    "brandName": "H&M",
    "price": 39.99,
    "currency": "EUR",
    "formattedPrice": "€39.99",
    "originalPrice": 49.99,
    "originalFormattedPrice": "€49.99",
    "percentageDiscount": "20%",
    "availability": "In stock",
    "colorName": "Blue",
    "sizes": ["S", "M", "L", "XL"],
    "url": "https://www2.hm.com/de_de/productpage.1234567890.html",
    "articleId": "1234567890",
    "productId": "0987654321",
    "locale": "de_de",
    "sourceQuery": "jackets",
    "sourceUrl": "https://www2.hm.com/de_de/search-results.html?q=jackets",
    "newArrival": true,
    "images": ["https://lp2.hm.com/example.jpg"],
    "swatches": [{ "colorName": "Black", "imageUrl": "https://lp2.hm.com/swatch.jpg" }],
    "details": {
        "description": "Loose-fit denim jacket in washed cotton.",
        "composition": "Cotton 100%",
        "materials": ["Cotton"],
        "colors": ["Blue", "Black"]
    }
}
```

### How much does it cost to scrape H\&M?

The Actor uses pay-per-event pricing. Platform usage is not charged separately:

| Event | What counts | Price (per 1,000) |
|---|---|---|
| `product` | Each product saved to the dataset | **$1.50** |
| `product-details` | Each product whose row includes a `details` object (when details are on and extraction succeeded) | **$2.50** |

Apify plan discounts apply automatically: `product` at Bronze **$1.40**, Silver **$1.30**, Gold **$1.20**; `product-details` at Bronze **$2.40**, Silver **$2.30**, Gold **$2.20** per 1,000. Listing-only runs pay only the `product` event.

### Reliability and responsible use

- **Proxy requirement** — the Actor defaults to the Apify residential proxy, which is recommended for consistent H\&M results.
- **Conditional fields** — the `details` object appears only when **Include Product Details** is enabled and extraction succeeds; some fields are nullable on the platform.
- **Public data** — the Actor collects publicly visible product information from H\&M.
- **Responsible use** — only use the data in ways that comply with H\&M's terms of service and applicable law.

### Frequently asked questions

#### Can I scrape H\&M by category URL and by search term?

Yes. Use `startUrls` for category, search, or product URLs and/or `searchQueries` for search terms. You can combine both in one run.

#### Can I schedule the H\&M Scraper to run automatically?

Yes. Use the **Scheduler** tab in Apify Console to run weekly on key categories to track markdowns and new arrivals.

#### What counts as one result?

A product row counts as one `product` event ($1.50 per 1,000). Enabling details adds a `product-details` event ($2.50 per 1,000) for each row that includes a `details` object.

#### Why are some fields empty?

The `details` object appears only when **Include Product Details** is enabled and extraction succeeds. Some fields are also nullable on H\&M itself.

#### How do I avoid duplicate records?

Dedupe on the stable `articleId` (or `productId`) when merging results across runs.

#### Do I need a proxy?

The Actor works out of the box with the default Apify residential proxy, which is recommended for consistent results.

### Related Scraptivo automations

- **[Nike Scraper](https://apify.com/scraptivo/nike-scraper)** — collect Nike.com product listings across marketplaces.
- **[Walmart Scraper](https://apify.com/scraptivo/walmart-scraper)** — collect Walmart product listings with optional details and reviews.
- **[Alibaba Scraper](https://apify.com/scraptivo/alibaba-scraper)** — collect Alibaba.com product listings with supplier and review data.

### Support and custom workflows

Need a different field, source, or delivery workflow? Contact Scraptivo at scraptivo@gmail.com. Include the Actor name, sample URL, required fields, and expected volume so we can assess the request.

# Actor input Schema

## `startUrls` (type: `array`):

H\&M search, category, or product URLs. A search URL looks like https://www2.hm.com/de_de/search-results.html?q=jackets. A category URL looks like https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html. The locale in the path (de_de, en_us) selects the market.

## `searchQueries` (type: `array`):

Product search terms, for example jackets or linen shirt. Uses the Locale field. You can combine these with start URLs.

## `locale` (type: `string`):

Market for search queries, for example de_de or en_us. Category, search, and product URLs use the locale in the URL instead.

## `includeProductDetails` (type: `boolean`):

Fetch description, composition, colours, and materials for each product. Charged as a product-details event in addition to the product event. Detail requests run in parallel and share one proxy. A browser is used only when the product page requires cookies.

## `detailConcurrency` (type: `integer`):

How many product detail requests to run at once when Include Product Details is enabled. They share one proxy session.

## `maxItems` (type: `integer`):

Maximum number of products to scrape. Use 0 for no limit.

## `proxyConfiguration` (type: `object`):

Proxy settings. Residential proxies are recommended. Product details keep one proxy for the whole session.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html"
    }
  ],
  "searchQueries": [
    "jackets"
  ],
  "locale": "de_de",
  "includeProductDetails": false,
  "detailConcurrency": 5,
  "maxItems": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset of H\&M products

## `runStats` (type: `string`):

Product counts and timestamps for this run

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        {
            "url": "https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html"
        }
    ],
    "searchQueries": [
        "jackets"
    ],
    "locale": "de_de",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraptivo/h-and-m-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "startUrls": [{ "url": "https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html" }],
    "searchQueries": ["jackets"],
    "locale": "de_de",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scraptivo/h-and-m-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://www2.hm.com/de_de/herren/neuheiten/alle-anzeigen.html"
    }
  ],
  "searchQueries": [
    "jackets"
  ],
  "locale": "de_de",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scraptivo/h-and-m-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scraptivo/h-and-m-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/awNpKYQGzcPN92MJo/builds/IkUKxgQSVr5yeDChz/openapi.json
