Skip to main content

POST /v1/portfolio/attribution

Return factor return attribution for a portfolio with explained return, alpha, and compact contribution rows
Use this endpoint from server-side applications, SDKs, or agent workflows.

Response metadata

  • requestId
  • traceparent

Example request

curl -X POST \
  -H "x-api-key: $SECAPI_API_KEY" \
  -H "secapi-version: 2026-03-19" \
  -H "content-type: application/json" \
  -d '{
    "holdings": [
      {"symbol": "AAPL", "weight": 0.30},
      {"symbol": "MSFT", "weight": 0.25},
      {"symbol": "NVDA", "weight": 0.20},
      {"symbol": "JPM", "weight": 0.15},
      {"symbol": "XOM", "weight": 0.10}
    ],
    "lookback": "6m",
    "category": "style"
  }' \
  "https://api.secapi.ai/v1/portfolio/attribution?response_mode=compact"

Example response

{
  "requestId": "req_example_123",
  "traceparent": "00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01"
}

Give this prompt to your agent

Copy this SEC API prompt for your agent.

Errors and partial results

  • Treat non-2xx responses as API errors and log the response body for debugging
  • Log requestId and traceparent so SEC API support can trace the request
  • if provenance or freshness metadata is present, return it unchanged so trust is not lost in the handoff