{"uid":"cap_p7rUCR_MyGMMqu2nHzI7I","slug":"x402-forgemesh-io-line-of-best-fit-8b3c8aed","name":"x402.forgemesh.io Line of Best Fit","description":"Linear regression API: slope, intercept, R-squared, and the equation of the best-fit line through your x/y data points. Least-squares, exact.","url":"https://x402.forgemesh.io/line-of-best-fit","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"x":{"type":"array","items":{"type":"number"}},"y":{"type":"array","items":{"type":"number"}}}},"responseSchema":{"type":"json","example":{"slope":1.9,"equation":"y = 1.9x + -0.5","intercept":-0.5,"r_squared":0.966}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9UJJIF6ITlxm-EJ0xaSqh","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes linear regression (slope, intercept, R-squared, and equation) for a set of x/y data points using least-squares fitting.","exampleAgentPrompt":"Can you calculate the line of best fit for these data points — x values [1, 2, 3, 4, 5] and y values [2.1, 3.9, 6.2, 7.8, 10.1] — and give me the slope, intercept, and R-squared?","exampleUseCases":null,"resultDescription":"Returns the slope, y-intercept, R-squared value, and the full equation of the best-fit line computed via exact least-squares linear regression.","failureModes":["Mismatched array lengths for x and y return a validation error","Empty or single-element arrays may produce undefined regression results","Non-numeric values in x or y arrays cause parse errors","Perfectly vertical data (all same x values) causes division-by-zero for slope"],"whenToPreferThis":"Use this endpoint when you need a quick, exact least-squares linear regression over arbitrary numeric x/y arrays and want slope, intercept, R-squared, and the line equation in one call — especially when you're already paying per-call via x402 and don't want to spin up a local compute environment.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:59:43.815Z","isFirstParty":false}