Rates API CLI
Get current and historical New Zealand mortgage, personal loan, car loan, and credit card rates as JSON from a shell or script.
Support this projectThe Rates API CLI calls the public REST API and writes JSON to standard output. It uses Node.js 22 or later and needs no API key.
Run from source
Clone the Rates API repository and run the CLI from its root.
node packages/cli/bin/ratesapi.js mortgage-rates --term-in-months 12
The package is prepared for npm as ratesapi-nz. Once it is published, the same command will be available through npm.
npm exec --package=ratesapi-nz -- ratesapi mortgage-rates --term-in-months 12
Commands
| Command | Result |
|---|---|
mortgage-rates | Fixed and floating mortgage rates |
personal-loan-rates | Personal loan rates |
car-loan-rates | Vehicle finance rates |
credit-card-rates | Credit card rates and fees |
health | API status and dataset freshness |
Use --id institution:anz or --id issuer:amex to select an item from a list response. Add --history to list available dates, --history --date 2025-03-08 for one UTC snapshot, or --history --start-date 2025-03-08 --end-date 2025-03-31 for an inclusive range. Run the CLI with --help to see all options.
Errors go to standard error. Exit status 1 means the request failed, and 2 means the CLI rejected the arguments. If the API throttles a request, the CLI prints the Retry-After value so the calling script can wait before retrying.
Last updated on
Rates API MCP Server
Connect AI agents to New Zealand mortgage and loan rates. Use the free MCP endpoint, the OpenAPI JSON for tool generation, and llms.txt.
Core Concepts
How Rates API collects New Zealand rates on a four-hour schedule, and how snapshots, lender IDs, date filters, freshness, and errors operate.