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
- CORS —
Access-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)
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.
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": { ... echoed field values ... },
"results": { ... computed result keys ... },
"schedule": { "columns": [...], "rows": [...] } | null,
"chart": { "type": "pie", "slices": [...] } | null
}
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.
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 — $9/mo — 10,000 ngā whakarongo/whā, whakamahinga hokohoko.
- Kauhanga — $49/whā — 100,000 ngā whakarongo/whā, te tūpāpaku o te tūpāpaku.
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);
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)
Whakatau me te utu (2)
| Kātaitai | Whakamutunga |
|---|---|
| Te tātaitai tāke moni whiwhi | /api/v1/income-tax/ |
| Kātaitai tāke hoko me VAT | /api/v1/sales-tax/ |
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.