Developer documentation · v1

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

Keep your API key secret. Call this API from your own trusted server. Do not place an API key in public browser JavaScript, a mobile application package, a public repository or a shared screenshot. The dashboard's Try API tool is intended for private testing while signed in.

Open Customer API Dashboard

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

Calculatorcalculator valueRequired inputsUnits / notes
GSTgstamount, rate, mode, supplyINR; rate 0–100%; mode add/remove; supply intra-state/inter-state
Loan EMIemiprincipal, annualRate, yearsPrincipal in INR; annual percentage; alternatively pass integer months (1–600)
Fixed Depositfdprincipal, annualRate, years, frequencyINR; annual percentage; frequency 1, 2, 4 or 12
Discountdiscountprice, discountPercentINR; percentage 0–100
Profit & Lossprofit-losscostPrice, sellingPriceINR; cost price must be above zero
Income Taxincome-taxincome, regimeAnnual taxable income in INR; regime new or old; configured Tax Year 2026–27 estimate
Salary TDSsalary-tdsincome, paid, monthsAnnual taxable income and tax paid in INR; remaining payroll months 1–12
BMIbmiheight, weightHeight in cm; weight in kg; number-only result, not a diagnosis or age-specific health assessment
EPF / PFepfmonthly, rate, yearsMonthly employee contribution in INR; annual percentage; years
Savings Interestsavings-interestprincipal, rate, daysINR; annual percentage; days 1–3650
Salarysalarymonthly, days, hoursMonthly salary in INR; working days per month; working hours per day
Inflationinflationamount, rate, yearsINR; assumed annual inflation percentage; years
Fuel Costfuel-costdistance, mileage, priceDistance in km; mileage in km/litre; fuel price in INR/litre
Ageagedob, asofDates in YYYY-MM-DD format
Electricity Billelectricityunits, rate, fixed, otherUnits in kWh; rate and charges in INR; fixed and other may be zero
SIPsipmonthly, rate, yearsMonthly contribution in INR; assumed annual return percentage; whole years 1–50; contributions at month start
PPFppfyearlyDeposit, rate, yearsAnnual deposit INR 500–150,000; annual percentage; whole years 15–50; deposit at year start
CTC to In-Hand Salaryctc-salaryctc, basicPercent, pfPercent, includeGratuity, professionalTaxMonthly, tdsMonthlyAnnual CTC in INR; percentages; gratuity boolean; monthly deductions in INR
HRA ExemptionhraactualHraReceived, basicSalary, rentPaid, metroINR for same period; metro is true/false; basic salary includes eligible DA where applicable
Basic Calculatorbasica, b, operationNumbers; 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

6. HTTP status and error codes

HTTPcodeMeaning
200—Calculation completed. JSON contains ok, calculator, result and usage details.
400INVALID_REQUEST_BODY, INVALID_INPUTMalformed JSON, unsupported calculator or invalid/missing input.
401INVALID_API_KEYMissing, invalid, expired or revoked key.
403API_ACCESS_DISABLED, INSUFFICIENT_SCOPEAPI plan access is not enabled or key lacks the required scope.
405METHOD_NOT_ALLOWEDOnly POST is supported for calculator requests.
413 / 415REQUEST_TOO_LARGE / UNSUPPORTED_MEDIA_TYPERequest exceeds the size limit or is not JSON.
429QUOTA_OR_RATE_LIMIT_EXCEEDEDMonthly quota or per-minute limit reached. Check Retry-After when supplied.
500 / 503INTERNAL_ERRORTemporary 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.

Open Customer API Dashboard

For business API access or a quota change, use the website's existing Business Enquiries contact route.