APIs / Marketplaces / H&M

1 credit per call2 endpoints21 datapoints

H&M API

H&M API for product search by locale with category, sort and filters, and product details with colours, sizes and stock, as JSON. 1 credit per call.

H&M
GET/v1/hm/search?query=jeans&locale=en_us&sort=PRICE_ASCENDING
{
  "success": true,
  "data": {
    "query": "jeans",
    "locale": "en_us",
    "currency": "USD",
    "page": 1,
    "page_size": 36,
    "sort": "PRICE_ASCENDING",
    "total": 1335,
    "total_pages": 38,
    "items": [
      {
        "article_id": "1342508001",
        "name": "Stretch Jeans",
        "brand": "H&M",
        "url": "https://www2.hm.com/en_us/productpage.1342508001.html",
        "image_url": "https://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg",
        "model_image_url": "https://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg",
        "images": [
          {
            "url": "https://image.hm.com/assets/hm/31/4b/314b9463fc114d62bc5f35f9a5e112e6b76dcc52.jpg",
            "type": "DescriptiveDetail"
          },
          {
            "url": "https://image.hm.com/assets/hm/08/1f/081fbf910432bffdd8c6278d7bb459f51b8005c9.jpg",
            "type": "DescriptiveDetail"
          }
        ],
        "price": 9.99,
        "currency": "USD",
        "member_price": 8.49,
        "colour": "Dark denim blue",
        "colour_code": "79829D",
        "colour_shades": [
          "Bright blue",
          "Pastel blue",
          "Blue gray"
        ],
        "colours": [
          {
            "article_id": "1342508001",
            "name": "Dark denim blue",
            "code": "79829D",
            "image_url": "https://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508001.html"
          },
          {
            "article_id": "1342508002",
            "name": "Light denim blue",
            "code": "80AAD8",
            "image_url": "https://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508002.html"
          },
          {
            "article_id": "1342508003",
            "name": "Dark gray",
            "code": "272627",
            "image_url": "https://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508003.html"
          }
        ],
        "sizes": [
          {
            "id": "004",
            "label": "4-6M",
            "availability": "in_stock"
          },
          {
            "id": "005",
            "label": "6-9M",
            "availability": "in_stock"
          },
          {
            "id": "006",
            "label": "9-12M",
            "availability": "in_stock"
          }
        ],
        "in_stock": true,
        "coming_soon": false,
        "category_code": "kids_baby_boy_clothing_trousersjeans_jeans",
        "is_new": false,
        "is_multipack": false,
        "has_video": false
      },
      {
        "article_id": "1342508002",
        "name": "Stretch Jeans",
        "brand": "H&M",
        "url": "https://www2.hm.com/en_us/productpage.1342508002.html",
        "image_url": "https://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg",
        "model_image_url": "https://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg",
        "images": [
          {
            "url": "https://image.hm.com/assets/hm/ed/8f/ed8f5bb2d31940b0e9e45a0237fbcd23365b4f04.jpg",
            "type": "DescriptiveDetail"
          },
          {
            "url": "https://image.hm.com/assets/hm/75/ee/75ee7a20dedc97a56b6e4cf8cbe433eec41d6c75.jpg",
            "type": "DescriptiveDetail"
          }
        ],
        "price": 9.99,
        "currency": "USD",
        "member_price": 8.49,
        "colour": "Light denim blue",
        "colour_code": "80AAD8",
        "colour_shades": [
          "Bright blue",
          "Pastel blue",
          "Blue gray"
        ],
        "colours": [
          {
            "article_id": "1342508002",
            "name": "Light denim blue",
            "code": "80AAD8",
            "image_url": "https://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508002.html"
          },
          {
            "article_id": "1342508001",
            "name": "Dark denim blue",
            "code": "79829D",
            "image_url": "https://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508001.html"
          },
          {
            "article_id": "1342508003",
            "name": "Dark gray",
            "code": "272627",
            "image_url": "https://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508003.html"
          }
        ],
        "sizes": [
          {
            "id": "004",
            "label": "4-6M",
            "availability": "in_stock"
          },
          {
            "id": "005",
            "label": "6-9M",
            "availability": "in_stock"
          },
          {
            "id": "006",
            "label": "9-12M",
            "availability": "in_stock"
          }
        ],
        "in_stock": true,
        "coming_soon": false,
        "category_code": "kids_baby_boy_clothing_trousersjeans_jeans",
        "is_new": false,
        "is_multipack": false,
        "has_video": false
      },
      {
        "article_id": "1342508003",
        "name": "Stretch Jeans",
        "brand": "H&M",
        "url": "https://www2.hm.com/en_us/productpage.1342508003.html",
        "image_url": "https://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg",
        "model_image_url": "https://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg",
        "images": [
          {
            "url": "https://image.hm.com/assets/hm/e8/f2/e8f2066c01884c398ea3e41e2529c5fcbdd3cbcd.jpg",
            "type": "DescriptiveDetail"
          },
          {
            "url": "https://image.hm.com/assets/hm/2b/53/2b530a1bc3af44edb9ad868ff73a008120345e47.jpg",
            "type": "DescriptiveDetail"
          }
        ],
        "price": 9.99,
        "currency": "USD",
        "member_price": 8.49,
        "colour": "Dark gray",
        "colour_code": "272627",
        "colour_shades": [
          "Charcoal"
        ],
        "colours": [
          {
            "article_id": "1342508003",
            "name": "Dark gray",
            "code": "272627",
            "image_url": "https://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508003.html"
          },
          {
            "article_id": "1342508001",
            "name": "Dark denim blue",
            "code": "79829D",
            "image_url": "https://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508001.html"
          },
          {
            "article_id": "1342508002",
            "name": "Light denim blue",
            "code": "80AAD8",
            "image_url": "https://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg",
            "url": "https://www2.hm.com/en_us/productpage.1342508002.html"
          }
        ],
        "sizes": [
          {
            "id": "004",
            "label": "4-6M",
            "availability": "in_stock"
          },
          {
            "id": "005",
            "label": "6-9M",
            "availability": "in_stock"
          },
          {
            "id": "006",
            "label": "9-12M",
            "availability": "in_stock"
          }
        ],
        "in_stock": true,
        "coming_soon": false,
        "category_code": "kids_baby_boy_clothing_trousersjeans_jeans",
        "is_new": false,
        "is_multipack": false,
        "has_video": false
      }
    ],
    "sort_options": [
      {
        "id": "RELEVANCE",
        "label": "Relevance"
      },
      {
        "id": "NEWEST_FIRST",
        "label": "New"
      },
      {
        "id": "PRICE_ASCENDING",
        "label": "Lowest price"
      }
    ],
    "filters": [
      {
        "id": "colorWithNames",
        "name": "ColorWithNames",
        "values": [
          {
            "value": "beige_f5f5dc",
            "count": 32
          },
          {
            "value": "black_000000",
            "count": 175
          },
          {
            "value": "blue_0000ff",
            "count": 833
          }
        ]
      },
      {
        "id": "garmentLengths",
        "name": "GarmentLengths",
        "values": [
          {
            "value": "Ankle-length",
            "count": 119
          },
          {
            "value": "Extra-long legs",
            "count": 52
          },
          {
            "value": "Long",
            "count": 1148
          }
        ]
      },
      {
        "id": "clothingStyles",
        "name": "ClothingStyles",
        "values": [
          {
            "value": "Baggy",
            "count": 133
          },
          {
            "value": "Balloon Leg",
            "count": 49
          },
          {
            "value": "Barrel Leg",
            "count": 135
          }
        ]
      }
    ],
    "suggestions": [
      "jeans",
      "jeans women",
      "jeans men"
    ]
  },
  "meta": {
    "endpoint_family": "search",
    "request_id": "req_e45b859bc93548db892a1c14c56d9f7b",
    "credits_charged": 1,
    "credits_remaining": 1925
  }
}
200 OKJSONX-Credits-Used: 1
Recorded from our API and shortened.

Sample data

What one call returns

A recorded run of search: the fields and shapes you will get, shortened to 3 items.

#article_idstringnamestringbrandstringurlurlimage_urlurlmodel_image_urlurlimagesobject[]pricenumbercurrencystringmember_pricenumbercolourstringcolour_codestringcolour_shadesstring[]coloursobject[]sizesobject[]in_stockbooleancoming_soonbooleancategory_codestringis_newbooleanis_multipackbooleanhas_videoboolean
11342508001Stretch JeansH&Mhttps://www2.hm.com/en_us/productpage.1342508001.htmlhttps://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpghttps://image.hm.com/assets/hm/20/a9/20a9f743b1d23f1c732f1fbc1886d5bcd4ad3f15.jpg[2 items]9.99USD8.49Dark denim blue79829D[3 items][3 items][3 items]truefalsekids_baby_boy_clothing_trousersjeans_jeansfalsefalsefalse
21342508002Stretch JeansH&Mhttps://www2.hm.com/en_us/productpage.1342508002.htmlhttps://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpghttps://image.hm.com/assets/hm/c8/02/c8020aa134dae2fce4f920e37714b019dfc4cb21.jpg[2 items]9.99USD8.49Light denim blue80AAD8[3 items][3 items][3 items]truefalsekids_baby_boy_clothing_trousersjeans_jeansfalsefalsefalse
31342508003Stretch JeansH&Mhttps://www2.hm.com/en_us/productpage.1342508003.htmlhttps://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpghttps://image.hm.com/assets/hm/f0/5d/f05dcec43d096118ea7d6e9a43453e372dedd392.jpg[2 items]9.99USD8.49Dark gray272627[1 item][3 items][3 items]truefalsekids_baby_boy_clothing_trousersjeans_jeansfalsefalsefalse

Recorded from our API · 3 items shown · 21 datapoints per itemGET /v1/hm/search?query=jeans&locale=en_us&sort=PRICE_ASCENDING

21 datapoints

Identity

  • article_idstring
  • namestring
  • brandstring
  • category_codestring

Contact

  • urlurl
  • image_urlurl
  • model_image_urlurl

Reputation

  • imagesobject[]

Price

  • pricenumber
  • currencystring
  • member_pricenumber

Other

  • colourstring
  • colour_codestring
  • colour_shadesstring[]
  • coloursobject[]
  • sizesobject[]
  • in_stockboolean
  • coming_soonboolean
  • is_newboolean
  • is_multipackboolean
  • has_videoboolean

Playground

Run this API

cURLshell
curl "https://api.perceptlayer.com/v1/hm/search?query=jeans&locale=en_us&sort=PRICE_ASCENDING" \
  -H "X-API-Key: $API_KEY"

H&M · 2 endpoints

Endpoints

Every endpoint takes the same key. Open one for its parameters and an example request.

EndpointRequired parametersCost
GET/v1/hm/product
none+3 optional
1 credit
GET/v1/hm/search
none+6 optional
1 credit

Overview

About the H&M API

What you can get

The H&M API returns H&M shop data as JSON through 2 endpoints. Both take a locale (en_us, de_de, en_gb, fr_fr, sv_se, en_in, pl_pl or es_es).

  • Search: search takes a query or a category, with page, sort (RELEVANCE, NEWEST_FIRST, PRICE_ASCENDING or PRICE_DESCENDING) and filters.
  • Products: product takes an article_id or a product url.

The recorded search for "jeans" in en_us, sorted by PRICE_ASCENDING, returns items, each with article_id, name, brand, url, image_url, price, currency, member_price, colour, colours, sizes, in_stock, coming_soon, category_code and is_new. It also returns total (1335 in that recording), total_pages, sort_options, filters and suggestions.

How a call works

Search a locale, then look up: GET /v1/hm/search?query=jeans&locale=en_us&sort=PRICE_ASCENDING with your key in the X-API-Key header. Each result carries an article_id; product takes that article_id. Every successful call costs 1 credit; failed calls cost nothing.

MarketplacesJSONRESTMCP

More marketplaces APIs

Use cases

Track H&M prices and member prices for a product list

Use the H&M API to track H&M prices and member prices for a product list

Compare one article's price across the eight locales

Use the H&M API to compare one article's price across the eight locales

Watch stock and coming-soon items for a query

Use the H&M API to watch stock and coming-soon items for a query

Follow new arrivals with `sort=NEWEST_FIRST`

Use the H&M API to follow new arrivals with `sort=NEWEST_FIRST`

FAQ

Questions

How much does the H&M API cost?

Each successful call costs one credit, and each search page is one call. New accounts get free credits to start, and credit packs bring the price down as you scale.

Which H&M markets can I query?

Eight locales: en_us, de_de, en_gb, fr_fr, sv_se, en_in, pl_pl and es_es, set with `locale`.

Do I need an H&M account?

No. You call this H&M API with your Perceptlayer key in the `X-API-Key` header, with no H&M login.

What format are responses in?

Every endpoint returns JSON, with no HTML parsing on your side.

Should I build a H&M scraper instead?

You can, but a H&M scraper is code you maintain: page changes break it, requests get blocked, and H&M's terms govern how you collect data. The H&M API gives you 2 endpoints of named JSON fields for 1 credit per successful call, and failed calls cost nothing. A scraper makes sense only for data these endpoints don't return, so check the response in the playground on this page first.

Try the H&M API with 100 free credits

No credit card. Failed calls are never billed.