H&M category listing
Products of one H&M category in one market (locale such as en_us, en_gb, de_de), with sort, facet filters and paging. Each product has the same fields as /hm/v1/search: article id, name, brand, price, regular price and sale flag, colour, category, availability, markers, sizes with stock levels, other colours, link, images and raw. Also the sort options and facets (each with its filter values, counts and whether it is selected). Pass next_page back as page; null on the last page. An unknown category answers 404.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
categoryrequired | string | The site's category id, e.g. men_tshirtstanks, ladies_dresses, ladies_jeans, men_shoes. Example: men_tshirtstanks |
locale | string | Market and language as in hm.com links: en_us (default), en_gb, de_de, fr_fr, sv_se, ... Example: en_us |
sort | relevance | newest | price_asc | price_desc | relevance (default), newest, price_asc, price_desc. |
filter | string | A facet filter facet:value from facets[].values[].value, e.g. colorWithNames:black_000000 or fits:Muscle fit. Repeat the parameter (or join with ||) for several, up to 10. |
page | integer | Page number (default 1). |
page_size | integer | Products per page (default 36, max 100). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/hm/v1/category?category=men_tshirtstanks" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/hm/v1/category",
params={"category": "men_tshirtstanks"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/hm/v1/category");
url.searchParams.set("category", "men_tshirtstanks");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).