{"uid":"cap_pmqHPli1uJI2ORnIKAq9j","slug":"x402stock-portfolio-x-ray-227e328a","name":"x402stock Portfolio X-Ray","description":"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","url":"https://x402stock.xyz/api/v1/portfolio/xray","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":["tickers"],"properties":{"tickers":{"type":"string","minLength":1},"weights":{"type":"string"}},"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":["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":"null"}]},"sector_concentration":{"type":"object","required":["hhi","label","coverage","top_sectors"],"properties":{"hhi":{"type":"number"},"label":{"type":"string"},"coverage":{"type":"number"},"top_sectors":{"type":"array","items":{"type":"object","required":["sector","weight"],"properties":{"sector":{"type":"string"},"weight":{"type":"number"}},"additionalProperties":false}}},"additionalProperties":false},"market_cap_distribution":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"additionalProperties":false},"holdings":{"type":"array","items":{"type":"object","required":["ticker","name","price","change_percent","market_cap","sector","cap_bucket","weight"],"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"price":{"anyOf":[{"type":"number"},{"type":"null"}]},"sector":{"anyOf":[{"type":"string"},{"type":"null"}]},"ticker":{"type":"string"},"weight":{"type":"number"},"cap_bucket":{"type":"string"},"market_cap":{"anyOf":[{"type":"number"},{"type":"null"}]},"change_percent":{"anyOf":[{"type":"number"},{"type":"null"}]}},"additionalProperties":false}},"sections":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"weighting":{"enum":["equal","custom"],"type":"string"},"disclaimer":{"type":"string"},"holding_count":{"type":"number"}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"as_of":"2026-06-08T12:00:00.000Z","source":"x402stock","summary":{"risk_flags":["sector_concentration","few_holdings"],"performance":{"best":{"ticker":"NVDA","change_percent":1.6},"worst":{"ticker":"AAPL","change_percent":0.2}},"concentration":{"hhi":0.3333,"label":"moderate","top_weight":0.3333,"top3_weight":1,"diversification_score":66.7},"day_change_percent":0.82,"sector_concentration":{"hhi":0.56,"label":"high","coverage":1,"top_sectors":[{"sector":"Electronic Computers","weight":0.6667},{"sector":"Services-Prepackaged Software","weight":0.3333}]},"market_cap_distribution":{"mid":0,"mega":1,"large":0,"micro":0,"small":0,"unknown":0}},"holdings":[{"name":"Apple Inc.","price":205.4,"sector":"Electronic Computers","ticker":"AAPL","weight":0.3333,"cap_bucket":"mega","market_cap":3100000000000,"change_percent":0.2},{"name":"Microsoft Corp","price":462.1,"sector":"Services-Prepackaged Software","ticker":"MSFT","weight":0.3333,"cap_bucket":"mega","market_cap":3400000000000,"change_percent":0.7},{"name":"NVIDIA Corp","price":138.9,"sector":"Electronic Computers","ticker":"NVDA","weight":0.3333,"cap_bucket":"mega","market_cap":3300000000000,"change_percent":1.6}],"sections":{"prices":"ok","profiles":"ok"},"weighting":"equal","disclaimer":"Factual quantitative analysis, not investment advice. Inputs are delayed/periodic; verify before acting.","holding_count":3}},"example":{"request":{"input":{"type":"http","method":"GET","queryParams":{"tickers":"AAPL,MSFT,NVDA"}}},"response":{"as_of":"2026-06-16T17:20:11.290Z","source":"x402stock","summary":{"risk_flags":["few_holdings"],"performance":{"best":{"ticker":"AAPL","change_percent":0.931},"worst":{"ticker":"MSFT","change_percent":-1.98}},"concentration":{"hhi":0.3333,"label":"moderate","top_weight":0.3333,"top3_weight":0.9999,"diversification_score":66.7},"day_change_percent":-0.896,"sector_concentration":{"hhi":0.3333,"label":"moderate","coverage":0.9999,"top_sectors":[{"sector":"ELECTRONIC COMPUTERS","weight":0.3333},{"sector":"SERVICES-PREPACKAGED SOFTWARE","weight":0.3333},{"sector":"SEMICONDUCTORS & RELATED DEVICES","weight":0.3333}]},"market_cap_distribution":{"mid":0,"mega":0.9999,"large":0,"micro":0,"small":0,"unknown":0}},"holdings":[{"name":"Apple Inc.","price":299.18,"sector":"ELECTRONIC COMPUTERS","ticker":"AAPL","weight":0.3333,"cap_bucket":"mega","market_cap":4353626065520,"change_percent":0.931},{"name":"Microsoft Corp","price":391.8388,"sector":"SERVICES-PREPACKAGED SOFTWARE","ticker":"MSFT","weight":0.3333,"cap_bucket":"mega","market_cap":2969591057271.04,"change_percent":-1.98},{"name":"Nvidia Corp","price":208.955,"sector":"SEMICONDUCTORS & RELATED DEVICES","ticker":"NVDA","weight":0.3333,"cap_bucket":"mega","market_cap":5145751450000,"change_percent":-1.64}],"sections":{"prices":"ok","profiles":"ok"},"weighting":"equal","disclaimer":"Factual quantitative analysis, not investment advice. Inputs are delayed/periodic; verify before acting.","holding_count":3}},"exampleRequest":{"tickers":"AAPL,MSFT,NVDA"},"tags":["x402"],"displayCostAmount":"0.25","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.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_S9wyijzqyHG0JcHdzae1o","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Analyzes a portfolio of US stock tickers by returning pricing, sector concentration, diversification scores, market-cap distribution, and risk flags for a given set of holdings.","exampleAgentPrompt":"Can you run a portfolio x-ray on my three stocks — AAPL, MSFT, and NVDA — with equal weights, and tell me how diversified I am, which sectors I'm concentrated in, and which one moved the most today?","exampleUseCases":null,"resultDescription":"Returns a structured portfolio analysis including: each holding's current price, day change percent, sector, market cap, and weight; portfolio-level day change percent; sector concentration HHI and label; market cap bucket distribution (mega/large/mid/small/micro); diversification score; top3 weight concentration; best and worst performing tickers today; and a list of risk flags (e.g. sector_concentration, few_holdings). Also indicates whether equal or custom weighting was applied.","failureModes":["Invalid or unrecognized ticker symbols return partial data or errors for those holdings","Weights string length or format mismatch with tickers list causes validation error","Missing required 'tickers' query parameter returns 400 error","Payment in USDC not provided or rejected results in 402 Payment Required","Market data may be delayed or unavailable outside trading hours","Truncated or malformed query parameters may cause schema validation failure"],"whenToPreferThis":"Use this endpoint when you need a holistic, multi-metric portfolio analysis (diversification, sector, market cap, risk flags, and performance) for a custom list of US stock tickers in a single call, rather than querying individual stock prices or metrics separately. Especially useful for AI agents that need structured, ready-to-interpret portfolio health summaries without building the analytics themselves.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:56:58.801Z","isFirstParty":false}