Developers

Free statistics API

JSON endpoints for contingency-table statistics — the same engine that powers the calculators and the workspace. No API key, no signup. CORS is open, so you can call it straight from a browser.

Published by crosstabs.com · Named statistical review pending · Last updated

Quick start

Pass your observed counts as a matrix. Rows are separated by ;, cells by , — the same format used by shareable calculator links.

# GET — table in the query string
curl "https://www.crosstabs.com/api/v1/chi-square?d=20,30;30,20"

# POST — table as JSON
curl -X POST https://www.crosstabs.com/api/v1/contingency \
  -H "Content-Type: application/json" \
  -d '{"table": [[20, 30], [30, 20]]}'

Response (abridged):

{
  "input": { "table": [[20, 30], [30, 20]], "n": 100, "rows": 2, "cols": 2 },
  "chiSquare": { "chiSquare": 4.0, "degreesOfFreedom": 1, "pValue": 0.0455 },
  "cramersV": { "value": 0.2, "label": "small" },
  "fishersExact": {
    "pValue": 0.0713,
    "oddsRatio": 0.4444,
    "oddsRatioState": "finite",
    "oddsRatioCI": [0.2007, 0.9837],
    "oddsRatioCIStates": ["finite", "finite"]
  },
  "fishersExactUnavailableReason": null,
  "docs": "https://www.crosstabs.com/developers"
}

Endpoints

GET | POST /api/v1/contingency

Everything — chi-square, G-test, Fisher's exact, odds ratio, Cramér's V, phi, lambda, gamma, Kendall's tau, Somers' d, Theil's U, expected counts.

GET | POST /api/v1/chi-square

Chi-square test of independence with Yates' correction, G-test, Cramér's V, and a low-expected-count warning.

GET | POST /api/v1/fishers-exact

Fisher's exact test (two-sided) for 2×2 tables.

GET | POST /api/v1/odds-ratio

Odds ratio with 95% confidence interval (Woolf's logit method) for 2×2 tables.

Limits & conventions

  • Inferential endpoints accept 2×2 through 12×12 finite, non-negative tables with positive margins and N ≤ 1,000,000,000,000.
  • Fisher uses the two-sided Fisher–Irwin fixed-margin probability ordering for safe-integer counts and enumerates at most 100,000 feasible tables; larger supports return a machine-readable workload_limit reason (HTTP 422 on the dedicated exact endpoint).
  • 30 requests per minute per IP. Need more? See the support page.
  • The odds-ratio endpoint encodes unbounded zero-cell results as a null numeric value plus an explicit positive_infinity state.
  • Calculation behavior and assumptions are summarized on the methods page and match the workspace and calculators.
  • Free for any use, including commercial. Please don't use it as a high-volume backend without getting in touch first.

See Methods for calculation behavior and assumptions. Email support@crosstabs.com to reach us, or use the support checklist.

MCP server for AI assistants

Connect a compatible Streamable HTTP MCP client to the free hosted service for 46 tools covering evidence, aggregate calculations, temporary projects, background jobs, and file handoff. No sign-in is needed to connect. Hosted uploads leave your device, require consent, and use token-protected workspaces whose access expires after 24 hours.

https://mcp.crosstabs.com/mcp

See the MCP setup and privacy boundaries before uploading. Export before expiry; provider backup retention is separate from active-data cleanup. Client-specific compatibility is not guaranteed.

For on-device processing, the MIT-licensed crosstabs 1.4.0 package provides a separate 35-tool headless server and 39 analytical tools plus runtime status on the Python statistics server. These local tool sets are not the hosted 46-tool list.

pip install crosstabs==1.4.0

The separate local Codex/Claude plugin repository is at barangaroo/crosstabs-codex-plugin. Package 1.4.0 has verified fresh public installs, including 35 local project tools. Guided weighting preview and apply are available with explicit population targets and recorded human confirmation; saving a sampling weight does not approve a survey design or authorize ordinary inference. Plugin source availability, native-host review and directory approval are separate. Exact status, setup instructions, and verified parity boundaries are on the MCP server page.

Embeddable calculators

Every calculator can be embedded on your site or course page with a one-line iframe — open any calculator, enter a table, and click Embed this calculator. Example:

<iframe src="https://www.crosstabs.com/embed/chi-square-calculator#d=20,30;30,20"
  width="100%" height="640" loading="lazy"
  style="border:1px solid #e2e8f0;border-radius:12px"
  title="Chi-square calculator — crosstabs.com"></iframe>