自由计算 APP

该网站的每个计算器都是免费 JSON API 。 没有注册, 没有 API 密钥, 启用了 CORS, 使用服务器或浏览器直接拨打 。

概览

API 运行与网站所使用的数学完全相同的计算。 发送计算器的字段值作为查询参数或 JSON, 并将计算结果作为 JSON 重新获取, 包括任何摊还时间表或图表数据, 计算器生成 。

  • 198+ 计算器,每个计算器都有自己的终点
  • 无 API 密钥 — 匿名接入,按IPIP的费率限制
  • CORSAccess-Control-Allow-Origin: * (可用客户端)
  • 利率限额: 60 每IP要求/小时/每IP 小时(超过429 HTTP)

基点 URL

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

索引 - 列出每个计算器

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

返回每个字段(键、标签、类型、默认、单位)和结果键的所有计算器的机器可读列表,这些计算器足以动态构建客户端。

计算 - 运行一个计算器

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

响应形状 :

{
  "ok": true,
  "slug": "mortgage",
  "country": "us",
  "inputs":   { ... echoed field values ... },
  "results":  { ... computed result keys ... },
  "schedule": { "columns": [...], "rows": [...] } | null,
  "chart":    { "type": "pie", "slices": [...] } | null
}

国家-国家-国家计算器(抵押、贷款、所得税、销售税.)接受 ?country=us|uk|ca|au|in|ie|nz|za. 未知的弹片返回 404; 不支持的国家或错误输入返回400, 并附有帮助信息及字段规格 。

验证 & amp; 计划

匿名请求受IP限制。 对于更高的、可预测的月配额(和商业用途),请在您的账户页面上创建密钥,并发送三种方式之一:

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"
  • 自由 — 匿名(IP费率受限制)或免费钥匙,每月定额较小。
  • 开发者 & mdash; 9 美元/ mo — 每月10 000个电话,商业用途。
  • 商务 & mdash; 49/ mo — 每月100 000个电话,优先输送。

当键的月配额被使用时, API 返回 HTTP 429 时, 错误为“ 配额超额 ” ; 未知或非活动键返回 HTTP 401 。 看着全全图 注册 定价 页 次 页.

实例

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}'

所有终点

每个计算器一个端点。 字段键和每个计算器的结果键都在 /api/v1/ 指数.

财务 财务 (41)
计算器终点
抵押计算器 /api/v1/mortgage/
贷款计算器 /api/v1/loan/
利息化合物计算器 /api/v1/compound-interest/
简单利息计算器 /api/v1/simple-interest/
信用卡结存计算器 /api/v1/credit-card-payoff/
燃料成本计算器 /api/v1/fuel-cost/
自动计算贷款计算器 /api/v1/auto-loan/
退休计算器 /api/v1/retirement/
节约目标计算器 /api/v1/savings-goal/
利润边际计算器 /api/v1/margin/
未来计算值 /api/v1/future-value/
当前值计算器 /api/v1/present-value/
ROI 计算器 /api/v1/roi/
年金给付计算器 /api/v1/annuity-payout/
RAVA 至APY 计算器 /api/v1/apr-to-apy/
CD 计算器 /api/v1/cd/
通货膨胀计算器 /api/v1/inflation/
家庭可负担性计算器 /api/v1/home-affordability/
租金可负担性计算器 /api/v1/rent-affordability/
下下付款计算器 /api/v1/down-payment/
再融资计算器 /api/v1/refinance/
债务与收入比率计算器 /api/v1/debt-to-income/
船舶贷款计算器 /api/v1/boat-loan/
学生贷款计算器 /api/v1/student-loan/
个人贷款计算器 /api/v1/personal-loan/
汽车租赁计算器 /api/v1/lease/
净值计算器 /api/v1/net-worth/
断断点点计算器 /api/v1/break-even/
SIP SIP 计算器 /api/v1/sip/
EMI 计算器 /api/v1/emi/
401(k) 计算器 /api/v1/401k/
Roth IRA 计算器 /api/v1/roth-ira/
传统IRA计算器 /api/v1/ira/
预算计算器(50/30/20) /api/v1/budget/
社会保障计算器 /api/v1/social-security/
债务偿还额计算器 /api/v1/debt-payoff/
租赁对买买计算器 /api/v1/rent-vs-buy/
补偿性计算器 /api/v1/mortgage-payoff/
RAPR 计算器 /api/v1/apr/
折旧计算器 /api/v1/depreciation/
GDP GDP计算器 /api/v1/gdp/
税收和薪金 (2)
健康和健身 (28)
数学 (26)
统计 (15)
单位转换器 (17)
科学和工程 (27)
日期和时间 (15)
每天 (27)

成果仅是一般指导的估计数,而不是财务、医疗或税务咨询。