> ## Documentation Index
> Fetch the complete documentation index at: https://docs.secapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /v1/factors/decomposition

> Return factor-attribution decomposition for a security over a bounded lookback window with explained return, alpha, and methodology metadata

Return factor-attribution decomposition for a security over a bounded lookback window with explained return, alpha, and methodology metadata

<Info>
  Audience: application and coding agent.
</Info>

## Canonical metadata

* `requestId`
* `traceparent`

## Example request

<RequestExample>
  ```bash theme={null}
  curl -X GET \
    -H "x-api-key: $SECAPI_API_KEY" \
    -H "secapi-version: 2026-03-19" \
    "https://api.secapi.ai/v1/factors/decomposition?symbol=AAPL&window=3m&response_mode=compact&include=trust"
  ```
</RequestExample>

## Example response

<ResponseExample>
  ```json theme={null}
  {
    "object": "factor_decomposition",
    "id": "factor_decomposition:AAPL:3m:2026-06-09",
    "symbol": "AAPL",
    "factorCategory": "style",
    "window": "3m",
    "asOf": "2026-06-09T22:15:00.000Z",
    "exposures": [
      {
        "object": "factor_exposure",
        "id": "factor_exposure:AAPL:VALUE:2026-06-09",
        "subjectType": "security",
        "subjectKey": "AAPL",
        "factorKey": "VALUE",
        "beta": -0.42,
        "percentile": 18.2,
        "confidence": "high",
        "modelName": "secapi_stock_basket_factor_model_v1",
        "asOf": "2026-06-09T22:15:00.000Z",
        "responseMode": "compact",
        "expansionHints": [
          "Use include=diagnostics or response_mode=standard for regression diagnostics such as rSquared, tStat, and observationCount."
        ]
      }
    ],
    "contributions": [
      {
        "factorKey": "MOMENTUM",
        "contributionPercent": 1.8,
        "explanation": "Momentum beta explained 180 bps of AAPL's selected-window return."
      }
    ],
    "summaryMd": "AAPL's selected-window return was mostly explained by momentum and quality exposure.",
    "stockReturn": 0.072,
    "totalExplained": 0.049,
    "alpha": 0.023,
    "rSquared": 0.68,
    "modelName": "secapi_stock_basket_factor_model_v1",
    "date": "2026-06-09",
    "responseMode": "compact",
    "dataAsOf": "2026-06-09",
    "freshnessStatus": "fresh",
    "methodologyVersion": "secapi_factor_returns_v1",
    "materializationVersion": "2026-06-09",
    "provenance": {
      "source": "secapi_factor_pipeline",
      "sourceLabel": "SecAPI factor pipeline",
      "accessionNumber": null,
      "filingUrl": "https://docs.secapi.ai/factors/methodology",
      "acceptedAt": null,
      "retrievedAt": "2026-06-09T22:15:00.000Z",
      "parserVersion": "secapi-factor-pipeline"
    },
    "freshness": {
      "status": "fresh",
      "asOf": "2026-06-09T22:15:00.000Z",
      "sourcePublishedAt": "2026-06-09T21:30:00.000Z",
      "lagMs": 2700000
    },
    "materialization": {
      "parserVersion": "secapi-factor-pipeline",
      "materializationVersion": "2026-06-09"
    },
    "sourceRights": {
      "source": "secapi_owned_factor_pipeline",
      "sourceLabel": "SecAPI factor pipeline",
      "posture": "public_safe",
      "publicAvailability": "public",
      "contractStatus": "approved",
      "restrictions": [],
      "notes": "SecAPI-owned derived factor data."
    },
    "methodology": {
      "id": "secapi_factor_returns",
      "version": "v1",
      "summary": "SecAPI-owned daily factor returns, exposures, and portfolio analytics built for agent and API workflows.",
      "confidence": "high",
      "launchState": "beta",
      "inputs": [
        "secapi_factor_returns",
        "secapi_factor_exposures",
        "market_calendar"
      ],
      "validation": {
        "launchHistoryFloor": "2015-01-01",
        "marketCalendarAware": true
      }
    },
    "revision": {
      "sourcePublishedAt": "2026-06-09T21:30:00.000Z",
      "retrievedAt": "2026-06-09T22:15:00.000Z",
      "vintageId": "2026-06-09",
      "revisedFrom": null
    },
    "degradedState": null,
    "requestId": "req_2ZK8Q1W9F4M6P7R3",
    "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
  }
  ```
</ResponseExample>

## Give this prompt to your agent

<Prompt>
  Use SEC API GET /v1/factors/decomposition to return factor-attribution decomposition for a security over a bounded lookback window with explained return, alpha, and methodology metadata. Preserve `requestId`, `traceparent` in the output. Return a concise markdown summary plus the exact structured payload fields that a downstream engineer or agent should keep using this result.
</Prompt>

## Failure posture

* treat non-2xx responses as contract-aware failures, not free-form errors
* preserve `requestId` and `traceparent` in logs and downstream reports
* if provenance or freshness metadata is present, return it unchanged so trust is not lost in the handoff
