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

Scrape product data from H\&M’s website using the country of the website.

- **URL**: https://apify.com/misceres/h-m-scraper.md
- **Developed by:** [Misceres](https://apify.com/misceres) (community)
- **Categories:** E-commerce
- **Stats:** 145 total users, 0 monthly users, 100.0% runs succeeded, 5 bookmarks
- **User rating**: No ratings yet

## Pricing

$25.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### What does H&M Scraper do?

With this scraper tool, you can **get product data from H&M's website**. The scraper visits the H&M website of your choice (usually a specific country) and scrapes all available H&M product data from that branch. One dataset takes around 30 min to take shape and includes product name, price, sale price, currency, country, description, URL, item number, category, subcategory, time of listing, and image URL.

### What H&M product data can I extract with a scraper?

<p>Each product will be listed in the dataset under a specific product category, subcategory, and division along with its price, description, URL, posting time, and other specifications. <br> </p>

<p>👩 👱‍♂️ 👧 👶 Product division: Women, Men, Baby, H&M HOME, Kids, Sport, Beauty. <br> </p>

<p>👔 👗 👚 🎁 Product categories: Trousers & Leggings, Sportswear, Nightwear & Loungewear, Basics, Plus Sizes, Shoes, Jeans, Jackets & Coats, Skirts, Maternity Wear, Swimwear & Beachwear, Bags, Makeup, Trousers, Shirts, Towels & Bathroom accessories, Partywear, Home Storage & Organizing, Vases & Decorations, Bedding, Rugs, Dinnerware & Tableware, Cookware & Bakeware, Lighting, Curtains, Blankets & Throws, Loungewear, etc. <br> </p>

<p>🧥 🩱 🩳 🧢 Product subcategories: High Waisted Trousers, Flip Flops, Cargo Trousers, Bomber Jackets, Jackets & Coats, Jackets, Jumpers, Wrap Dresses, Party Dresses, Short Dresses, Trench Coats, Off Shoulder Shirts & Blouses, Denim shirts, Sweatshirts & Hoodies, Vests, Parkas, Graphic Tees & Printed T-Shirts, Lingerie & Tights, Dungarees, Swimwear, Handbags, Necklace, Hair Accessories, Socks & Tights, Makeup Brushes, Slim Fit, Casual Shorts, Loose Fit, etc.<br> </p>

<p>Branches: United States, Mexico, France, Germany, Italy, Australia, Canada, Spain, United Kingdom, China. <br> </p> 

### Why scrape H&M?

<p>🕵️ Conduct retail analysis by price, popularity, newness, etc. <br> </p>

<p>👚 Identify new trends across retail industry and fast fashion in particular <br> </p>

<p>👟 Keep an eye on competitor landscape <br> </p>

<p>💪 Conduct basic market research by countries and product categories <br> </p>

### How do I use H&M Scraper?

H&M Scraper was designed to be easy to start with even if you've never extracted product data from e-commerce websites before. Here's how you can scrape H&M product data using this tool:

1. [Create](https://console.apify.com/sign-up) a free Apify account using your email.
2. Open [H&M Scraper](https://apify.com/misceres/h-m-scraper).
3. Choose a H&M branch (country) to scrape.
4. Click "Start" and wait for the data to be extracted.
5. Download your data in JSON, JSONL, XML, CSV, Excel, or HTML.

### How much will it cost me to scrape product data from H&M shops?

[Apify Free plan](https://apify.com/pricing) provides you with **$5 free usage credits** per month. For those $5 you can get **more than 50,000 items** from this H&M Scraper. So it will be completely free for at least 50K results!

If you need to scrape data from H&M or other [e-commerce shops](https://apify.com/store/categories/ecommerce) on a more regular basis and larger scale, go for a $49/month [Personal plan](https://apify.com/pricing).

### Input

The input for H&M Scraper should be an H&M franchise in a particular country. You can pick one country per run; the scraper will extract data on every available H&M item offered on their website.

```json 
{ 
  "inputCountry": "USA"
}

````

### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above (USA):

![Apify - H\&M Run - Output](https://i.imgur.com/YQFd0lJ.png)

And here is the same data but in JSON. You can choose in which format to download your H\&M data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```json
[{
  "company": "HM",
  "country": "USA",
  "productName": "H&M+ Pleated Skirt",
  "articleNo": 1144202001,
  "division": "Women",
  "category": "Plus Sizes",
  "subCategory": "Plus Sizes",
  "listPrice": 24.99, 
  "salePrice": null,
  "currency": "USD",
  "description": "Short, pleated skirt in twill. Concealed zipper at one side with button. Unlined.",
  "url": "<https://www2.hm.com/en_us/productpage.1144202001.html>",
  "imageUrl": "<https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F63%2F92%2F63929b71eb1244aea69ced6096126375c0baf963.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5B%5D%2Ctype%5BDESCRIPTIVESTILLLIFE%5D%2Cres%5Bm%5D%2Chmver%5B2%5D&call=url[file:/product/main]>",
  "timestamp": "2023-03-03T14:11:12.397Z"
},
{
  "company": "HM",
  "country": "USA",
  "productName": "H&M+ Crop Denim Overshirt",
  "articleNo": 1033494001,
  "division": "Women",
  "category": "Plus Sizes",
  "subCategory": "Shirts & Blouses",
  "listPrice": 29.99,
  "salePrice": null,
  "currency": "USD",
  "description": "The Water Saving Collection is a collection of 90s and Y2K-inspired denim garments made from more sustainable materials in a water-saving manufacturing process. Crop overshirt is in thick denim made from recycled cotton. Collar, snap fasteners at front, yoke front and back, and open front pockets. Dropped shoulders and long sleeves with snap fastener at cuffs. Rounded, slightly longer hem at back.",
  "url": "<https://www2.hm.com/en_us/productpage.1033494001.html>",
  "imageUrl": "<https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F02%2F29%2F022966c3fcf96f9e183939a2f58d83237169bf8b.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5B%5D%2Ctype%5BDESCRIPTIVESTILLLIFE%5D%2Cres%5Bm%5D%2Chmver%5B2%5D&call=url[file:/product/main]>",
  "timestamp": "2023-03-03T14:11:12.511Z"
},
{
  "company": "HM",
  "country": "USA",
  "productName": "H&M+ Crop Denim Overshirt",
  "articleNo": 1033494002,
  "division": "Women",
  "category": "Plus Sizes",
  "subCategory": "Shirts & Blouses",
  "listPrice": 29.99,
  "salePrice": null,
  "currency": "USD",
  "description": "The Water Saving Collection is a collection of 90s and Y2K-inspired denim garments made from more sustainable materials in a water-saving manufacturing process. Crop overshirt is in thick denim made from recycled cotton. Collar, snap fasteners at front, yoke front and back, and open front pockets. Dropped shoulders and long sleeves with snap fastener at cuffs. Rounded, slightly longer hem at back.",
  "url": "<https://www2.hm.com/en_us/productpage.1033494002.html>",
  "imageUrl": "<https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F9d%2F6e%2F9d6e37598b723c908562aea456fcdb79ea11d623.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5Bladies_plus_shirtsblouses%5D%2Ctype%5BDESCRIPTIVESTILLLIFE%5D%2Cres%5Bm%5D%2Chmver%5B2%5D&call=url[file:/product/main]>",
  "timestamp": "2023-03-03T14:11:12.511Z"
},
{
  "company": "HM",
  "country": "USA",
  "productName": "H&M+ Oversized Blouse",
  "articleNo": 1070407001,
  "division": "Women",
  "category": "Plus Sizes",
  "subCategory": "Shirts & Blouses",
  "listPrice": 24.99,
  "salePrice": null,
  "currency": "USD",
  "description": "Oversized blouse in a woven, textured viscose blend. Collar, buttons at front, and double-layered yoke at back. Chest pockets with flap and button, heavily dropped shoulders, and long sleeves with buttons at cuffs. Rounded hem, slightly longer at back.",
  "url": "<https://www2.hm.com/en_us/productpage.1070407001.html>",
  "imageUrl": "<https://lp2.hm.com/hmgoepprod?set=quality%5B79%5D%2Csource%5B%2F73%2F98%2F73980388982c1c7d55d551727d66b7a5831a6460.jpg%5D%2Corigin%5Bdam%5D%2Ccategory%5B%5D%2Ctype%5BDESCRIPTIVESTILLLIFE%5D%2Cres%5Bm%5D%2Chmver%5B2%5D&call=url[file:/product/main]>",
  "timestamp": "2023-03-03T14:11:12.671Z"
}]
...

```

### Integrations and H\&M Scraper

Last but not least, **H\&M Scraper can be connected with almost any cloud service or web app** thanks to <a  href=" https://apify.com/integrations" target="_blank"> integrations on the Apify platform</a>. You can integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, <a  href="https://docs.apify.com/integrations" target="_blank"> and more</a>.

Or you can use  <a  href="https://docs.apify.com/integrations/webhooks"  target="_blank">webhooks</a> to carry out an action whenever an event occurs, e.g., get a notification whenever H\&M Scraper successfully finishes a run.

### Using H\&M Scraper with the Apify API

The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more.

To access the API using Node.js, use the `apify-client` NPM package. To access the API using Python, use the `apify-client` PyPI package.

### Is it legal to scrape H\&M data?

Scraping H\&M products is legal. Our [e-commerce scrapers](https://apify.com/store/categories/ecommerce) are ethical and **only extract publicly available data** such as product names and descriptions, prices, time of posting on the website, categories, etc. If you would like to learn more about the most recent legal practices of data scraping, see [this blogpost](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `inputCountry` (type: `string`):

Select country

## Actor input object example

```json
{
  "inputCountry": "UNITED KINGDOM"
}
```

# 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("misceres/h-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 = {}

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

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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 misceres/h-m-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=misceres/h-m-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "H&M Scraper",
        "description": "Scrape product data from H&M’s website using the country of the website.",
        "version": "0.0",
        "x-build-id": "mMB1zV3SEebCyV7jF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/misceres~h-m-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-misceres-h-m-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/misceres~h-m-scraper/runs": {
            "post": {
                "operationId": "runs-sync-misceres-h-m-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/misceres~h-m-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-misceres-h-m-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "inputCountry": {
                        "title": "Country",
                        "enum": [
                            "UNITED KINGDOM",
                            "USA",
                            "ITALY",
                            "GERMANY",
                            "FRANCE",
                            "AUSTRALIA",
                            "SPAIN",
                            "CANADA",
                            "MEXICO"
                        ],
                        "type": "string",
                        "description": "Select country",
                        "default": "UNITED KINGDOM"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
