# Stock Trends Developer Portal - LLM Guidance Developer portal: https://developer.stocktrends.com/ Canonical LLM/API usage guide for programmatic access: https://api.stocktrends.com/llms.txt Canonical API base: https://api.stocktrends.com/v1/ OpenAPI schema: https://api.stocktrends.com/v1/openapi.json Interactive API docs: https://api.stocktrends.com/v1/docs ## Role of this Portal developer.stocktrends.com is the onboarding, documentation, access, and developer guidance portal for the Stock Trends API. Use this portal to understand API access modes, documentation paths, plans, agent payment guidance, changelog context, and developer onboarding. Do not treat this portal descriptor as the canonical endpoint contract. For programmatic access, endpoint behavior, request schemas, response fields, authentication, payment requirements, pricing, and machine-readable tool metadata, start with: https://api.stocktrends.com/llms.txt ## API Positioning and Provenance Stock Trends is market context infrastructure. It augments external trading systems, portfolio processes, and AI agents with structured market context that an individual strategy usually cannot build for itself. It is not a raw market-data wrapper, and it is not a replacement trading strategy. An individual strategy generally sees the market through its own feature set or thesis: a momentum strategy sees momentum, a value strategy sees valuation, and a machine-learning model sees the features it was trained on. Stock Trends adds the surrounding context, classified consistently so it stays comparable across market cycles. Stock Trends supplies context across four layers: 1. Instrument context - trend classification, trend persistence or maturity, relative performance and direction, volume behaviour 2. Cross-sectional context - market breadth, sector breadth, relative-strength leadership, sector leadership rotation 3. Market context - Market Epoch structural state plus regime structure and participation; regime labels are bullish, bearish, or mixed 4. Portfolio context - portfolio evaluation, construction, comparison, and alignment with broader market conditions ST-IM, Market Epoch and market-regime intelligence, breadth and leadership analysis, portfolio workflows, and long-running Stock Trends strategies are applications built on one common Stock Trends classification framework. The API is the structured, agent-native delivery mechanism for all of them. The API is built around long-horizon Stock Trends classification history from 1980, with 16M+ observations interpreted through a consistent Stock Trends signal doctrine across decades. That provenance supports probabilistic research interpretation. It does not guarantee future performance, define price targets, or provide direct buy/sell commands. ## Inspectable Evidence Pillars Stock Trends exposes its record as endpoints rather than as claims. There are exactly three top-level evidence pillars. They have different histories, different methodologies, and different limitations. Do not combine them into a single performance claim, and do not present the evidence architecture as having two, four, or five primary records. Supporting records - the Stock Trends weekly publication history, which begins in 1993, and the Monte Carlo process simulations - sit underneath a pillar. They are important context but are not additional top-level pillars. 1. Historical classification provenance Consistent weekly classification records since 1980, 16M+ structured observations. A data foundation, not a performance result. 2. Realized statistical outcome evidence Mature ST-IM Select forward returns at 4, 13, and 40 weeks measured against base-period means, plus Monte Carlo analysis of repeated process application. The outcomes summary endpoint defaults to a trailing ten-year window; use start_date and end_date to select a different window. ST-IM realized outcomes are not the same thing as Monte Carlo process simulations. 3. Strategy and model-portfolio evidence Declared strategy rules, model-portfolio return histories, closed-position history, and portfolio-to-strategy provenance, exposed as endpoints: GET /v1/stocktrends/portfolios GET /v1/stocktrends/portfolios/{port_id} GET /v1/stocktrends/portfolios/{port_id}/returns GET /v1/stocktrends/portfolios/{port_id}/summary GET /v1/stocktrends/portfolios/{port_id}/positions/history GET /v1/stocktrends/strategies GET /v1/stocktrends/strategies/{strategy_id} GET /v1/stocktrends/portfolios/{port_id}/strategy POST /v1/portfolio/compare Return histories for the longest-running model portfolios begin in 1981 and continue to the current week. Note that this span is longer than the Stock Trends weekly publication record, which begins in 1993; do not describe the full portfolio history span as forward-published. These are rule-based model portfolio records with declared transaction-cost and stop-loss assumptions. They are not audited brokerage-account performance, not live client capital, and not a record of executed trades. Strategy conditions are metadata, not executable endpoints; these routes do not return current matching stocks, current buy or sell candidates, or current live holdings. Agents and researchers can inspect both the historical record and the rules or provenance associated with it, rather than treating Stock Trends as a black box. ## Key API Capability Areas The canonical API guide and machine-readable discovery resources describe these capability areas: - AI discovery and context - ST-IM (Stock Trends Inference Model) - STIM Select - Market Epoch structural market-state context - market regime intelligence - sector breadth intelligence - leadership and rotation intelligence - symbol-level decision evaluation - portfolio construction, evaluation, and comparison - published Stock Trends Intelligence Agent research and guidance (paid, REST API only; free discovery metadata and editorial preview) - pricing discovery and workflow cost estimation - subscription API-key access - x402 per-request machine payment access - agent-aware usage and metering where authenticated access allows it MPP funded session flows are live on the Stock Trends API. Use MPP for repeated funded agent workflows and use the current API documentation and OpenAPI specification as the authority for integration details. ## Access and Payment Surfaces Stock Trends intelligence is one layer. The surfaces below are complementary ways to reach it and to pay for premium usage. Do not describe them as separate intelligence products. Transports - how the intelligence reaches the caller: 1. REST API Direct programmatic integration for applications, services, trading systems, portfolio processes, and agents. The API is the authoritative intelligence contract. 2. MCP Tool-oriented access for MCP-compatible agents through the Stock Trends MCP server, a thin API adapter available as public Remote Streamable HTTP and separately available local stdio. See the MCP section below. Payment rails - how premium usage is paid for: 3. Subscription Managed API-key access with monthly quota and rate limits. 4. x402 Standard x402 V2 per-request machine payment, settled in USDC on Base (CAIP-2 network identifier eip155:8453). A conforming x402 V2 buyer requires no Stock Trends-specific payment integration: no proprietary Stock Trends payment headers, no manual token transfer, and no submission of a pre-existing transaction hash. The standard flow is a PAYMENT-REQUIRED challenge on HTTP 402, a client retry carrying PAYMENT-SIGNATURE, and a successful response carrying PAYMENT-RESPONSE. 5. MPP Funded session-based execution for repeated agent workflows. MPP consumes STC from an active payment session and does not use the x402 challenge flow. A payment rail is not a substitute for a transport. The public Remote MCP is an API-backed Streamable HTTP transport with three free tools and sixteen x402-paid tools. Separately gated local stdio subscription API-key mode remains distinct from the public Remote MCP. The Stock Trends API also recognises declared payment-metadata headers in the X-StockTrends-Payment-* family. These are not required by a conforming x402 V2 buyer and should not be presented as part of a standard x402 integration. Separate Stock Trends payment or session workflows may use additional metadata; consult the applicable API documentation for those workflows rather than assuming these headers carry over unchanged. ## Primary Portal Pages - Home: https://developer.stocktrends.com/ - Market structure (classification and breadth): https://developer.stocktrends.com/market-structure - Weekly Market Screens (STWR report catalog and REST usage): https://developer.stocktrends.com/weekly-screens - Stock Trends Intelligence Agent (published research and guidance): https://developer.stocktrends.com/intelligence - Documentation: https://developer.stocktrends.com/docs - Market Epochs: https://developer.stocktrends.com/market-epochs - MCP access: https://developer.stocktrends.com/mcp - ST-IM overview: https://developer.stocktrends.com/inference-model - Evidence and validation: https://developer.stocktrends.com/evidence-validation - x402 agent pay: https://developer.stocktrends.com/agent-pay - MPP funded sessions: https://developer.stocktrends.com/mpp - Plans: https://developer.stocktrends.com/plans - Access: https://developer.stocktrends.com/access - Changelog: https://developer.stocktrends.com/changelog ## Machine-Readable Resources Portal-level: - This descriptor: https://developer.stocktrends.com/llms.txt - AI plugin manifest: https://developer.stocktrends.com/.well-known/ai-plugin.json - Sitemap: https://developer.stocktrends.com/sitemap.xml Canonical API resources - authoritative for operational contracts: - Canonical API LLM guide: https://api.stocktrends.com/llms.txt - AI tools discovery: https://api.stocktrends.com/v1/ai/tools - AI context: https://api.stocktrends.com/v1/ai/context - Workflow registry: https://api.stocktrends.com/v1/workflows - Live pricing catalog: https://api.stocktrends.com/v1/pricing/catalog - Payment rails and identity headers: https://api.stocktrends.com/v1/pricing - Workflow cost estimate: https://api.stocktrends.com/v1/cost-estimate - Proof and evidence metadata: https://api.stocktrends.com/v1/ai/proof/market-edge - OpenAPI schema: https://api.stocktrends.com/v1/openapi.json - Interactive API docs: https://api.stocktrends.com/v1/docs There is deliberately no llms-full.txt on this portal. The full machine-readable detail lives in the live API resources listed above rather than in a static mirror, so a copy on this portal would only introduce duplication and staleness. Fetch the live resources instead. ## Classification-Based Market Structure Portal guide: https://developer.stocktrends.com/market-structure - Each instrument is classified weekly into one of six trend states from the relationship between price, its 13-week moving average, and its 40-week moving average: Bullish (^+), Weak Bullish (^-), Bullish Crossover (v^), Bearish (v-), Weak Bearish (v+), Bearish Crossover (^v). Neutral states (--, =) are outside the directional categories. - trend_cnt is weeks in the current specific state (persistence); mt_cnt is weeks in the current major category, bullish or bearish (maturity). Stock Trends RSI is 13-week performance relative to the S&P 500, baseline 100. - Breadth (GET /v1/breadth/sector/latest and /history) aggregates classifications by sector, industry group, or industry. bullish_pct is bullish / (bullish + bearish); neutral is excluded from that denominator. net_breadth is bullish - bearish. young_bullish_pct (trend_cnt <= 4) and mature_bullish_pct (trend_cnt >= 20) show new versus established participation. The default population is CS+UN on A/N/Q/T; population and include_unknown change scope. - Always state a breadth figure with its population and denominator. Do not compare figures computed over different populations as if they were the same measure. - Classification breadth complements conventional breadth (advance/decline, new highs and lows); it does not replace it. It is weekly and lags turning points by design. - Regime, breadth, and Market Epoch answer different questions. Regime is a directional participation score; its confidence label reflects score magnitude, not statistical confidence. ## Published Intelligence Artifacts Portal page: https://developer.stocktrends.com/intelligence The Stock Trends Intelligence Agent reads weekly Stock Trends evidence and publishes structured research and guidance. It is distinct from ST-IM: ST-IM produces probabilistic forward-return distributions, which are one input to the Agent. - GET /v1/intelligence/discovery - free; artifact types and access tiers (capability metadata, not current inventory) - GET /v1/intelligence/editorial/latest/preview - free; latest available Stock Trends editorial preview - GET /v1/intelligence/guidance/latest and /{artifact_id} - paid; market guidance: central claim, evidence values, competing interpretations with confidence, invalidation conditions, monitoring priorities, provenance - GET /v1/intelligence/research/latest and /{artifact_id} - paid; market research: guidance content plus a narrative report and sector-level detail Paid artifacts accept subscription, x402, or MPP over the REST API. They are not Remote MCP tools or resources. Prices come from GET /v1/pricing/catalog (rules intelligence_guidance_latest, intelligence_guidance_by_id, intelligence_research_latest, intelligence_research_by_id). Interpretation rules: - Artifacts are published weekly under owner authorization; requests never generate artifacts. A payment challenge is issued only when a valid artifact is available. - Each artifact carries a content_hash: SHA-256 over the stored envelope without content_hash, serialized as JSON with sorted keys, compact separators, and UTF-8 text. The same procedure applied to the API response reproduced the hash for the free artifacts checked on 2026-11-04. It is not guaranteed for every artifact, because the API omits top-level envelope fields whose value is null. A mismatch alone does not show the content was altered; treat content_hash as the published artifact identifier. - Treat a tied result at low confidence as a legitimate outcome, not a failure. - Do not describe the Agent as reasoning against prior weekly theses or as calibrating confidence with historical outcomes; neither is operational in current artifacts. - Artifacts are non-advisory market-structure research, not forecasts or buy/sell instructions. ## Market Epoch REST Context Market Epoch v1 is a frozen unsupervised K=3 classifier for persisted weekly structural market state, based on six aggregate Stock Trends features. It is not a trade signal, forward-return forecast, or causal AI. `separation_margin` is a centroid-distance diagnostic, not probability or forecast confidence; Maturity does not imply that reversal must follow. - GET /v1/market/epoch/latest - latest persisted Market Epoch snapshot - GET /v1/market/epoch/history - newest-first persisted Epoch history - Portal guide: https://developer.stocktrends.com/market-epochs These premium capabilities are available through the REST API with subscription, x402, or MPP access. The public Remote MCP also exposes the latest and history Market Epoch capabilities as x402-paid tools. ## Stock Trends MCP Portal page: https://developer.stocktrends.com/mcp Live Remote MCP: https://mcp.stocktrends.com/mcp The Stock Trends MCP server is an access surface over the Stock Trends API, not a second source of truth. The API defines the intelligence contract; MCP makes that intelligence easier for compatible agents to discover and invoke as tools. The adapter does not recompute Stock Trends classifications, ST-IM distributions, or indicators, does not reach the Stock Trends database or control plane, and does not generate advice, research, or guidance. Current public Remote MCP: - Transport: public Streamable HTTP at https://mcp.stocktrends.com/mcp. - Access: connecting and discovery are credential-free. No subscription API key is required. The three free tools need no payment authorization; the sixteen paid tools use the x402 V2 MCP payment exchange. - Surface: exactly ten public resources, three free tools, twelve paid GET tools, four paid POST tools, and zero prompts. - Resources: stocktrends://api/openapi, stocktrends://ai/context, stocktrends://ai/tools, stocktrends://workflows, stocktrends://methodology/stim, stocktrends://methodology/indicators, stocktrends://methodology/inference, stocktrends://pricing/catalog, stocktrends://proof/market-edge, and stocktrends://leadership/definitions. - Free tools: stocktrends_estimate_workflow_cost, stocktrends_lookup_instruments, and stocktrends_resolve_instrument. - Paid GET tools: stocktrends_get_stim_latest, stocktrends_get_stim_history, stocktrends_get_indicators_latest, stocktrends_get_indicators_history, stocktrends_get_selections_latest (base selections, not the published ST-IM Select list), stocktrends_get_market_regime_latest, stocktrends_get_market_regime_history, stocktrends_get_breadth_sector_latest, stocktrends_get_leadership_summary_latest, stocktrends_get_screener_top, stocktrends_get_market_epoch_latest, and stocktrends_get_market_epoch_history. - Paid POST tools: stocktrends_evaluate_symbol (POST /v1/decision/evaluate-symbol), stocktrends_construct_portfolio (POST /v1/portfolio/construct), stocktrends_evaluate_portfolio (POST /v1/portfolio/evaluate), and stocktrends_compare_portfolios (POST /v1/portfolio/compare). - Paid Remote MCP execution is x402 only. The adapter does not forward a customer subscription API key and does not provide MPP or OAuth subscriber login through the public MCP. - Published Stock Trends Intelligence Agent research and guidance (GET /v1/intelligence/research/* and GET /v1/intelligence/guidance/*) are paid REST API products. They are not Remote MCP tools or resources. - For a paid tool, an initial MCP call receives API-authored payment requirements. A payment-capable client supplies authorization in MCP metadata as x402/payment; the adapter forwards it upstream as PAYMENT-SIGNATURE and returns settlement metadata as x402/payment-response. These MCP metadata fields are not client-supplied HTTP headers. The Remote MCP is not a wallet. - The adapter binds a pending POST challenge to its canonical request body in its own challenge state. Do not claim that an EIP-3009 signature independently cryptographically signs the analytical JSON body. Do not automatically retry a payment-bearing call after an uncertain settlement outcome; a settled API error may still represent paid execution. Local stdio remains separately available: - npm package: @stocktrends-publications/stocktrends-mcp-server (Node.js 20+). - Local API-key configurations and paid local tools are separately gated and are distinct from the public Remote MCP. - Local stdio paid tools use separately gated subscription API-key calls to the REST API. An optional default-off x402 mode only relays approved HTTP 402 challenge metadata for inspection; it does not make payments, forward payment proof, send payment headers, return paid API data, or spend. - Market Epoch latest and history are also x402-paid Remote MCP tools. ## Investigate Before Spending An agent can understand the service and estimate the cost before any premium execution. These endpoints are public under current API behaviour: - GET /v1/ai/tools - capability and workflow discovery - GET /v1/ai/context - indicator definitions and dataset grounding - GET /v1/workflows - task-level workflows and endpoint sequences - GET /v1/instruments/resolve and GET /v1/instruments/lookup - symbol resolution - GET /v1/pricing/catalog - live per-endpoint pricing and supported rails - GET /v1/cost-estimate - workflow-level cost planning - GET /v1/ai/proof/market-edge - signal-structure evidence - GET /v1/meta/stim, /v1/meta/indicators, /v1/meta/inference, /v1/meta/stwr - methodology metadata - GET /v1/leadership/definitions - leadership taxonomy - GET /v1/stocktrends/portfolios and GET /v1/stocktrends/strategies - strategy and model-portfolio evidence - GET /v1/selections/stim-select/outcomes/summary - realized outcome evidence - GET /v1/intelligence/discovery - published intelligence artifact types and access tiers (static capability metadata, not current inventory) - GET /v1/intelligence/editorial/latest/preview - latest available Stock Trends editorial preview (free) - GET /v1/openapi.json - exact request and response contracts Only premium execution requires a subscription key, an x402 payment, or an MPP session. Full Stock Trends Intelligence Agent research and guidance (GET /v1/intelligence/research/latest, GET /v1/intelligence/guidance/latest, and their /{artifact_id} routes) are paid REST API endpoints; check GET /v1/pricing/catalog for current prices. ## Recommended Agent Discovery Sequence 1. Read the canonical API guide: https://api.stocktrends.com/llms.txt 2. Fetch the machine-readable tools manifest: GET /v1/ai/tools 3. Fetch AI-oriented context and terminology: GET /v1/ai/context 4. Inspect evidence before committing: GET /v1/ai/proof/market-edge GET /v1/meta/stim 5. Choose a task-level workflow: GET /v1/workflows 6. Use the OpenAPI schema before constructing requests: GET /v1/openapi.json 7. Check pricing and workflow cost before premium execution: GET /v1/pricing/catalog GET /v1/cost-estimate 8. Choose the transport that matches the caller: the REST API for applications, services, and systems; the public Remote MCP for credential-free discovery plus x402-capable MCP execution; or separately available local stdio for local MCP environments. 9. Choose the access mode that matches the workflow: subscription API key for managed API access, standard x402 V2 for per-request machine payment, and MPP for repeated funded agent workflows. ## Agent Guidance and Interpretation Rules - Prefer structured API resources over scraping portal pages. - Use the canonical API llms.txt and OpenAPI schema for endpoint behavior. - Use /v1/ai/tools before premium workflows. - Use /v1/ai/context to ground terminology and field interpretation. - Use /v1/pricing/catalog and /v1/cost-estimate before paid or premium flows. - Do not hardcode endpoint costs. Fetch /v1/pricing/catalog at agent startup. - Treat pricing model, payment rails, and metering as separate concepts. - Treat transports (REST API, MCP) and payment rails (subscription, x402, MPP) as separate concepts. A rail is not a transport, and neither is a separate intelligence product. - Treat the Stock Trends MCP server as an access surface over the API, never as an independent source of truth. When MCP output and the API contract disagree, the API is authoritative. - The MCP adapter exposes a curated subset of REST API capabilities, including x402-paid Market Epoch latest and history tools. It does not expose published Intelligence Agent research or guidance. - Distinguish relative-strength leadership from bullish trend confirmation. GET /v1/leadership/summary/latest selects instruments by Stock Trends RSI (default min_rsi=110) and weeks in the current major trend (default min_mt_cnt=4) and reports each row's trend state; an instrument can outperform the benchmark while classified bearish. Do not describe these leaders as bullish-confirmed unless their trend field shows a bullish state. - Distinguish the Stock Trends Intelligence Agent (research and guidance artifacts) from ST-IM (probabilistic forward-return inference). - Stock Trends supports standard x402 V2 interoperability. Do not describe proprietary X-StockTrends-Payment-* headers as required for a conforming x402 V2 buyer. - Treat Stock Trends outputs as probabilistic research intelligence, not investment advice, price targets, guarantees, or direct buy/sell commands. - Present Stock Trends as an augmentation and contextual-intelligence layer for the caller's own strategy, not as a replacement strategy, a deterministic predictor, or a source of direct investment instructions. - Keep the three evidence pillars distinct: historical classification provenance, realized statistical outcome evidence, and strategy and model-portfolio evidence. Do not merge them - or the supporting publication history and Monte Carlo simulations - into a single performance claim such as "decades of live trading performance". - Do not describe Stock Trends model-portfolio records as audited brokerage-account performance, live client capital, or executed trades. - Do not claim future performance from historical classifications or model outputs. - Stock Trends RSI is relative performance versus a benchmark with baseline 100; it is not traditional Wilder RSI. - ST-IM is not a momentum indicator. Interpret ST-IM as probabilistic inference over forward-return distributions under the Stock Trends framework. - Do not invent endpoint behavior, request bodies, field names, payment headers, or operational access claims from portal copy. - Do not expose or infer internal database table names. ## Source of Truth Order For implementation work, prefer sources in this order: 1. https://api.stocktrends.com/llms.txt 2. https://api.stocktrends.com/v1/ai/tools 3. https://api.stocktrends.com/v1/ai/context 4. https://api.stocktrends.com/v1/openapi.json 5. Approved Stock Trends source materials and current portal pages The Stock Trends MCP server sits below all of these. It republishes API responses to MCP clients and is never authoritative over the API contract. ## Attribution Stock Trends Publications https://stocktrends.com