---
title: "Compare the market distribution now vs N weeks ago"
method: POST
path: "/v1/rate-delta"
tags: ["Data & Analytics"]
---

# Compare the market distribution now vs N weeks ago

`POST /v1/rate-delta`

## Request

- Base URL: `https://api.rateapi.dev`
- URL: `https://api.rateapi.dev/v1/rate-delta`
- Auth: API key in header `X-API-Key`

Compares the live market APR distribution now vs ~1/2/4 weeks ago using historical scraped_at windows (bounded by data retention). Returns min/median/max/count/as_of for each window and the median + min deltas with a down/up/flat direction. Raw historical movement only — see `/v1/buy-timing` for a forward lock-vs-wait recommendation. This route is the single source of truth; the MCP `rate_delta` tool calls it.

**Authentication required**: Pass your API key in the `X-API-Key` header.

## Request body

- object
  - `product_type` 'auto_loan' | 'mortgage' | 'heloc' | 'personal_loan' | 'student_loan' | 'credit_card', required: Loan or deposit product this applies to.
  - `state` string, required: 2-letter US state code
  - `since` '1w' | '2w' | '4w': Comparison window. Defaults to 1w.

## Response `200`

Market distribution comparison across the two windows. Degrades to a note when history is thin.

- object
  - `product_type` string: Loan or deposit product this applies to.
  - `state` string: Two-letter US state code.
  - `window` string: How far back the comparison reaches, as the `since` value used.
  - `now` object: APR spread across the matching offers today.
    - `min` number: Lowest APR today.
    - `median` number: Median APR today.
    - `max` number: Highest APR today.
    - `count` integer: How many offers today’s figures were computed from.
    - `as_of` string, nullable: When the underlying rates were published.
  - `then` object: APR spread across the matching offers at the start of the window.
    - `min` number: Lowest APR at the start of the window.
    - `median` number: Median APR at the start of the window.
    - `max` number: Highest APR at the start of the window.
    - `count` integer: How many offers the earlier figures were computed from.
    - `as_of` string, nullable: When the underlying rates were published.
  - `change` object: How the market moved between the two points.
    - `median_delta_pct` number: Change in median APR, in percentage points. Negative means rates eased.
    - `min_delta` number: Change in the lowest available APR, in percentage points. Negative means the best offer improved.
    - `direction` 'down' | 'up' | 'flat': Which way the value moved over the window.
  - `note` string: Plain-language explanation of what this result means.

## Other responses

- `400`: The request was malformed — a missing required field, an unparseable body, or a parameter outside its allowed range. The `error` field names what was wrong; retrying the identical request will fail identically.
- `401`: No API key, or a key that is unknown or disabled. Send it in the `X-API-Key` header. Free keys are issued instantly by POST /keys with an email address. The response carries `WWW-Authenticate` pointing at this host's protected-resource metadata, and the `RateLimit-*` headers describing the Free-tier budget a key issued now would carry (scope `anonymous`) — a rejected request spends none of it, so `Remaining` equals `Limit`.
- `429`: Quota exhausted for the current window. `Retry-After` gives the seconds to wait; `upgradeInfo` explains how to lift the cap. Retrying before the reset will fail again and still counts as a request.

---

[API](https://skmtc.dev/rateapi/apis/rate-api.md) · [All operations](https://skmtc.dev/rateapi/apis/rate-api/llms.txt) · [OpenAPI document](https://skmtc.dev/rateapi/apis/rate-api/revisions/06a6db76995f?raw)
