Metrics

One data series' stored values over a range of days

Changed on

The stored values of one financial or economic data series over a range of days, oldest first, read with a key. Values only: the trend, percentile and context of the newest reading are at GET /api/metrics/{metric}.

A value is served only where its own source allows it to be passed on. Each source is named once in sources, with its answer (display: yes or notice) and the notice its terms ask for. served_from is the first date served. A series whose values its sources do not allow to be passed on is answered 404.

as_of serves only what was public by the end of that day (23:59:59 UTC), and gives each value its known_since and known_basis, as a dated briefing does. A series its source revises is served as stored, with note saying so.

interval=week or interval=month gives each period's last stored reading, never an average. One answer carries at most 5,000 values, and next_from names the from that reads on.

History by plan: Basic the last 3 years, Pro and above every stored date. A key that reads only a metric's latest reading at GET /api/metrics/{metric} reads none of its history. There is no pay per call price for this route.

get/api/metrics/{metric}/history

Request

  • Base URL
    https://api.prereason.com
  • Auth
    • HTTP bearer
    • or API key in header X-API-Key

Path parameters

metricstring required
Example:treasury-10y

Metric identifier, as GET /api/metrics lists it

Query parameters

fromstring
Example:2025-01-02

First day (YYYY-MM-DD). Defaults to a year before to, or the first day your plan reads if that is later.

tostring
Example:2026-10-23

Last day (YYYY-MM-DD), the whole day. Defaults to now.

as_ofstring
Example:2026-06-30

Serve only what was public by the end of this day (YYYY-MM-DD). The range ends at this day.

interval'day' | 'week' | 'month'

Every stored day, or each week's (from Monday, UTC) or month's last stored reading.

Response

The series' served values in the range

metricstring
display_namestring
fromstring
tostring
as_ofstring

On a dated read only.

as_of_cutoffstring

On a dated read only, the instant nothing published after is served.

intervalstring
served_fromstring

The first date served. Absent when the range has no value.

countinteger
next_fromstring

Present when more values remain; pass it as from to read on.

display'yes' | 'notice'

The most restricted answer of the sources served.

notestring

On a series its source revises.

Example response

{
  "metric": "treasury-10y",
  "display_name": "10-Year Treasury",
  "from": "2025-01-02",
  "to": "2026-10-23",
  "as_of": "2026-06-30",
  "as_of_cutoff": "2026-06-30T23:59:59.000Z",
  "interval": "day",
  "served_from": "2025-01-02",
  "count": 452,
  "next_from": "2026-11-01",
  "data": [
    {
      "date": "2026-10-23",
      "value": 4.02
    }
  ]
}

Changes