# x402stock Portfolio X-Ray

> x402stock Portfolio X-Ray is a paid API for AI agents from agents.x402stock.xyz, paid per call via x402 or MPP, $0.25/call, status unknown (last checked 2026-10-12).

Performs an X-ray analysis of a portfolio of US-listed stocks, ETFs, or other securities, returning market, risk, or compositional insights for the provided holdings.

## Facts

- Endpoint: GET https://agents.x402stock.xyz/api/v1/portfolio/xray?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402, MPP
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-portfolio-x-ray-23ce327c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_pPQuRvAVmuBprdu40x8LU

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402stock-portfolio-x-ray-23ce327c
```

Example prompt: Can you run an x-ray on my portfolio — I hold AAPL, MSFT, SPY, and QQQ — and tell me what sectors I'm exposed to and how concentrated my positions are?

## When to prefer this

Choose this endpoint when you need a holistic, multi-dimensional view of a portfolio rather than data on a single ticker. It is ideal for risk assessment, diversification audits, rebalancing prep, or when an agent needs to synthesize position-level data into portfolio-level insights. Prefer this over single-ticker endpoints when the user has multiple holdings and wants aggregate analysis.

## Known failure modes

- Invalid or unrecognized ticker symbols return an error
- Malformed input schema returns 400-level error
- Payment not completed via x402/USDC results in 402 Payment Required
- Empty or missing properties field returns validation error
- Delisted or illiquid securities may return incomplete data

## How this service works

Risk x-ray for a whole watchlist or portfolio in one call. Pass `?tickers=AAPL,MSFT,NVDA` (up to 25; optional `?weights=`). Returns per-holding price, sector and cap, plus portfolio concentration (top-weight, Herfindahl, diversification score), sector concentration, market-cap distribution, weighted day performance and risk flags. Replaces dozens of per-holding calls. From x402stock

## Output

Returns a structured analysis of the submitted portfolio including sector allocations, position weights, concentration metrics, and potentially risk or exposure scores derived from current market data for each holding.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "properties": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "source",
  "as_of",
  "holding_count",
  "weighting",
  "sections",
  "summary",
  "holdings",
  "disclaimer"
 ],
 "properties": {
  "as_of": {
   "type": "string"
  },
  "source": {
   "type": "string",
   "const": "x402stock"
  },
  "summary": {
   "type": "object",
   "required": [
    "day_change_percent",
    "sector_concentration",
    "market_cap_distribution",
    "concentration",
    "performance",
    "risk_flags"
   ],
   "properties": {
    "risk_flags": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "performance": {
     "type": "object",
     "required": [
      "best",
      "worst"
     ],
     "properties": {
      "best": {
       "anyOf": [
        {
         "type": "object",
         "required": [
          "ticker",
          "change_percent"
         ],
         "properties": {
          "ticker": {
           "type": "string"
          },
          "change_percent": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "additionalProperties": false
        },
        {
         "type": "null"
        }
       ]
      },
      "worst": {
       "anyOf": [
        {
         "type": "object",
         "required": [
          "ticker",
          "change_percent"
         ],
         "properties": {
          "ticker": {
           "type": "string"
          },
          "change_percent": {
           "anyOf": [
            {
             "type": "number"
            },
            {
             "type": "null"
            }
           ]
          }
         },
         "additionalProperties": false
        },
        {
         "type": "null"
        }
       ]
      }
     },
     "additionalProperties": false
    },
    "concentration": {
     "type": "object",
     "required": [
      "top_weight",
      "top3_weight",
      "hhi",
      "diversification_score",
      "label"
     ],
     "properties": {
      "hhi": {
       "type": "number"
      },
      "label": {
       "type": "string"
      },
      "top_weight": {
       "type": "number"
      },
      "top3_weight": {
       "type": "number"
      },
      "diversification_score": {
       "type": "number"
      }
     },
     "additionalProperties": false
    },
    "day_change_percent": {
     "anyOf": [
      {
       "type": "number"
      },
      {
       "type": "nul
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-portfolio-x-ray-23ce327c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.x402stock.xyz](https://www.zero.xyz/host/agents.x402stock.xyz/llms.txt)
