---
title: "List Public Exercises"
method: GET
path: "/public-exercises"
tags: ["public_exercises"]
---

# List Public Exercises

`GET /public-exercises`

Retrieve public exercises from the DB with optional filtering.
Everyone with a valid token can see them.

- year: Optional year to filter by (e.g. premiere_fr)
- chapter: Optional chapter to filter by (e.g. derivation_chapitre)
- themes: Optional list of theme IDs to filter by (OR condition)
- difficulty: Optional difficulty tag ID to filter by (AND condition)
- chapter_tags: Optional list of chapter-specific tag IDs (AND condition)
- sequence_number: Optional sequence number to filter by
- smart: If True, use smart selection algorithm to select exercises
- count: Number of exercises to return when using smart selection

## Query parameters

- `year` string, nullable — Filter by year (e.g. premiere_fr)
- `chapter` string, nullable — Filter by chapter (e.g. derivation_chapitre)
- `themes` string[], nullable — Filter by theme IDs
- `difficulty` string, nullable — Filter by difficulty tag ID
- `chapter_tags` string[], nullable — Filter by chapter-specific tags (AND condition)
- `category_path` string[], nullable — Filter by category_path prefix. Repeat the query param for each segment, e.g. ?category_path=Terminale&category_path=Probabilités. When provided, skips the legacy themes/chapter_tags filters.
- `sequence_number` integer, nullable — Filter by exercise sequence number
- `subject` 'maths' | 'physique-chimie', nullable — Filter by matière. Defaults to the teacher's own subject; students pass their currently-selected subject. Admins see all when omitted.
- `smart` boolean, nullable — Use smart selection algorithm to select exercises
- `count` integer, nullable — Number of exercises to return when using smart selection

## Response `200`

Successful Response

- PublicExerciseOut[]
  - `id` string, required
  - `themes` string[], required
  - `content` string, required
  - `solution` string, required
  - `figure_content` string, nullable
  - `figure_solution` string, nullable
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `sequence_number` integer, nullable
  - `difficulty` string, nullable
  - `category_path` string[]
  - `subject` 'maths' | 'physique-chimie'
  - `diagnostic_info` DiagnosticInfoOut
    - `explanation` string, required
  - `library` 'excellence' | 'cpge' | 'remediation'
  - `type` 'exercice' | 'automatisme' | 'application_du_cours'
  - `cpge` RoutersPublicExercisesCpgeMetadata — CPGE-specific fields, present only when `library == "cpge"`. Grouped into a subdoc so that readers of a regular public exercise don't have to reason about hints / banque at all — those are genuinely prepa-only concerns.
    - `hints` string[]
    - `banque` string, nullable
  - `likes_count` integer
  - `savoirs_faire_ids` string[]
  - `title` string, nullable

## Other responses

- `422` — Validation Error

---

[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-service-production.skmtc.workers.dev/v1/apis/excellence-ai/excellence-learning/revisions/8d495ed916c6/schema)
