Macy's category
The products of a Macy's (US) category page: name, brand, regular and sale price, percent off, promotions, rating and review count, colors, availability and images, about 60 per page, plus the category (name, link, parent, top level, breadcrumbs, description), the filter facets with counts, the sort options and related categories. Pass next_page back as page; it is null on the last page. Filter with filter=Facet:value values copied from facets[].values[].filter; repeat filter for several facets or several values of one facet.
Every response includes credits_used: the credits this call cost.
Parameters
| name | type | description |
|---|---|---|
url | string | A macys.com/shop/... category link with its ?id=, or pass id. Example: https://www.macys.com/shop/womens/clothing/dresses?id=5449 |
id | string | Numeric category id (the id= in the category link) instead of url. |
page | integer | Page number. Pass next_page from the previous response; next_page is null on the last page. |
sort | featured | price_asc | price_desc | top_rated | best_sellers | new | |
filter | string | A facet value as Facet:value, copied from facets[].values[].filter (for example Brand:Calvin Klein, Color_normal:Black). Repeat the parameter for more filters (up to 10). |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/macys/v1/category?url=https%3A%2F%2Fwww.macys.com%2Fshop%2Fwomens%2Fclothing%2Fdresses%3Fid%3D5449" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/macys/v1/category",
params={"url": "https://www.macys.com/shop/womens/clothing/dresses?id=5449"},
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/macys/v1/category");
url.searchParams.set("url", "https://www.macys.com/shop/womens/clothing/dresses?id=5449");
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).