---
title: "LEARN almanac entries (optionally filtered by month/day)"
method: GET
path: "/api/learn/on-this-date"
tags: ["Education"]
---

# LEARN almanac entries (optionally filtered by month/day)

`GET /api/learn/on-this-date`

## Request

- Base URL: `https://www.oxfordledge.com` (the document declares no server; this is the origin it was published from)
- URL: `https://www.oxfordledge.com/api/learn/on-this-date`
- Auth: none declared

Return almanac entries as `{entries: [...]}`.

Behavior:
  - Both `month` and `day` provided: returns entries for that
    calendar date (uses `pg_get_learn_on_this_date_for`).
  - Neither provided: returns ALL entries (matches the pre-PR0
    contract — `app-renderers.ts:_renderOnThisDatePane` fetches
    the whole file and filters client-side). The whole-table
    sweep is bounded (~35 rows today, hundreds at most) so we
    stream it back rather than forcing the caller to specify
    month/day they don't have at fetch time.
  - Only one provided: ignored (returns full almanac) — narrower
    defensive than 400-ing; the caller's renderer already
    handles a too-broad result by filtering.

Falls back to the JSON file when PG is empty.

## Query parameters

- `month` integer, nullable: 1-12 month filter. Omit `month` AND `day` together for the full almanac (matches the pre-PR0 frontend fetch which filtered by month/day client-side).
- `day` integer, nullable: 1-31 day filter. Pair with `month`.

## Response `200`

Successful Response

- LearnDataOnThisDateResponse: `GET /api/learn/on-this-date` response. Returns `entries[]` for a given (month, day) — defaults to today's UTC date when the query params are absent. Pre-PR0 the frontend fetched the whole `on-this-date.json` and filtered client-side (Array.isArray(data) ? data : []). This endpoint returns ALL entries (matching that filter-client-side contract) so the renderer keeps its existing month/day filter logic and the response is shape-compatible.
  - `entries` unknown[], required
    - unknown

## Other responses

- `422`: Validation Error
- `500`: Internal Server Error

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
