# x402stock Stock Comparison

> x402stock Stock Comparison is a paid API for AI agents from x402stock.xyz, paid per call via x402, $0.05/call, status unknown (last checked 2026-09-14, last successful call 2026-06-10).

Compare 2–3 US-listed stocks side-by-side, returning price, valuation, profitability, and dividend metrics for each ticker in one call

## Facts

- Endpoint: GET https://x402stock.xyz/api/v1/compare
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Last successful call: 2026-06-10
- Success rate: 75% of calls made through Zero
- Activations on Zero: 4
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402stock-xyz-3424f338
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_DHTllQU3f4B44cRUwlDmW

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-xyz-3424f338
```

Example prompt: Compare AAPL, MSFT, and NVDA side by side — I want to see their price and day change, market cap, P/E, EPS, revenue, gross and net margins, and dividend yield all in one shot.

## When to prefer this

Use this endpoint when you need a quick multi-metric side-by-side snapshot of 2–3 US stocks in a single API call. Prefer it over fetching individual stock endpoints when the goal is peer comparison, watchlist review, or ranking by fundamentals like margins or P/E. It is more efficient than calling per-ticker endpoints separately and returns a combined view of price, valuation, and profitability metrics together.

## Known failure modes

- Missing or empty tickers parameter returns 400 error
- More than 3 tickers may be unsupported or return partial data
- Unknown or delisted ticker returns null values for most fields with available flag indicating unavailability
- Payment failure (insufficient USDC balance) blocks the call via x402 protocol
- Network timeout if upstream snapshot or fundamentals data is delayed

## How this service works

Compare 2 to 3 US-listed stocks side by side (peer or watchlist comparisons). Pass a comma-separated list via `?tickers=AAPL,MSFT,NVDA` (1 to 3 symbols). Returns price and day change, market cap, P/E, EPS, revenue, gross and net margins, and dividend yield per ticker. Built for multiple stocks — for a single stock, `/api/v1/quote/{ticker}` is cheaper. From x402stock

## Output

Returns an array of rows, one per ticker, each containing: ticker symbol, company name, current price, day change percent, market cap, P/E ratio, EPS, revenue, gross margin percent, net margin percent, dividend yield percent, and an availability flag. Also includes source identifier and as-of timestamp.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "tickers": "AAPL,MSFT,GOOGL"
  }
 }
}
```

## Request schema (JSON Schema)

```json
{
 "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",
     "properties": {
      "tickers": {
       "type": "string"
      }
     },
     "additionalProperties": {}
    }
   },
   "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",
      "count",
      "tickers",
      "rows"
     ],
     "properties": {
      "note": {
       "type": "string"
      },
      "rows": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "ticker",
         "name",
         "price",
         "change_percent",
         "market_cap",
         "pe_ratio",
         "eps",
         "revenue",
         "gross_margin_percent",
         "net_margin_percent",
         "dividend_yield_percent",
         "available"
        ],
        "properties": {
         "eps": {
          "anyOf": [
           {
            "type": "number"
           },
           {
            "type": "null"
           }
          ]
         },
         "name": {
          "anyOf": [
           {
            "type": "string"
           },
           {
            "type": "null"
           }
          ]
         },
         "price": {
          "anyOf": [
           {
            "type": "number"
           },
           {
            "type": "null"
           }
          ]
         },
         "ticker": {
          "type": "string"
         },
         "revenue": {
          "anyOf": [
           {
            "type": "number"
           },
           {
            "type": "null"
           }
          ]
         },
         "pe_ratio": {
          "anyOf": [
           {
            "type": "number"
           },
           {
            "type": "null"
           }
          ]
         },
         "available": {
          "type": "string"
         },
  
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "rows": [
   {
    "eps": 8.26,
    "name": "Apple Inc.",
    "price": 311.35,
    "ticker": "AAPL",
    "revenue": 451442000000,
    "pe_ratio": 37.69,
    "available": "ok",
    "market_cap": 4589945623560,
    "change_percent": -0.371,
    "net_margin_percent": 27.15,
    "gross_margin_percent": 47.86,
    "dividend_yield_percent": 0.35
   },
   {
    "eps": 11.82,
    "name": "Microsoft Corporation",
    "price": 450.24,
    "ticker": "MSFT",
    "revenue": 270000000000,
    "pe_ratio": 38.1,
    "available": "ok",
    "market_cap": 3346000000000,
    "change_percent": 5.45,
    "net_margin_percent": 36.1,
    "gross_margin_percent": 69.4,
    "dividend_yield_percent": 0.66
   }
  ],
  "as_of": "2026-05-30T07:00:00.000Z",
  "count": 2,
  "source": "x402stock",
  "tickers": [
   "AAPL",
   "MSFT"
  ]
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402stock-xyz-3424f338/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402stock.xyz](https://www.zero.xyz/host/x402stock.xyz/llms.txt)
