Free Calculator API

He JSON API wātea hoki ia tātaitai i tēnei pae. Kāore he whakaingoatanga, kāore he kī API, CORS-enabled — e kī ana i te mea mai i tōmu pūnaha, mai i te whakataki rānei.

Whakamāramatanga

Ka haere te API ki te pāngarau ōrite tonu e whakamahia ana e te whare wānanga. Ka tukuna ngā uara āpure o te tātaitai hei tohutoro, hei tauwaenga JSON rānei, ā, ka whiwhi i ngā hua tātaitai anō hei JSON — tae atu ki ngā rārangi whakawhāiti, ki ngā raraunga mahere rānei e whakaputaina ana e te tātaitai.

  • 198+ ngā tātaitai, he tōna ake wāhi mutunga ko ia
  • Kāore he kī API — Ka uru ki te IP te uru ki te IP
  • CORSAccess-Control-Allow-Origin: * (Ka taea te whakamahi te taha o te kaitautoko)
  • Te tepe o te mokatere: 60 tono/ora ia IP (HTTP 429 ina hipa)
  • Errors are free — only a successful (2xx) response uses one call from your monthly quota. Every 400, 401, 404, 429 and 500 costs you nothing.

URL taketake

https://calculator.free/api/v1/

Taupū - whakarārangia tātaitai

GET https://calculator.free/api/v1/

Ka hoki mai he rārangi pūrere-mātauranga o ngā tātaitai katoa me ia āpure (pātaka, tohu, momo, pūmau, wae) me ngā pātū hua - e tika ana kia hanga i tētahi kaiwhakahaere. Each field also carries a required flag — true for the few fields that have no default (dates, mostly). Send those: a couple of calculators can infer one, the rest answer 400 without it.

Tātaitai — whakarewa i tētahi tātaitai

GET  https://calculator.free/api/v1/<slug>/?field=value&field=value
POST https://calculator.free/api/v1/<slug>/     (JSON or form body)

He hanga urupare:

{
  "ok": true,
  "slug": "mortgage",
  "country": "us",
  "inputs":   { ... the values actually computed with ... },
  "results":  { ... computed result keys ... },
  "schedule": { "columns": [...], "rows": [...] } | null,
  "chart":    { "type": "pie", "slices": [...] } | null,
  "defaults_applied": ["tax", "insurance"]
}

Ka whakaaetia e ngā tātaitai mātauranga whenua (whakahaere, whakawhiwhinga, tāke moni whiwhi, tāke hokonga...) ?country=us|uk|ca|au|in|ie|nz|za. Ka hoki te pūngāwhā kāore i mōhiotia ki te 404; ko te whenua kāore i tautokona, ko te tāuru kino rānei e hoki ana ki te 400 me tētahi karere whai hua me te āpure tauwhāiti.

Parameters, defaults and errors

Send only the fields you care about. Anything you leave out is filled with that field's published default — the same value the calculator page pre-fills, so the API and the website always return the same numbers for the same inputs. Each response lists what it filled in under defaults_applied.

Anything the API cannot resolve honestly is an error, never a zero: a misspelled parameter, a value of the wrong type, an unknown dropdown option, or a missing field that has no default (the date fields — a birth date cannot be guessed). Every 400 names the offending parameter and echoes the full field spec so a client can correct itself.

$ curl "https://calculator.free/api/v1/mortgage/?price=350000&rate=6.5&term=30"
{
  "ok": false,
  "error": "unknown_parameter",
  "message": "Unknown parameter 'term' for calculator 'mortgage'. Did you mean 'years'? ...",
  "unknown_parameters": ["term"],
  "did_you_mean": { "term": "years" },
  "valid_parameters": ["down", "extra", "extra_onetime", "extra_yearly", "hoa",
                       "insurance", "other", "pmi", "price", "rate", "tax", "years"],
  "fields": [ ... ]
}
errorHTTPWhen
unknown_parameter400a parameter that is not a field of this calculator (with a did-you-mean suggestion)
invalid_value400a number field that is not a number, a dropdown value outside its options, an unparseable date, or an unknown _mode
missing_parameter400the calculator produced no result because a field with no default was left empty
unsupported_country400?country= is not one this calculator has data for
bad_json400the POST body is not valid JSON
unknown_calculator404no calculator with that slug
invalid_key401an API key was sent but is unknown or inactive
rate_limited / quota_exceeded429the anonymous hourly IP limit, or a key's monthly quota, is used up
too_many_invalid_requests429too many rejected requests in one hour for this key — rejected calls are free, so they are rate-limited instead. Resets hourly; successful calls never count towards it.

The /api/v1/ index publishes every field's key, type, unit, default and whether it is required — enough to build a client that never guesses.

Whakatuhi me ngā mahere

Ka taea e koe te whakarongo ki te API me te kore pātū - ko ngā tono ā-whakaahua e whakawhāititia ana e IP. Mō tētahi utu tiketike ake, mō tētahi utu mānawa (me te whakamahinga hokohoko), hanga i tētahi pātū i runga i tōmu pātū kāwanatanga, ā, ka tukuna ki tētahi o ngā ara e toru:

GET  https://calculator.free/api/v1/mortgage/?price=350000&key=YOUR_KEY
curl -H "Authorization: Bearer YOUR_KEY" "https://calculator.free/api/v1/bmi/?units=metric&height=180&weight=80"
curl -H "X-Api-Key: YOUR_KEY"           "https://calculator.free/api/v1/bmi/?units=metric&height=180&weight=80"
  • Waihoki — Kāore i te mōhiotia (IP-rate-limited), he kī wātea rānei me tētahi whāititanga marama. Kāore i te hokohoko.
  • Kaihanga &mdash; $9/mo — 10,000 ngā whakarongo/whā, whakamahinga hokohoko.
  • Kauhanga &mdash; $49/whā — 100,000 ngā whakarongo/whā, te tūpāpaku o te tūpāpaku.

What counts against your quota

Only a successful response does. One 2xx = one call. Every error is free: a 400 for a misspelled parameter, a bad value or a missing required field, a 404 for an unknown slug, a 401 for a bad key, a 429, and anything that goes wrong on our side. Explore the contract and fix your request as many times as you need — you are billed for answers, not for corrections.

Because errors are free they are rate-limited instead: if one key provokes more than 200 rejected responses in an hour, it gets HTTP 429 "too_many_invalid_requests" until the hour rolls over. Successful calls never count towards that, so a working integration will never see it — it only catches a client stuck in a retry loop.

Ki te whakamahia te utu o te pouaka i te marama, ka hoki mai te API HTTP 429 me te hapa "quota_exceeded"; he pūtau kore mōhiotia, kāore rānei i te hoatu HTTP 401. Tirohia ngā mahere katoa me te whakaingoa ki te Whakataurite te pātaka.

Hei tauira

curl

curl "https://calculator.free/api/v1/mortgage/?price=350000&down=70000&rate=6.9&years=30"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/bmi/?" + new URLSearchParams({
    units: "metric", height: "180", weight: "80"
  }));
const { results } = await r.json();
console.log(results.bmi, results.category);

Python

import requests

r = requests.get("https://calculator.free/api/v1/mortgage/",
                 params={"price": 350000, "down": 70000,
                         "rate": 6.9, "years": 30},
                 headers={"Authorization": "Bearer YOUR_KEY"})
print(r.json()["results"])

POST JSON

curl -X POST "https://calculator.free/api/v1/income-tax/?country=uk" \
  -H "Content-Type: application/json" \
  -d '{"income": 60000}'

Ko ngā pito mutunga katoa

Ko tētahi pito mutunga i ia tātaitai. Ko ngā pātū āpure me ngā pātū hua mō ia i roto i te /api/v1/ Taupū.

Motika (41)
KātaitaiWhakamutunga
Kātaitai tātaitai /api/v1/mortgage/
Kātaitai ā-whakahaere /api/v1/loan/
Kaitirotiro ā-whakahaere /api/v1/compound-interest/
Te tātaitai tōtika o te hua /api/v1/simple-interest/
Kāreti Kaitiaki /api/v1/credit-card-payoff/
Te tātaitai utu korohū /api/v1/fuel-cost/
Kaitirotiro whakahua ā-pūnaha /api/v1/auto-loan/
Kātaitai whakamutu /api/v1/retirement/
Te tātaitai whāinga o te pūtea /api/v1/savings-goal/
Kātaitai o te Whare Wānanga /api/v1/margin/
Te tātaitai uara o te wā e whai ake nei /api/v1/future-value/
Te tātaitai uara o nāianei /api/v1/present-value/
Kātaitai ROI /api/v1/roi/
Te tātaitai whakawhiwhinga o te tau /api/v1/annuity-payout/
Ka taea te tātaitai te tātaitai /api/v1/apr-to-apy/
Te tātaitai CD /api/v1/cd/
Te tātaitai whakatōpūtanga /api/v1/inflation/
Kātaitai ā-Wānanga /api/v1/home-affordability/
Te tātaitai o te mātauranga /api/v1/rent-affordability/
Kātaitai whakawhiwhinga /api/v1/down-payment/
Kātaitai Refinance /api/v1/refinance/
Kātaitai ōwehenga moni-ki-whakahaere /api/v1/debt-to-income/
Kātaitai whakahuahua /api/v1/boat-loan/
Te tātaitai ā-kaupāho ā-kaupāho /api/v1/student-loan/
Kātaitai ā-whāiti /api/v1/personal-loan/
Kātaitai Kāri /api/v1/lease/
Te tātaitai uara tīariari /api/v1/net-worth/
Te tātaitai ira-whakahaere /api/v1/break-even/
Kātaitai SIP /api/v1/sip/
Kātaitai EMI /api/v1/emi/
Kātaitai 401(k) /api/v1/401k/
Kātaitai Roth IRA /api/v1/roth-ira/
Kātaitai IRA tūturu /api/v1/ira/
Te tātaitai moni (50/30/20) /api/v1/budget/
Te tātaitai o te Haumarutanga Pāpori /api/v1/social-security/
Kātaitai tātaitai /api/v1/debt-payoff/
Kātaitai whakawhiwhinga ki te hoko /api/v1/rent-vs-buy/
Kātaitai whakahuahua /api/v1/mortgage-payoff/
Te tātaitai APR /api/v1/apr/
Kātaitai whakakoretanga /api/v1/depreciation/
Kātaitai GDP /api/v1/gdp/
Whakatau me te utu (2)
Mātau me te āhua o te āhua (28)
Kāhua (26)
Tatauranga (15)
Ko ngā kaiwhakarere wae (17)
Pukapuka Pūtaiao me te Pūkaha (27)
Rā me te wā (15)
I ia rā (27)

Ko ngā hua he whakataunga mō te tohutohu ahuwhānui anake, ehara i te tohutohu moni, rongoā, tāke rānei.