MetricTree Public API

Free product-metric calculations as JSON. 22 metrics. No signup, no API key, CORS open. Built for developers.

✓ Free forever ✓ No API key ✓ No signup ✓ CORS open Edge-hosted (low latency) Open source MIT

Quickstart

Calculate LTV via GET:

curl "https://metricstree.vercel.app/api/calc?metric=ltv&aov=2500&freq=4&life=3"

Response:

{
  "metric": "ltv",
  "inputs": { "aov": 2500, "freq": 4, "life": 3 },
  "formula": "AOV × Frequency × Lifetime",
  "result": 30000,
  "unit": "$",
  "insight": "LTV target ≥ 3× CAC for healthy unit economics",
  "rating": "high",
  "calculator_url": "https://metricstree.vercel.app/ltv",
  "docs_url": "https://metricstree.vercel.app/api-docs"
}

Try it now

Edit URL and hit Calculate:

POST with JSON body

curl -X POST "https://metricstree.vercel.app/api/calc" \
  -H "Content-Type: application/json" \
  -d '{"metric":"nrr","inputs":{"start":1000000,"expansion":200000,"churn":50000,"contraction":10000}}'

Endpoints

EndpointMethodDescription
/api/calcGET, POSTCalculate any supported metric
/api/leadPOST(Internal — used by MetricTree forms only)

Supported metrics (22)

metricRequired inputsReturns (unit)
ltvaov, freq, lifeLifetime Value ($)
cacspend, customersCAC ($)
ltv_cacltv, cacLTV:CAC ratio (x)
mrrmrrMRR ($)
arrmrrARR = MRR×12 ($)
nrrstart, expansion, churn, contractionNRR (%)
grrstart, churn, contractionGRR (%)
churnlost, totalChurn Rate (%)
runwaycash, burnRunway (months)
burnMultipleburn, newArrBurn Multiple (x)
ruleOf40growth, marginRule of 40 (%)
quickRationewMrr, expansionMrr, churnMrr, contractionMrrQuick Ratio (x)
magicNumbernewArrQuarter, smMagic Number (x)
npspromoters, detractors, totalNPS (score)
cacPaybackcac, mrrPerCustomer, grossMarginCAC Payback (months)
roasrevenue, spendROAS (x)
stickinessdau, mauStickiness (%)
salesVelocityopps, acv, winRate, cycleDays$/day
winRatewon, totalWin Rate (%)
pipelineCoveragepipeline, quotaCoverage (x)
aovrevenue, ordersAOV ($)
mrrGrowthRatestartMrr, endMrrMoM growth (%)

JavaScript example

// Calculate LTV:CAC from browser
const r = await fetch('https://metricstree.vercel.app/api/calc?metric=ltv_cac<v=15000&cac=3000');
const data = await r.json();
console.log(data.result);   // 5
console.log(data.insight);  // "Excellent (or under-investing in growth)"
console.log(data.rating);   // "excellent"

Python example

import requests

r = requests.get('https://metricstree.vercel.app/api/calc', params={
    'metric': 'runway', 'cash': 5000000, 'burn': 300000
})
print(r.json())
# { "result": 16.67, "unit": "months", "rating": "healthy", ... }

Response format

FieldTypeDescription
metricstringEcho of the requested metric
inputsobjectEcho of provided inputs
formulastringPlain-English formula
resultnumber | "Infinity"Calculated value (rounded to 2 decimals)
unitstring"$" / "%" / "x" / "months" / etc
insightstringPlain-English interpretation + benchmark
ratingstringCategorical: "healthy" / "critical" / "excellent" / etc
calculator_urlstringLink to interactive calculator on MetricTree

Errors

StatusMeaning
400Missing required inputs / invalid JSON body
404Unknown metric
405Method not allowed (use GET, POST, or OPTIONS)
422Inputs valid but calculation undefined (e.g., divide by zero)

Rate limiting

Soft limit ~60 requests/minute per IP (Edge runtime default). No hard limit, no API key required. Be reasonable.

If you need higher throughput or SLA guarantees — get in touch (rodion.121093@gmail.com). The future Pro tier will include higher limits + sub-50ms guaranteed latency.

CORS

Access-Control-Allow-Origin: * — open to all origins. Use directly from browser apps.

Caching

Cache-Control: public, max-age=300 — responses cacheable 5 minutes (calculations are deterministic by inputs).

Want a metric we don't support?

Open an issue on GitHub or email — we'll add it within 48 hours if it's a standard product metric.

License

MIT — use commercially, modify, redistribute. Attribution appreciated but not required.

Use cases