{"uid":"cap_34Z6RgpOeEr6JK6bW7Ejr","slug":"saylor-innovations-data-desk-moving-average-calculator-adcb2a03","name":"Saylor Innovations Data Desk – Moving Average Calculator","description":"Simple, exponential or weighted moving average of a numeric series for any window - full series, latest value, trend direction and price versus average","url":"https://saylorinnovations.com/api/stats/moving-average?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["values","window"],"properties":{"type":{"type":"string","description":"optional sma (default), ema or wma"},"values":{"type":"string","description":"Comma-separated series, 3-1000"},"window":{"type":"string","description":"Window length, 2-200"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string","const":"json"},"example":{"type":"object","required":["type","window","average"],"properties":{"type":{"type":"string","description":"Type or kind"},"count":{"type":"number","description":"Number of items returned"},"trend":{"type":["string","null"],"description":"Direction of recent change"},"latest":{"type":"number","description":"Most recent value or version"},"source":{"type":"string","description":"Data source the values come from"},"window":{"type":"number","description":"Window length used"},"average":{"type":"array","description":"Average value"},"previous":{"type":["number","null"],"description":"Moving average one step before the latest"},"latest_value":{"type":"number","description":"Latest value"},"above_average":{"type":"boolean","description":"Above average"}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_SFVgKHYkKeI_8zgIOnntt","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes simple (SMA), exponential (EMA), or weighted (WMA) moving averages for a numeric series, returning the full average series, latest value, trend direction, and whether the current value is above or below the average.","exampleAgentPrompt":"Calculate a 14-period exponential moving average for this price series: 100,102,98,105,110,108,112,115,111,109,114,118,120,117,122 — and tell me whether the latest value is above or below the average and which direction the trend is going.","exampleUseCases":[{"title":"Stock price trend signal detection","prompt":"I have these daily closing prices for a stock over the past 30 days: 210,215,212,218,220,225,222,228,230,235,232,238,240,245,243,248,250,252,255,258,260,263,265,268,270,272,275,278,280,282. Can you run a 10-period simple moving average and tell me if the latest price is above or below the average and what the trend direction is?"},{"title":"Crypto volatility smoothing with EMA","prompt":"Smooth out this noisy Bitcoin hourly price series using a 5-period EMA and give me the full average series plus the latest value: 29800,30100,29950,30200,30500,30300,30700,31000,30800,31200,31500,31300,31600,31800,32000"},{"title":"Sales data trend analysis with WMA","prompt":"I have 20 weeks of weekly sales figures: 500,520,510,530,545,560,555,570,580,590,600,610,605,620,630,640,650,660,655,670. Apply a weighted moving average with a window of 8 and tell me the trend direction and whether the latest figure is above or below the average."}],"resultDescription":"Returns a JSON object containing the moving average type used, the window length, the full computed average array, the latest moving average value, the previous moving average value (one step back), the most recent input value, a trend direction string (e.g. 'up', 'down'), a boolean indicating whether the latest value is above the moving average, and the count of values processed.","failureModes":["Fewer than 3 or more than 1000 values in the series returns an error","Window length less than 2 or greater than 200 returns an error","Window larger than series length causes invalid computation","Non-numeric values in the comma-separated series cause a parse error","Invalid type parameter (not sma, ema, or wma) returns an error","Malformed query parameters return a 400-level error"],"whenToPreferThis":"Choose this endpoint when you need a lightweight, on-demand moving average computation over a numeric series without requiring a full data platform or financial data subscription. It is ideal for agents doing technical analysis, trend detection, or data smoothing on arbitrary numeric sequences — especially when you already have the data series in hand and just need the statistical transform. Prefer it over general-purpose code execution when you need a fast, reliable, pre-built computation with structured output including trend direction and above/below average signals.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T07:22:05.848Z","isFirstParty":false,"canonicalSlug":"saylor-innovations-data-desk-moving-average-calculator-adcb2a03"}