Computes variance from a dataset using GET /v1/stats/variance, measuring how spread out values are from the mean. Pass an array of numbers and get back the variance value — essential for statistical analysis in data science workflows. Works seamlessly with MCP in Cursor and other AI coding assistants for instant statistical calculations.
curl "https://tinyfn.io/v1/stats/variance" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/stats/variance', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/stats/variance',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's statistics tools:
{
"mcpServers": {
"tinyfn-stats": {
"url": "https://tinyfn.io/mcp/stats",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Send a dataset array to the variance tool through MCP. Your AI assistant will call the endpoint and return the variance value immediately.
Population variance divides by N (total count), sample variance divides by N-1. Check the tool's documentation for which method it implements.
Empty datasets typically return undefined/null. Single values return 0 since there's no variation from the mean.
Send a JSON array of numeric values via GET request. The endpoint processes the numbers and returns the calculated variance.
Variance shows raw spread in squared units, while standard deviation (square root of variance) matches original data units for easier interpretation.
Get your free API key and start using Calculate Variance in seconds.
Get Free API Key