REST API

API Documentation

Integrate The Calculators into your applications. Access calculators, perform calculations, and embed widgets programmatically.

Base URL: https://thecalculators.net/api/v1
Format: JSON

Authentication

All API requests require an API key. Include your key in the request header:

Header
X-API-Key: your_api_key_here

Alternatively, pass the key as a query parameter: ?api_key=your_api_key_here

Keep your API keys secure

Never expose API keys in client-side code or public repositories. Use environment variables or server-side code to make API calls.

Rate Limits

Rate limits vary by plan. When you exceed your limit, the API returns a 429 status code.

Plan Monthly Requests Rate
Free1,00010 req/min
Starter10,00060 req/min
Pro100,000120 req/min
Enterprise1,000,000Unlimited

Custom rate limits can be configured by your administrator per API key.

Error Handling

The API returns standard HTTP status codes. Errors include a JSON body with details.

Error Response
{
  "error": "Invalid API key",
  "status": 401
}
Code Description
200Success
400Bad request - Invalid parameters
401Unauthorized - Missing or invalid API key
404Not found - Resource doesn't exist
429Rate limit exceeded
500Internal server error
GET

List Calculators

Retrieve a paginated list of all public calculators.

Endpoint
GET https://thecalculators.net/api/v1/calculators

Query Parameters

Parameter Type Default Description
pageinteger1Page number
per_pageinteger20Results per page (max 100)
categorystring-Filter by category slug
searchstring-Search by name

Example Response

200 OK
{
  "calculators": [
    {
      "id": 1,
      "name": "Compound Interest",
      "slug": "compound-interest",
      "description": "Calculate compound interest...",
      "category": "Finance",
      "icon": "calculator",
      "color": "#7c3aed"
    }
  ],
  "total": 15,
  "page": 1,
  "per_page": 20,
  "pages": 1
}
GET

Get Calculator

Retrieve details about a specific calculator by its slug.

Endpoint
GET https://thecalculators.net/api/v1/calculators/{slug}

Path Parameters

ParameterDescription
slugThe URL-friendly identifier of the calculator
GET

List Categories

Retrieve all calculator categories.

Endpoint
GET https://thecalculators.net/api/v1/categories

Example Response

200 OK
{
  "categories": [
    {
      "id": 1,
      "name": "Finance",
      "slug": "finance",
      "description": "Financial calculators",
      "calculator_count": 5
    }
  ]
}
POST

Calculate

Perform a calculation using a specific calculator.

Endpoint
POST https://thecalculators.net/api/v1/calculate/{slug}

Request Body

JSON
{
  "inputs": {
    "principal": 10000,
    "rate": 5,
    "years": 10,
    "compound_frequency": "monthly"
  }
}

Example Response

200 OK
{
  "result": 16470.09,
  "formatted": "$16,470.09",
  "details": {
    "total_interest": 6470.09,
    "effective_rate": "5.12%"
  }
}

Code Examples

cURL
curl -X POST https://thecalculators.net/api/v1/calculate/compound-interest \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"inputs": {"principal": 10000, "rate": 5, "years": 10}}'
JavaScript (fetch)
const response = await fetch('https://thecalculators.net/api/v1/calculate/compound-interest', {
  method: 'POST',
  headers: {
    'X-API-Key': 'your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    inputs: { principal: 10000, rate: 5, years: 10 }
  })
});
const data = await response.json();
Python (requests)
import requests

response = requests.post(
    'https://thecalculators.net/api/v1/calculate/compound-interest',
    headers={'X-API-Key': 'your_api_key'},
    json={'inputs': {'principal': 10000, 'rate': 5, 'years': 10}}
)
data = response.json()

Embed Widget

Embed any calculator directly into your website using an iframe. No API key required for embeds.

Embed Code
<iframe
  src="https://thecalculators.net/embed/compound-interest?theme=dark"
  width="100%"
  height="500px"
  frameborder="0"
  loading="lazy"
  style="border: none; border-radius: 8px;"
></iframe>

Embed Parameters

ParameterValuesDescription
themedark, light, autoWidget color theme

Use the Embed Code Generator in the admin panel to generate embed codes for any calculator with your preferred settings.

SDKs & Libraries

Official SDK libraries are coming soon. In the meantime, use any HTTP client to interact with the API.

JavaScript / Node.js

Coming soon

Python

Coming soon

PHP

Coming soon

Changelog

v1.0 February 2026
  • Initial API release
  • Calculator listing and details endpoints
  • Calculation endpoint with formula support
  • Category listing endpoint
  • Embed widget support