DevelopersDocsGuides
Filters
Search and random request fields, defaults, and the combinations the API rejects.
On this page
Search and random do not share a body. Search takes { filters, selection }. Random takes a flat mathematics body. A field that works for mathematics is not automatically available for every subject.
Search fields
| Field | Required | Bounds and default |
|---|---|---|
| filters.subject | No | One slug. Omit both subject and subjects to search mathematics. Cannot be combined with subjects. |
| filters.subjects | No | 1–5 unique slugs. |
| filters.topics | No | Up to 20 slugs. A slug matches a whole path segment, so number_theory matches a longer topic path. |
| filters.topic_match | No | any (default) or all. all needs at least one topic. |
| filters.rating | No | Mathematics only. { "min", "max" } or { "target", "tolerance" }, not both. Integers. Target 400–4000, tolerance 0–2000. Omitted means 400–4000. |
| filters.rating_confidence | No | Mathematics only. Any of empirical, high, medium, low. |
| filters.level_bands | No | primary, junior, intermediate, senior, adult. |
| filters.competitions | No | Up to 20 competition slugs. |
| filters.competition_year | No | { "min" } and/or { "max" }, integers from 1900 to 2100. This is the paper year. |
| filters.paper_codes | No | Up to 20 codes, 1–40 characters each. |
| filters.answer_formats | No | multiple_choice, numeric, text, proof. |
| filters.text_only | No | true excludes problems that require a diagram, embed an image, or have a statement image. Audit crops are not treated as diagrams. |
| filters.exclude_ids | No | Up to 200 UUIDs from earlier responses. |
| selection.strategy | No | random (default) or difficulty_ordered. diverse is rejected. |
| selection.limit | No | Whole number 1–10, default 1. Also capped by the key’s max_problems_per_request. |
Rejected filters
school_year,year_group,age, andage_suitabilityare unsupported. No age classification is stored.languageandlocaleare unsupported. Statements have no language tag.solutionsandinclude_solutionsare unsupported. Answers are not returned.difficulty_starsis unsupported. Use Maths Rating for mathematics.verified_onlyis unsupported. Retrieval already requires a published statement, and an allowlist.expressionis not an answer format. Usetextfor free text.- A rating filter on an unrated subject, or on a mix that includes an unrated subject, is unsupported.
difficulty_orderedis unsupported when none of the requested subjects has a rating scale.
Random fields
POST /api/v1/problems/random draws mathematics only. difficulty and tolerance are required. A subject field, or any other field outside the table below, is ignored. The body is flat:
| Field | Required | Bounds |
|---|---|---|
| difficulty | Yes | Integer 400–4000, Maths Rating. |
| tolerance | Yes | Integer 0–2000. The accepted band is difficulty ± tolerance, clamped to 400–4000. |
| topic | No | One topic slug. |
| text_only | No | true or false. |
| exclude_ids | No | Up to 200 UUIDs. |
{ : , : , : true}