---
title: "Get Exercise Counts By Category Path"
method: GET
path: "/public-exercises/counts-by-category-path"
tags: ["public_exercises"]
---

# Get Exercise Counts By Category Path

`GET /public-exercises/counts-by-category-path`

Return `{ "Grade / Chapter / Thematic": count }` for every distinct
`category_path` in the library (Legacy included). The key format is
`segments.join(" / ")` so the caller can build both chapter-level and
thematic-level badges in one round-trip:

  counts["Terminale / Probabilités"]              // chapter-level
  counts["Terminale / Probabilités / Loi binomiale"] // thematic-level

Chapter-level counts are rolled up by the caller from the thematic
entries (or read directly when an exercise is stored at chapter depth).

## Query parameters

- `subject` 'maths' | 'physique-chimie', nullable — Scope counts to a matière (see list endpoint).
- `type` string[], nullable — Restrict the counts to these exercise types. Repeat the param for each value. 'exercice' also covers 'application_du_cours' and rows written before the type field existed, matching what the picker grid shows. Omit (or pass every type) for no scoping.
- `origin` string[], nullable — Restrict the counts to these origins (excellence, saint_jean_hulst, lacordaire). Repeat the param for each value.
- `difficulty` string[], nullable — Restrict the counts to these difficulties.
- `savoirs_faire` string[], nullable — Restrict the counts to exercises tagged with at least one of these savoir-faire ids.

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

## Changes

- **2026-09-10** `da2adc76dec3` — 4 info
  - added the new optional `query` request parameter `difficulty`
  - added the new optional `query` request parameter `origin`
  - added the new optional `query` request parameter `savoirs_faire`
  - added the new optional `query` request parameter `type`

[Change history](https://skmtc.dev/excellence-ai/apis/excellence-learning/changes/public-exercises/counts-by-category-path/get.md)

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) · [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) · [OpenAPI document](https://skmtc.dev/excellence-ai/apis/excellence-learning/revisions/2a0c1636fd3b?raw)
