Statistics Calculator API
API Overview
Our Statistics Calculator API allows developers to integrate statistical calculations directly into their applications. The API provides endpoints for various statistical operations, including descriptive statistics, probability distributions, hypothesis testing, and more.
Base URL
https://api.statisticscalculator.xyz/v1/
Authentication
All API requests require an API key sent in the header:
Authorization: Bearer YOUR_API_KEY
Rate Limits
- Free tier: 100 requests per hour
- Basic tier: 1,000 requests per hour
- Pro tier: 10,000 requests per hour
Response Format
All responses are in JSON format and include:
success
: boolean indicating success/failuredata
: the requested data or resultserror
: error message if success is false
API Endpoints
Descriptive Statistics
POST /descriptive
Request body:
{ "data": [array of numbers], "options": { "precision": 4 } }
Normal Distribution
POST /normal
Request body:
{ "mean": 0, "std_dev": 1, "x": 1.96, "type": "cdf" // "cdf", "pdf", or "inv" }
t-Test
POST /ttest
Request body:
{ "sample_mean": 102.5, "pop_mean": 100, "sample_std_dev": 15, "sample_size": 25, "alpha": 0.05, "alternative": "two-sided" // "two-sided", "less", or "greater" }
Example Response
{ "success": true, "data": { "test_statistic": 2.0412, "p_value": 0.0253, "reject_null": true, "confidence_interval": [100.32, 104.68] } }
Getting Started
- Sign up for an API key
- Review the documentation for your desired endpoint
- Make requests to the API with your key
- Handle the JSON responses in your application
Code Examples
Python
import requests url = "https://api.statisticscalculator.xyz/v1/descriptive" headers = {"Authorization": "Bearer YOUR_API_KEY"} data = { "data": [12, 15, 18, 22, 25, 28, 28, 30], "options": {"precision": 4} } response = requests.post(url, json=data, headers=headers) print(response.json())
JavaScript
fetch("https://api.statisticscalculator.xyz/v1/descriptive", { method: "POST", headers: { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, body: JSON.stringify({ data: [12, 15, 18, 22, 25, 28, 28, 30], options: {precision: 4} }) }) .then(response => response.json()) .then(data => console.log(data));
API Status
Last updated: 2025-06-16 11:04:38
Support
For API support, please contact:
contact@statisticscalculator.xyz