Rates API
API Reference

Core Concepts

Understand identifiers, dates, data freshness, errors, CORS, OpenAPI behavior, and AI integration surfaces.

Data Freshness

Rates API stores the latest scraped dataset and historical snapshots in Cloudflare D1. The scheduled scraping workflow runs hourly. The /api/v1/health endpoint reports the latest available timestamp for each dataset.

curl https://ratesapi.nz/api/v1/health

Identifiers

Use IDs returned by list endpoints when calling detail or time-series endpoints.

IdentifierUsed byExample
institutionIdMortgage, personal loan, and car loan endpointsinstitution:anz
issuerIdCredit card endpointsissuer:amex

Identifiers are intentionally stable enough for API routing and filtering, but product names and product availability can change when institutions update their public rate pages.

Current vs Historical Data

NeedUse
Current market dataList endpoints such as /api/v1/mortgage-rates
One institution or issuerDetail endpoints such as /api/v1/mortgage-rates/{institutionId}
One historical snapshotTime-series endpoint with date
Range for charts or analysisTime-series endpoint with startDate and endDate

Date Filtering

Time-series endpoints accept ISO calendar dates in YYYY-MM-DD format.

Use either date or the startDate and endDate pair. Do not combine a single date with a range.

RuleResult
date by itselfReturns a single snapshot
startDate and endDate togetherReturns a range
startDate without endDateInvalid request
endDate without startDateInvalid request
date with startDate or endDateInvalid request

Invalid query parameters return:

{
  "code": 400,
  "message": "Invalid request parameters"
}

Request IDs

Every response includes x-request-id. If a client sends x-request-id, the API returns the same value. Otherwise, the API generates one.

CORS

Public /api/v1/* endpoints allow any origin and return access-control-max-age: 600 for preflight requests.

AI Integration Surfaces

Rates API is designed to be consumed by both traditional applications and AI agents.

SurfacePurpose
POST /api/v1/mcpMCP endpoint for tool discovery and tool calls
/openapi/jsonMachine-readable REST contract for SDKs and tool generation
/llms.txtPlain-text documentation feed for assistants and retrieval pipelines
/api/v1/*Stable JSON data endpoints for direct tool calls

For MCP clients, listChanged: false means the server's tool list is stable for the current API version. It does not mean rates data is static.

OpenAPI

The interactive Scalar docs are available at /openapi, and the generated OpenAPI document is available at /openapi/json. The MCP route is intentionally excluded from the public OpenAPI paths.

On this page