Skip to main content
Returns all published categories and the catalog timestamp. Data is sourced from cms/catalog.json, which is generated by the SharePoint sync script at build time and refreshed via ISR at runtime. Method: GET
Path: /api/categorias
Caching: SWR 300 s (5 minutes)
This route is covered by the "/api/categorias/**": { swr: 300 } rule in nuxt.config.ts. Responses are served stale while Nitro revalidates in the background every 5 minutes.

Response

200 OK

categories
object[]
required
Array of published category objects.
updatedAt
string | null
required
ISO 8601 timestamp of when the catalog was last synced from SharePoint. null if the catalog has never been synced.

Example

curl https://reprodisseny.com/api/categorias
{
  "categories": [
    {
      "id": "12",
      "slug": "gran-formato",
      "path": "/categorias/gran-formato",
      "type": "categoria",
      "title": "Gran Formato",
      "nav": "Gran Formato",
      "order": 1,
      "hidden": false,
      "featured": true,
      "isPublished": true,
      "description": "Impresión de gran formato para espacios interiores y exteriores.",
      "image": {
        "src": "https://webcms.blob.core.windows.net/media/categories/gran-formato.jpg",
        "width": 1200,
        "height": 630,
        "alt": "Gran Formato"
      },
      "seo": {
        "metaTitle": "Gran Formato · Reprodisseny",
        "metaDescription": "Impresión profesional de gran formato en Barcelona.",
        "canonical": "https://reprodisseny.com/categorias/gran-formato"
      },
      "tabs": [],
      "faqs": [],
      "updatedAt": "2026-03-10T09:15:00Z"
    }
  ],
  "updatedAt": "2026-03-18T06:00:00Z"
}
For menu rendering, use the companion navigation endpoint: GET /api/nav/categorias This endpoint returns a tree structure with children arrays and an indexBySlug map, optimised for building nested navigation menus. It accepts a productLimit query parameter (1–12, default 8) to include a limited product list per category node.
// composables/useCategoriasNav.ts
export function useCategoriasNav(opts: { productLimit?: number } = {}) {
  return useFetch<{ tree: CategoriaNode[]; indexBySlug: Record<string, CategoriaNode>; menuItems: CategoriaNode[] }>(
    "/api/nav/categorias",
    { query: { productLimit: opts.productLimit ?? 8 } }
  )
}

Build docs developers (and LLMs) love