{"uid":"cap_Y-Y3LP-HHBXBjwkuGjH-8","slug":"descriptive-statistics-correlation-api-ab31052b","name":"Descriptive Statistics & Correlation API","description":"Exact descriptive statistics — LLMs cannot reliably sum 200 numbers; this can. POST {values:[…]} for count/sum/mean/median/stddev/percentiles; {x:[],y:[]} for Pearson correlation + linear regression; {rows:[…], field} for object arrays — or {collection, field?} to run stats DIRECTLY ON YOUR DATASTORE collection (the paying wallet is the identity; reading extends its life 30 days). Up to 100k values, Kahan-summed.","url":"https://api.webbersites.com/api/calc/stats","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"properties":{"x":{"type":"array","description":"with y: correlation + regression"},"y":{"type":"array"},"rows":{"type":"array","description":"objects — with field/fields to pick columns"},"field":{"type":"string"},"values":{"type":"array","description":"numbers to describe"},"collection":{"type":"string","description":"run stats on YOUR datastore collection instead of posting data"}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"},"sum":{"type":"number"},"mean":{"type":"number"},"count":{"type":"number"},"median":{"type":"number"},"stddev":{"type":"number"},"variance":{"type":"number"},"pearson_r":{"type":"number"},"regression":{"type":"object"},"percentiles":{"type":"object"}}}}}}},"responseSchema":{"type":"json","example":{"sum":67.5,"mean":13.5,"count":5,"median":13.9,"stddev":1.41,"percentiles":{"p25":12.5,"p75":14.1,"p95":15}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kcQ_r4kjrZDoW7UVIU1_S","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes exact descriptive statistics (count, sum, mean, median, stddev, percentiles) and Pearson correlation with linear regression over numeric arrays or datastore collections, using Kahan summation for accuracy.","exampleAgentPrompt":"Can you calculate the exact descriptive stats — count, mean, median, standard deviation, and 25th/75th percentiles — for these 500 sales figures: [12.4, 88.3, 45.0, ...]? Also give me the Pearson correlation and linear regression between the sales and the corresponding ad-spend values I'll pass as x and y arrays.","exampleUseCases":null,"resultDescription":"Returns exact descriptive statistics including count, sum, mean, median, standard deviation, and percentiles for value arrays; Pearson correlation coefficient and linear regression slope/intercept for paired x/y arrays; supports up to 100k values with Kahan summation to prevent floating-point drift.","failureModes":["Array exceeds 100k values — request rejected","Mismatched x/y array lengths — correlation cannot be computed","Invalid field name for object array or collection — field not found error","Collection not found or wallet identity not authorized — 401/404","Malformed JSON body — 400 bad request","Payment not included or insufficient — 402 payment required"],"whenToPreferThis":"Prefer this endpoint when exact numerical accuracy matters (LLMs cannot reliably sum or average large arrays), when you need full descriptive stats in one call, when computing correlation or regression between two variables, or when you want to run stats directly on a stored datastore collection without re-uploading data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:41:45.261Z","isFirstParty":false}