# Market2000 Time Series Pattern Backtest API

> Market2000 Time Series Pattern Backtest API is a paid API for AI agents from market2000.xyz, paid per call via x402, $0.1/call, status unknown (last checked 2026-09-15).

Finds historical occurrences of a price pattern in a ticker's time series and returns the statistical distribution of forward returns following those patterns

## Facts

- Endpoint: GET https://market2000.xyz/pattern_backtest
- Price: $0.1/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/market2000-time-series-pattern-backtest-api-fe8b3e79
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_MjP2KgIrPQvJy-erNVW1I

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 market2000-time-series-pattern-backtest-api-fe8b3e79
```

Example prompt: Look up historical pattern matches for SPY where the 20-day return was between -5% and 0%, then show me the statistical distribution of what happened over the next 30 days — percentiles, mean, and win rate.

## When to prefer this

Use this endpoint when you need quantitative historical base rates for a specific price pattern in a named ticker — especially when you want forward return distributions (not just point estimates) to inform probabilistic market analysis. Prefer this over generic charting or news APIs when the user needs statistically grounded 'what happened next' data after similar historical setups.

## Known failure modes

- Ticker not found or unsupported — returns error indicating invalid symbol
- Insufficient historical data for the given lookback/forward combination — may return zero occurrences
- Invalid filter range (e.g. min > max return) — likely returns 400 validation error
- Payment failure via x402 on Base — call not processed if USDC payment is not confirmed
- Overly restrictive filters yielding zero matching windows — returns occurrences: 0 with empty example_windows

## How this service works

An origin the crawlers already index. We count what AI agents try to buy, what they are refused, and what the AI companies take without sending anyone back. Sold per call in USDC.

## Output

A JSON object containing: the ticker and window parameters used, total number of historical occurrences matching the pattern, example windows with their lookback and forward returns, and a full forward return distribution including p10/p25/p50/p75/p90 percentiles, mean, standard deviation, and percent of positive outcomes.

## 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",
    "queryParams"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "ticker"
     ],
     "properties": {
      "ticker": {
       "type": "string",
       "description": "Asset symbol"
      },
      "max_return": {
       "type": "number",
       "description": "Max window return as decimal e.g. 0.20 = 20% (default: no upper bound)"
      },
      "min_return": {
       "type": "number",
       "description": "Min window return as decimal e.g. 0.05 = 5% (default: no lower bound)"
      },
      "forward_days": {
       "type": "integer",
       "description": "Forward horizon to measure after window (default 30)"
      },
      "lookback_days": {
       "type": "integer",
       "description": "Window length to scan (default 20)"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "filter": {
       "type": "object"
      },
      "ticker": {
       "type": "string"
      },
      "occurrences": {
       "type": "integer"
      },
      "forward_days": {
       "type": "integer"
      },
      "generated_at": {
       "type": "string"
      },
      "lookback_days": {
       "type": "integer"
      },
      "example_windows": {
       "type": "array"
      },
      "forward_return_distribution": {
       "type": "object"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "filter": {
   "max_return_pct": 0,
   "min_return_pct": -5
  },
  "ticker": "SPY",
  "occurrences": 47,
  "forward_days": 30,
  "lookback_days": 20,
  "example_windows": [
   {
    "end": "2022-06-29",
    "start": "2022-06-01",
    "window_return_pct": -3.1,
    "forward_return_pct": 9.2
   }
  ],
  "forward_return_distribution": {
   "p10": -8.2,
   "p25": -2.1,
   "p50": 3.4,
   "p75": 7.8,
   "p90": 13.1,
   "mean": 2.9,
   "stdev": 7.6,
   "pct_positive": 61.7
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/market2000-time-series-pattern-backtest-api-fe8b3e79/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from market2000.xyz](https://www.zero.xyz/host/market2000.xyz/llms.txt)
