> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# Get a product category by slug

**Published**: 2026-11-30
**Category**: Commerce

## `GET /product-categories/:slug`

**Get a product category by slug**

Returns one visible product category by its slug, with `structuredData.graph`, the
page's JSON-LD graph. Its `ItemList` holds the first 20 published products of the
category and its visible subcategories, newest first, without those hidden in the
served language or in `market`. A subcategory also gets a `BreadcrumbList`.

With `locale`, the slug can also be the translated slug, and the category is served in
the requested locale or its fallback chain: base language, site default locale, then
its own language.

Errors: 404 `PRODUCT_CATEGORY_NOT_FOUND` for an unknown or hidden category. The slug
`tree` reaches the tree read instead.

> **Note:** Available only on sites with e-commerce enabled.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `slug` | path | string | Yes | Product category slug, unique per site |
| `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") |
| `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it |
| `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out of `structuredData`. Unknown, draft or malformed values are ignored |


### Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
| `401` | Missing or invalid storefront publishable key |
| `402` | The site subscription does not currently permit this operation |
| `403` | The storefront key origin is not allowed |
| `404` | Not found |
| `422` | Validation error |


> **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit
> bucket: general.

### SDK

```typescript
import { createClient } from 'lynkow'

const lynkow = createClient({
  siteId: process.env.LYNKOW_SITE_ID!,
  publishableKey: process.env.LYNKOW_PK,
})

import { renderJsonLdGraph } from 'lynkow'

const category = await lynkow.productCategories.getBySlug('kitchen', { locale: 'fr' })
// <div dangerouslySetInnerHTML={{ __html: renderJsonLdGraph(category.structuredData?.graph) }} />
```

### Examples

```curl
curl "https://api.lynkow.com/storefront/{siteId}/product-categories/shirts" \
  -H "X-Lynkow-Pk: lkw_pk_..."
```

```javascript
const res = await fetch(
  `https://api.lynkow.com/storefront/${siteId}/product-categories/shirts`,
  { headers: { 'X-Lynkow-Pk': publishableKey } }
)
const { data } = await res.json()
// data.structuredData.graph is ready for an application/ld+json script
```

### Response Example

```json
{
  "data": {
    "id": "pcat_01j9pb3kq8w2x7h4m5n6c7d8e8",
    "slug": "shirts",
    "path": "/product-categories/shirts",
    "name": "Shirts",
    "description": "Every shirt of the catalogue.",
    "image": "https://cdn.lynkow.com/sites/acme/categories/shirts.jpg",
    "imageAlt": "Folded shirts",
    "position": 0,
    "seoTitle": null,
    "seoDescription": null,
    "keywords": null,
    "canonicalUrl": null,
    "ogTitle": null,
    "ogDescription": null,
    "ogImage": null,
    "ogImageAlt": null,
    "twitterCard": null,
    "noIndex": false,
    "noFollow": false,
    "structuredData": {
      "graph": [
        {
          "@context": "https://schema.org",
          "@id": "https://www.acme.io/product-categories/shirts#auto:collectionpage",
          "@type": "CollectionPage",
          "name": "Shirts",
          "inLanguage": "en",
          "description": "Every shirt of the catalogue.",
          "url": "https://www.acme.io/product-categories/shirts",
          "mainEntity": {
            "@type": "ItemList",
            "itemListElement": [
              {
                "@type": "ListItem",
                "position": 1,
                "url": "https://www.acme.io/products/linen-shirt",
                "name": "Linen shirt"
              }
            ]
          }
        }
      ]
    }
  }
}
```

---