# H\&M Product Scraper (`gauzy_penguin/hm-product-scraper`) Actor

Scrape H\&M product listings, prices, colors, sizes, and images from multiple countries. Perfect for price monitoring, product cataloging, and e-commerce analytics.

- **URL**: https://apify.com/gauzy_penguin/hm-product-scraper.md
- **Developed by:** [scrape anything](https://apify.com/gauzy_penguin) (community)
- **Categories:** E-commerce, Automation, AI
- **Features:** Limited permissions
- **Stats:** 78 total users, 12 monthly users, 100.0% runs succeeded, 7 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $4.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Search Results Scraper

### Overview

The **H\&M Search Results Scraper** is a production-grade Apify actor designed to extract product listings from **hm.com** search results.

This actor is built for **stability, scalability, and ease of use**, providing clean, structured output suitable for analytics, monitoring, research, and downstream automation.

It supports keyword search, sorting, pagination, and rate-limit handling.

***

### Key Features

- 🔍 Keyword-based product search
- ↕️ Multiple sorting modes (best match, newest, price)
- 📦 Clean, simplified output schema
- 🔁 Automatic pagination
- 🛡 Built-in retry and rate-limit handling
- 🚀 Production-ready and Apify Store compliant

***

### How It Works

1. The actor initializes.
2. Results are paginated automatically until the requested limit is reached.
3. Each item is **simplified** into a clean, user-friendly structure.
4. Data is stored in the default Apify dataset.

***

### Input Configuration

#### Required Fields

| Field | Type | Description |
|------|------|-------------|
| `keywords` | string | Search keywords seperated by comma (e.g. `jacket, jeans , boots`) |

#### Optional Fields

| Field | Type | Description |
|------|------|-------------|
| `Country` | string | Get data for a specific country |
| `sortBy` | integer | Sorting mode |
| `maxItems` | integer | Maximum number of items to scrape |

#### Sorting Options (`sortBy`)

RELEVANCE,
NEWEST_FIRST,
PRICE_ASCENDING,
PRICE_DESCENDING

***

### Output Data Structure

The actor outputs a **simplified, stable schema** designed for non-technical users and analysts.

#### Example Output

```json
{
  "id": "1301478001",
  "title": "Jacket",
  "brand": "H&M",
  "price": 499.0,
  "formatted_price": "HK$499.00",
  "currency": "H",
  "url": "https://www2.hm.com/en_hk/productpage.1301478001.html",
  "availability": "Available",
  "coming_soon": false,
  "color": "Dark brown",
  "color_code": "3F3838",
  "category": "ladies_jacketscoats_jackets",
  "quality_marker": null,
  "new_arrival": false,
  "images": [
    "https://image.hm.com/assets/hm/c4/10/c410a9a013b10eb7fc743fd213596c3261458399.jpg",
    "https://image.hm.com/assets/hm/44/0b/440b977cb5ae4404e0ea084b4f46b9397255dc1f.jpg",
    "https://image.hm.com/assets/hm/16/60/16609aed879718477fbbc3ed0f92b5fe7385aaf7.jpg",
    "https://image.hm.com/assets/hm/fc/26/fc26e999295e9cc293e05d78ca00aefbf2675756.jpg"
  ],
  "model_image": "https://image.hm.com/assets/hm/0d/78/0d78f150f2e5ad657641217fc36aa8ebea52aa30.jpg",
  "swatches": [
    {
      "color": "Dark brown",
      "color_code": "3F3838",
      "image": "https://image.hm.com/assets/hm/e7/1e/e71e845409096ac552c229f656b092bce1eca5c1.jpg",
      "url": "https://www2.hm.com/en_hk/productpage.1301478001.html"
    }
  ],
  "sizes": [
    {
      "size": "XXS",
      "stock": 2,
      "in_stock": true
    },
    {
      "size": "XS",
      "stock": 2,
      "in_stock": true
    },
    {
      "size": "S",
      "stock": 2,
      "in_stock": true
    },
    {
      "size": "M",
      "stock": 2,
      "in_stock": true
    },
    {
      "size": "L",
      "stock": 2,
      "in_stock": true
    },
    {
      "size": "XL",
      "stock": 2,
      "in_stock": true
    }
  ]
}
```

### Use Cases

1. 📊 Market research and price analysis

2. 🛒 Product discovery and comparison

3. 📈 Trend monitoring

4. 🤖 Feeding downstream automation pipelines

5. 🧠 Dataset creation and enrichment

### Performance & Reliability

1. Automatic retries with exponential backoff

2. Graceful handling of rate limits (403 / 429)

3. Batched dataset writes for efficiency

4. Designed for long-running and large-scale jobs

### Support & Maintenance

This actor is actively maintained and designed for production usage.
For issues or feature requests, please use the Apify platform issue tracker.

### Final Notes

This actor prioritizes:

1. Data clarity

2. Operational reliability

3. Professional usability

It is suitable for both individual users and enterprise-scale workflows.

# Actor input Schema

## `keywords` (type: `string`):

List of keywords separated by commas to search for on H\&M (e.g., nike, iphone, jordan).

## `Country` (type: `string`):

Select the country to scrape data from.

## `sortBy` (type: `string`):

Choose how search results are sorted.

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

Maximum number for each keyword to retrieve.

## Actor input object example

```json
{
  "keywords": "jacket, jeans, boots",
  "Country": "en_us",
  "sortBy": "RELEVANCE",
  "maxItems": 200
}
```

# Actor output Schema

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

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("gauzy_penguin/hm-product-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("gauzy_penguin/hm-product-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 '{}' |
apify call gauzy_penguin/hm-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,gauzy_penguin/hm-product-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/xk3NniREfotbJoa0W/builds/RBuWNVJxGIBuygl2L/openapi.json
