API Documentation
Every MoltCalc calculator is a JSON endpoint. The API is free and open, with no key or sign-up, and it runs the exact math shown on the site, so apps and AI agents get the same answers people do.
Base URL
https://moltcalc.com/api
Responses are JSON. CORS is open for GET requests. No authentication is needed.
Endpoints
1. List all calculators
Discovery endpoint. Returns every calculator with its slug, category and endpoint.
GET /api/calculators
2. Get a calculator's input schema
Returns the inputs a calculator accepts, with types, units, defaults and options.
GET /api/calculators/{slug}
# example
curl https://moltcalc.com/api/calculators/loan3. Run a calculation
Pass inputs as query parameters (GET) or a JSON body (POST). Missing inputs fall back to sensible defaults.
GET /api/calc/{slug}?param=value
POST /api/calc/{slug} (JSON body)
# GET
curl "https://moltcalc.com/api/calc/loan?amount=20000&rate=7&years=5"
# POST
curl -X POST https://moltcalc.com/api/calc/bmi \
-H "Content-Type: application/json" \
-d '{"units":"metric","weight":70,"height":175}'Example response:
{
"slug": "loan",
"name": "Loan Calculator",
"inputs": { "amount": "20000", "rate": "7", "years": "5" },
"outputs": [
{ "key": "monthly_payment", "label": "Monthly payment", "value": 396.02, "display": "$396.02" },
{ "key": "total_paid", "label": "Total of payments", "value": 23761.44, "display": "$23,761.44" },
{ "key": "total_interest", "label": "Total interest", "value": 3761.44, "display": "$3,761.44" }
],
"steps": [ ... ],
"formula": "M = P · r / (1 − (1 + r)^−n)"
}OpenAPI spec
A full OpenAPI 3.1 spec is available, with one typed operation per calculator, ready to import as agent tools.
GET /api/openapi.json
For AI agents
Start at /api/calculators to discover what is available, read a schema at /api/calculators/{slug}, then call /api/calc/{slug}. There is also an llms.txt and a fuller llms-full.txt.
Rate limits
The API is open and best-effort rate limited. Please keep usage reasonable; heavy or commercial use may get dedicated limits later.