Friendly Calculator API
Download OpenAPI 3.1 JSON specification Open API schema
Use one secure JSON endpoint to run the same calculator models available on Friendly Calculator. Requests are processed on the server, validated and recorded against the API key's plan quota.
20 API-enabled calculators HTTPS JSON POST
1. Base URL and authentication
POST https://gtuycqunlihegsbvvsol.supabase.co/functions/v1/calculator-api
Required headers:
Content-Type: application/json
x-api-key: avsk_live_YOUR_PRIVATE_KEY
All 20 API-enabled calculators listed below use this single endpoint. The full website directory contains 565 core calculator pages plus the international VAT calculator; API availability is a separate, smaller set. Select an API calculator with the JSON calculator property. The key must be active, have the calculators:read scope and have API access enabled with remaining quota.
Calculator embeds
To embed a public calculator without an API key, use an iframe and keep the Friendly Calculator attribution link visible. The embedded page calculates in the visitor's browser.
Open the self-service iframe embed builder · Business use cases and availability
<iframe src="https://friendlycalculator.in/embed/?src=%2Fcalculators%2Fcrop-cost-profit-calculator.html"
title="Crop Cost & Profit Calculator — Friendly Calculator"
loading="lazy" width="100%" height="760" style="border:0" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<p>Powered by <a href="https://friendlycalculator.in/" rel="noopener">Friendly Calculator</a></p>
For server-to-server API calls, keep the private API key on your own server. Never put API keys in public browser JavaScript or iframe markup. The API Free plan quota and per-minute rate limits remain separate from public iframe embeds.
2. Available calculators and inputs
| Calculator | calculator value | Required inputs | Units / notes |
|---|---|---|---|
| GST | gst | amount, rate, mode, supply | INR; rate 0–100%; mode add/remove; supply intra-state/inter-state |
| Loan EMI | emi | principal, annualRate, years | Principal in INR; annual percentage; alternatively pass integer months (1–600) |
| Fixed Deposit | fd | principal, annualRate, years, frequency | INR; annual percentage; frequency 1, 2, 4 or 12 |
| Discount | discount | price, discountPercent | INR; percentage 0–100 |
| Profit & Loss | profit-loss | costPrice, sellingPrice | INR; cost price must be above zero |
| Income Tax | income-tax | income, regime | Annual taxable income in INR; regime new or old; configured Tax Year 2026–27 estimate |
| Salary TDS | salary-tds | income, paid, months | Annual taxable income and tax paid in INR; remaining payroll months 1–12 |
| BMI | bmi | height, weight | Height in cm; weight in kg; number-only result, not a diagnosis or age-specific health assessment |
| EPF / PF | epf | monthly, rate, years | Monthly employee contribution in INR; annual percentage; years |
| Savings Interest | savings-interest | principal, rate, days | INR; annual percentage; days 1–3650 |
| Salary | salary | monthly, days, hours | Monthly salary in INR; working days per month; working hours per day |
| Inflation | inflation | amount, rate, years | INR; assumed annual inflation percentage; years |
| Fuel Cost | fuel-cost | distance, mileage, price | Distance in km; mileage in km/litre; fuel price in INR/litre |
| Age | age | dob, asof | Dates in YYYY-MM-DD format |
| Electricity Bill | electricity | units, rate, fixed, other | Units in kWh; rate and charges in INR; fixed and other may be zero |
| SIP | sip | monthly, rate, years | Monthly contribution in INR; assumed annual return percentage; whole years 1–50; contributions at month start |
| PPF | ppf | yearlyDeposit, rate, years | Annual deposit INR 500–150,000; annual percentage; whole years 15–50; deposit at year start |
| CTC to In-Hand Salary | ctc-salary | ctc, basicPercent, pfPercent, includeGratuity, professionalTaxMonthly, tdsMonthly | Annual CTC in INR; percentages; gratuity boolean; monthly deductions in INR |
| HRA Exemption | hra | actualHraReceived, basicSalary, rentPaid, metro | INR for same period; metro is true/false; basic salary includes eligible DA where applicable |
| Basic Calculator | basic | a, b, operation | Numbers; operation add, subtract, multiply, divide; percent uses a only |
3. Request and response example
GST example request:
{
"calculator": "gst",
"inputs": {
"amount": 10000,
"rate": 18,
"mode": "add",
"supply": "intra-state"
}
}
Example response:
{
"ok": true,
"calculator": "gst",
"result": {
"taxableAmount": 10000,
"gstAmount": 1800,
"totalAmount": 11800,
"rate": 18,
"mode": "add",
"supply": "intra-state",
"cgst": 900,
"sgst": 900
},
"usage": {
"plan": "business_monthly",
"quota": 1000,
"used": 1,
"remaining": 999,
"rate_limit_per_minute": 60
}
}
The example values illustrate the response structure. The actual usage fields are returned from the account's active plan and quota.
4. Copy-ready integrations
cURL
curl -X POST 'https://gtuycqunlihegsbvvsol.supabase.co/functions/v1/calculator-api' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_PRIVATE_API_KEY' \
-d '{"calculator":"emi","inputs":{"principal":500000,"annualRate":9,"years":5}}'
JavaScript (Node.js server-side)
const response = await fetch(
"https://gtuycqunlihegsbvvsol.supabase.co/functions/v1/calculator-api",
{
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.FRIENDLY_CALCULATOR_API_KEY
},
body: JSON.stringify({
calculator: "emi",
inputs: { principal: 500000, annualRate: 9, years: 5 }
})
}
);
const result = await response.json();
if (!response.ok) throw new Error(result.error || "API request failed");
console.log(result.result);
Python
import os
import requests
response = requests.post(
"https://gtuycqunlihegsbvvsol.supabase.co/functions/v1/calculator-api",
headers={
"Content-Type": "application/json",
"x-api-key": os.environ["FRIENDLY_CALCULATOR_API_KEY"],
},
json={
"calculator": "emi",
"inputs": {"principal": 500000, "annualRate": 9, "years": 5},
},
timeout=20,
)
response.raise_for_status()
print(response.json()["result"])
Store FRIENDLY_CALCULATOR_API_KEY in your server's secret environment configuration. Do not hard-code it in client-side code.
5. Usage limits
- Every calculator request uses the same API key and is subject to its per-minute rate limit.
- Monthly quota and rate limits are enforced by the server, not by dashboard controls.
- Valid-key requests that reach calculation processing count toward monthly quota, including invalid-input responses.
- Requests rejected for invalid keys, disabled API access, exhausted quota or rate limits do not consume monthly quota.
- Try API sends a real production request and counts toward quota and rate limits when it reaches processing.
- The Free plan includes 50 API requests per calendar month for signed-in customers. The quota is enforced server-side and shared across all API keys on the same account; it resets at the start of each calendar month.
- API keys issued before the new plan gate are grandfathered with a high compatibility ceiling and their existing per-minute limit. Newly generated keys follow the current plan and quota rules.
6. HTTP status and error codes
| HTTP | code | Meaning |
|---|---|---|
| 200 | — | Calculation completed. JSON contains ok, calculator, result and usage details. |
| 400 | INVALID_REQUEST_BODY, INVALID_INPUT | Malformed JSON, unsupported calculator or invalid/missing input. |
| 401 | INVALID_API_KEY | Missing, invalid, expired or revoked key. |
| 403 | API_ACCESS_DISABLED, INSUFFICIENT_SCOPE | API plan access is not enabled or key lacks the required scope. |
| 405 | METHOD_NOT_ALLOWED | Only POST is supported for calculator requests. |
| 413 / 415 | REQUEST_TOO_LARGE / UNSUPPORTED_MEDIA_TYPE | Request exceeds the size limit or is not JSON. |
| 429 | QUOTA_OR_RATE_LIMIT_EXCEEDED | Monthly quota or per-minute limit reached. Check Retry-After when supplied. |
| 500 / 503 | INTERNAL_ERROR | Temporary backend or service configuration issue. |
7. Manage keys and test requests
Sign up or sign in to the Customer API Dashboard to create a key, copy it once, revoke unused keys, inspect usage and send a real test request. Keys are stored as SHA-256 hashes; the raw key is never retrievable after creation.
For business API access or a quota change, use the website's existing Business Enquiries contact route.