LocusAPI
Problems API / Reference
GET

/public/problems

Fetch a batch of problems matching your filters.

Base
https://api.locusmath.org/public
Auth
x-api-key header (or Authorization: Bearer)
Billing
One request per problem served - count=5 bills 5. The grade and optional help video are included.
curl "https://api.locusmath.org/public/problems?topic=calculus&skill=chain_rule&difficulty_min=1000&difficulty_max=1400&type=plain&count=3" \
  -H "x-api-key: <your-key>"

Query parameters

ParamDescription
topicCourse slug, e.g. algebra_1. See list topics. Unset = any.
skillSkill slug within the topic, e.g. chain_rule.
difficulty_min, difficulty_maxInclusive ELO band, 800-2200. Defaults to the full range.
calculatornone | scientific | graphing | cas.
typemultiple_choice | widget | plain - the answer-input family. Unknown value = 400.
countBatch size (default 10, clamped to the batch max).
videostrue opts into help-video enrichment (below). Default off.

Response

An array of problems. statement is LaTeX; input describes the answer widget to render (choices, number line, free entry, ...) with all grading information stripped. The submission_token is a signed, 31-day token you pass to grade - answers themselves never appear in any response.

[
  {
    "id": "7c9e6679-7425-40de-963d-...",
    "statement": "Find \\frac{d}{dx}\\left(\\sin(3x^2)\\right)",
    "difficulty": 1180,
    "topic": "calculus",
    "skill": "chain_rule",
    "calculator_allowed": "none",
    "input": { "widget": "math", "...": "display params, no answers" },
    "submission_token": "<opaque signed token>"
  }
]

Help-video enrichment (videos=true)

With videos=true the response becomes an object: problems plus a deduplicated videos map. Each problem whose skill has a curated explainer video carries a small integer video ref into that map; problems sharing a skill share one entry. Skills without a curated video simply omit the field.

// GET /public/problems?topic=calculus&videos=true
{
  "problems": [
    { "id": "...", "skill": "chain_rule", "video": 1, "...": "..." },
    { "id": "...", "skill": "chain_rule", "video": 1, "...": "..." },
    { "id": "...", "skill": "product_rule", "...": "no video curated" }
  ],
  "videos": {
    "1": "https://www.youtube.com/watch?v=eF6zYNzlZKQ"
  }
}