{"uid":"cap_5HikOW7ShftsibUzDt1J8","slug":"simple-moving-average-sma-by-massive-34624f60","name":"Simple Moving Average (SMA) by Massive","description":"Get the simple moving average (SMA) for a ticker symbol over a given time range. Can't find what you're looking for? POST feedback to /feedback, no charge.","url":"https://agent.massive.com/v1/indicators/sma/:stockTicker","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"},"pathParams":{"type":"object","required":["stockTicker"],"properties":{"stockTicker":{"type":"string","description":"Specify a case-sensitive ticker symbol for which to get simple moving average (SMA) data. For example, AAPL represents Apple Inc."}}},"queryParams":{"type":"object","properties":{"limit":{"type":"integer","default":10,"maximum":5000,"description":"Limit the number of results returned, default is 10 and max is 5000"},"order":{"enum":["asc","desc"],"type":"string","default":"desc","description":"The order in which to return the results, ordered by timestamp."},"window":{"type":"integer","default":50,"description":"The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average."},"adjusted":{"type":"boolean","default":true,"description":"Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits."},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","default":"day","description":"The size of the aggregate time window."},"timestamp":{"type":"string","description":"Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp."},"series_type":{"enum":["open","high","low","close"],"type":"string","default":"close","description":"The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to calculate the simple moving average (SMA)."},"timestamp.gt":{"type":"string","description":"Range by timestamp."},"timestamp.lt":{"type":"string","description":"Range by timestamp."},"timestamp.gte":{"type":"string","description":"Range by timestamp."},"timestamp.lte":{"type":"string","description":"Range by timestamp."},"expand_underlying":{"type":"boolean","default":false,"description":"Whether or not to include the aggregates used to calculate this indicator in the response."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"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_F5reBiQ0Y4fV394xLp5Fe","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":"Returns the simple moving average (SMA) values for a given stock ticker over a configurable time range, window size, and aggregate timespan.","exampleAgentPrompt":"Can you get me the 50-day simple moving average for AAPL using daily close prices, returning the last 30 data points in descending order?","exampleUseCases":[{"title":"Momentum check for swing trading","prompt":"Pull the 20-day SMA for NVDA using daily close prices for the past 60 data points — I want to see if it's trending up or down."},{"title":"Long-term trend analysis for portfolio","prompt":"Get me the 200-day simple moving average for SPY on daily close prices, adjusted for splits, showing the last 100 results in ascending order so I can chart the trend."},{"title":"Short-term intraday moving average","prompt":"What's the 10-period SMA for TSLA on hourly bars using close prices? Give me the most recent 20 data points."}],"resultDescription":"Returns a time-ordered list of SMA data points, each containing the calculated SMA value and corresponding timestamp. Includes metadata such as the window size, timespan, and series type used. Supports pagination via limit and order parameters.","failureModes":["Invalid or unsupported ticker symbol returns an error or empty result","Requesting data before a ticker's listing date returns no results","Window size larger than available data may return sparse or no values","Invalid timestamp format causes a query error","Exceeding the maximum limit of 5000 returns a validation error","Network or provider outage returns a 5xx error"],"whenToPreferThis":"Use this endpoint when you need smoothed price trend data for a stock using the classic simple moving average calculation. Prefer this over raw OHLC data when you want noise-reduced trend signals. Choose SMA over EMA (also available on this platform) when you want equal weighting across all periods in the window rather than recency-biased weighting. Ideal for technical analysis agents, charting workflows, or momentum detection pipelines.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:51:13.665Z","isFirstParty":false}