{"uid":"cap_rNpTUhL_e21vnz5w88hmK","slug":"x402stock-xyz-f77c9e45","name":"x402stock.xyz SMA Indicator","description":"Simple Moving Average time series. Tune with `?window=`, `?timespan=`, `?series_type=`, `?limit=`. From x402stock, a pay-per-call market & economic data API for AI agents. No API key or account; pay in USDC via x402.","url":"https://x402stock.xyz/api/v1/indicators/sma/AAPL","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","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["timespan","window","series_type","adjusted","limit"],"properties":{"limit":{"type":"integer","default":30,"maximum":5000,"exclusiveMinimum":0},"window":{"type":"integer","default":50,"maximum":2000,"exclusiveMinimum":0},"adjusted":{"type":"boolean","default":true},"timespan":{"enum":["minute","hour","day","week","month","quarter","year"],"type":"string","default":"day"},"series_type":{"enum":["open","high","low","close"],"type":"string","default":"close"}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["ticker","data","source","as_of"],"properties":{"data":{"type":"object","required":["indicator","count","values"],"properties":{"count":{"type":"number"},"values":{"type":"array","items":{"type":"object","required":["timestamp","value"],"properties":{"value":{"type":"number"},"signal":{"type":"number"},"histogram":{"type":"number"},"timestamp":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false}},"indicator":{"type":"string"}},"additionalProperties":false},"as_of":{"type":"string"},"source":{"type":"string","const":"x402stock"},"ticker":{"type":"string"},"feedback":{"type":"object","required":["endpoint","method","free","note"],"properties":{"free":{"type":"boolean"},"note":{"type":"string"},"method":{"type":"string","const":"POST"},"endpoint":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}}}}},"responseSchema":null,"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"limit":30,"window":50,"adjusted":true,"timespan":"day","series_type":"close"}}},"response":{"data":{"count":30,"values":[{"value":284.78119999999996,"timestamp":"2026-06-11T04:00:00.000Z"},{"value":283.9444,"timestamp":"2026-06-10T04:00:00.000Z"},{"value":283.0454,"timestamp":"2026-06-09T04:00:00.000Z"},{"value":282.2104,"timestamp":"2026-06-08T04:00:00.000Z"},{"value":281.2373999999999,"timestamp":"2026-06-05T04:00:00.000Z"},{"value":280.143,"timestamp":"2026-06-04T04:00:00.000Z"},{"value":278.9512,"timestamp":"2026-06-03T04:00:00.000Z"},{"value":277.77579999999995,"timestamp":"2026-06-02T04:00:00.000Z"},{"value":276.43159999999995,"timestamp":"2026-06-01T04:00:00.000Z"},{"value":275.2845999999999,"timestamp":"2026-05-29T04:00:00.000Z"},{"value":274.0421999999999,"timestamp":"2026-05-28T04:00:00.000Z"},{"value":272.87659999999994,"timestamp":"2026-05-27T04:00:00.000Z"},{"value":271.7159999999999,"timestamp":"2026-05-26T04:00:00.000Z"},{"value":270.55179999999996,"timestamp":"2026-05-22T04:00:00.000Z"},{"value":269.4905999999999,"timestamp":"2026-05-21T04:00:00.000Z"},{"value":268.6069999999999,"timestamp":"2026-05-20T04:00:00.000Z"},{"value":267.7785999999999,"timestamp":"2026-05-19T04:00:00.000Z"},{"value":266.99679999999995,"timestamp":"2026-05-18T04:00:00.000Z"},{"value":266.1891999999999,"timestamp":"2026-05-15T04:00:00.000Z"},{"value":265.39039999999994,"timestamp":"2026-05-14T04:00:00.000Z"},{"value":264.67659999999995,"timestamp":"2026-05-13T04:00:00.000Z"},{"value":263.97419999999994,"timestamp":"2026-05-12T04:00:00.000Z"},{"value":263.3725999999999,"timestamp":"2026-05-11T04:00:00.000Z"},{"value":262.8025999999999,"timestamp":"2026-05-08T04:00:00.000Z"},{"value":262.3952,"timestamp":"2026-05-07T04:00:00.000Z"},{"value":262.131,"timestamp":"2026-05-06T04:00:00.000Z"},{"value":261.82359999999994,"timestamp":"2026-05-05T04:00:00.000Z"},{"value":261.46359999999993,"timestamp":"2026-05-04T04:00:00.000Z"},{"value":261.2185999999999,"timestamp":"2026-05-01T04:00:00.000Z"},{"value":260.82739999999995,"timestamp":"2026-04-30T04:00:00.000Z"}],"indicator":"sma"},"as_of":"2026-06-11T04:00:00.000Z","source":"x402stock","ticker":"AAPL"}},"exampleRequest":{"limit":30,"window":50,"adjusted":true,"timespan":"day","series_type":"close"},"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","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_XpMAzuA1txqPNgBxzth7Q","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 Simple Moving Average (SMA) values for a given stock ticker over a specified timespan, window, and price series type.","exampleAgentPrompt":"What's the 50-day simple moving average for AAPL using daily close prices? Give me the last 30 values with adjusted prices.","exampleUseCases":null,"resultDescription":"Returns a JSON object containing the ticker symbol, indicator name ('SMA'), a count of returned values, an array of timestamp/value pairs (and optionally signal and histogram fields), the data source ('massive'), and the as_of date of the calculation.","failureModes":["Invalid ticker symbol returns 404 or empty data","Window larger than available history returns partial or empty values array","Invalid timespan enum value returns 400 validation error","Limit exceeding 5000 returns validation error","Payment not provided returns HTTP 402 requiring USDC payment","Adjusted flag not recognized returns 400"],"whenToPreferThis":"Use this endpoint when you need pre-computed SMA technical indicator values for a US equity ticker and want to avoid implementing rolling average calculations yourself. Prefer this over raw OHLCV endpoints when the downstream task specifically requires a moving average signal (e.g., trend detection, crossover strategies). Best for agents performing technical analysis or screening stocks based on momentum indicators.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:51:29.218Z","isFirstParty":false}