# Alpaca Trade History via claw402 x402 Payment Gateway

> Alpaca Trade History via claw402 x402 Payment Gateway is a paid API for AI agents from claw402.ai, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

Retrieves historical trade records from Alpaca Markets, accessible via USDC micropayment with no API key or registration required.

## Facts

- Endpoint: GET https://claw402.ai/api/v1/alpaca/trades/history
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/alpaca-trade-history-via-claw402-x402-payment-gateway-7faa071b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3OLJBtKIusXAfG7U7FXYS

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 alpaca-trade-history-via-claw402-x402-payment-gateway-7faa071b
```

Example prompt: Pull the last 50 trades for AAPL and TSLA from Alpaca, sorted by newest first, between January 1 2025 and today.

## When to prefer this

Use this endpoint when you need Alpaca trade history without setting up an Alpaca API key or account, and you are comfortable paying $0.002 USDC per call via a crypto wallet. Ideal for AI agents operating in a wallet-native environment using the x402 payment protocol. Prefer over direct Alpaca API when keyless, registration-free access is desired.

## Known failure modes

- Payment not received or insufficient USDC balance — returns 402 Payment Required
- Invalid or unsupported symbol — returns empty data array
- Malformed date strings for start/end parameters — may return error or empty results
- Upstream Alpaca API unavailability — propagated error
- Limit parameter out of acceptable range — may be clamped or rejected

## How this service works

Backed by vergex.trade. Pay for any API with USDC. No API keys. No registration. Just a wallet.

## Output

A JSON object with a code field (0 for success) and a data array containing historical trade records matching the query filters such as symbol, date range, feed, sort order, and limit.

## 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"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "end": {
       "type": "string"
      },
      "feed": {
       "type": "string"
      },
      "sort": {
       "type": "string"
      },
      "limit": {
       "type": "string"
      },
      "start": {
       "type": "string"
      },
      "symbols": {
       "type": "string"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "code": 0,
  "data": []
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/alpaca-trade-history-via-claw402-x402-payment-gateway-7faa071b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from claw402.ai](https://www.zero.xyz/host/claw402.ai/llms.txt)
