{"uid":"cap_9ZPr6mNCXnWjOzTtB3VSp","slug":"x402stock-sma-indicator-76a6dd51","name":"x402stock SMA Indicator","description":"Pay-per-call market and economic data API for AI agents: US stocks, ETFs and options, forex, crypto and on-chain perps, energy commodities, US and global macro (Fed, CPI, jobs, GDP, Treasury, World Bank), SEC filings, congressional trades, and market sentiment. No API keys, no accounts. Pay per request in USDC via x402 on Base.","url":"https://x402stock.xyz/api/v1/indicators/sma/%7Bticker%7D","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":{"type":"json","example":{"data":{"count":2,"values":[{"value":275.2846,"timestamp":"2026-05-28T12:00:00.000Z"},{"value":274.0422,"timestamp":"2026-05-27T12:00:00.000Z"}],"indicator":"sma"},"as_of":"2026-05-28T12:00:00.000Z","source":"x402stock","ticker":"AAPL"}},"example":{"request":{"input":{"type":"http","method":"GET","pathParams":{"ticker":"AAPL"},"queryParams":{"limit":30,"window":50,"adjusted":true,"timespan":"day","series_type":"close"}}},"response":{"data":{"count":30,"values":[{"value":288.73999999999995,"timestamp":"2026-06-18T04:00:00.000Z"},{"value":287.95779999999996,"timestamp":"2026-06-17T04:00:00.000Z"},{"value":287.1087999999999,"timestamp":"2026-06-16T04:00:00.000Z"},{"value":286.30119999999994,"timestamp":"2026-06-15T04:00:00.000Z"},{"value":285.49119999999994,"timestamp":"2026-06-12T04:00:00.000Z"},{"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"}],"indicator":"sma"},"as_of":"2026-06-18T04: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_kPW0H0LwH3eZJYjLVc30-","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 configurable timespan, window, and price series type.","exampleAgentPrompt":"What's the 50-day simple moving average for AAPL using daily closing prices? Give me the last 30 data points.","exampleUseCases":null,"resultDescription":"A JSON object containing the ticker symbol, indicator name ('sma'), a count of returned values, an array of timestamp/value pairs representing historical SMA readings, the data source ('x402stock'), and an as-of timestamp.","failureModes":["Invalid or unsupported ticker symbol returns an error or empty data","Window size exceeding maximum of 2000 returns a validation error","Limit exceeding 5000 returns a validation error","Unsupported timespan or series_type enum value returns a 400-level error","Payment failure via x402/USDC results in a 402 Payment Required response","Insufficient historical data for the requested window may return fewer values than expected"],"whenToPreferThis":"Use this endpoint when you need Simple Moving Average technical indicator data for US stocks or ETFs without setting up an API key or subscription. It is ideal for AI agents doing technical analysis, trend detection, or signal generation on a pay-per-call basis using USDC on Base.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-08T18:30:01.617Z","isFirstParty":false}