COS stock in stores
Which COS stores in a country have a product, and which sizes (stock level per size SKU), with each store's address, phone, coordinates and opening hours.
Every response includes credits_used: the credits this call cost.
Part of the COS API: 13 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
url | string | A cos.com product link (its locale sets the market and language), the product's uri (name-colour-<10-digit article>), or a 10-digit article number. Example: https://www.cos.com/de-ch/women/womenswear/knitwear/cardigans/cashmere/product/brushed-cashmere-crew-neck-cardigan-blue-1341040003 |
sku | string | 10-digit article number (one colour of a product), instead of url, e.g. 1341040003. |
store_country | string | Country of the stores, two letters (default: the market's country, US for eu/ww). |
market | string | Market: us (default), ca, gb, ie, de, at, ch, fr, es, it, nl, dk, no, se, pl, eu, eue, au, ww, or a site locale such as de-ch. Prices, currency and stock follow the market. country is accepted as the same thing. |
language | string | Language of names and texts, one the market offers (ch: de, en, fr; de: de, en; ca: en, fr; others their own). Default: the market's first language, or the link's. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/cos/v1/store-availability?url=https%3A%2F%2Fwww.cos.com%2Fde-ch%2Fwomen%2Fwomenswear%2Fknitwear%2Fcardigans%2Fcashmere%2Fproduct%2Fbrushed-cashmere-crew-neck-cardigan-blue-1341040003" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/cos/v1/store-availability",
params={"url": "https://www.cos.com/de-ch/women/womenswear/knitwear/cardigans/cashmere/product/brushed-cashmere-crew-neck-cardigan-blue-1341040003"},
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/cos/v1/store-availability");
url.searchParams.set("url", "https://www.cos.com/de-ch/women/womenswear/knitwear/cardigans/cashmere/product/brushed-cashmere-crew-neck-cardigan-blue-1341040003");
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).
Example response (real call, trimmed: lists cut to 2 items, long text shortened, raw left out)
{"market": "ch","store_country": "CH","sku": "1341040003","count": 5,"stores": [{"store_code": "CH0203","name": "Lausanne","address": "Rue de Bourg 8","city": "Lausanne","zip": "1003","country": "CH","phone": "+1 555 010 0000","latitude": 46.52005639251459,"longitude": 6.63448790560938,"opening_hours": [{"day": "Mo","opens": "10:00","closes": "18:30"},{"day": "Di","opens": "10:00","closes": "18:30"},"… 4 more"],"sizes": [{"sku": "1341040003006","stock_level": "few","stock": "low_on_stock"},{"sku": "1341040003003","stock_level": "few","stock": "low_on_stock"},"… 1 more"]},{"store_code": "CH0210","name": "Basel","address": "Freie Strasse 70","city": "Basel","zip": "4051","country": "CH","phone": "+1 555 010 0000","latitude": 47.55492130949796,"longitude": 7.59102763903957,"opening_hours": [{"day": "Mo","opens": "10:00","closes": "19:00"},{"day": "Di","opens": "10:00","closes": "19:00"},"… 4 more"],"sizes": [{"sku": "1341040003002","stock_level": "few","stock": "low_on_stock"},{"sku": "1341040003006","stock_level": "few","stock": "low_on_stock"},"… 3 more"]},"… 3 more"],"cached": false,"credits_used": 1}