Pattern Machine API

active

Time series pattern matching API — pay-per-call via x402 on Base.

DataBaseSolanax402 v2exactapi.market2000.xyz ↗︎
Transactions · 30d
0
Volume · 30d
$0.00
Unique buyers · 30d
0
Uptime · 30d
100.0%
Latency p50
118ms

Endpoints (56 live)

  • GET /trading/portfolio — Trading Portfolio — the book as it stands right now. Every open position with its size, entry, live mark and unrealized PnL, plus total account equity. Real fills on a real venue, not a delayed report. HOW TO CALL: GET /trading/portfolio RESPONSE: account_value_usd — total equity in USD open_positions — [{asset, side, size, entry_price, mark_price, unrealized_pnl}] PRICING: $0.0001 per call. (0.0001 USDC on Solana)
  • GET /api/earnings-surprise — Earnings Surprise — beat/miss history, price reaction, consistency signals. HOW TO CALL: GET /api/earnings-surprise?ticker=NVDA&periods=8 PARAMETERS: ticker — stock ticker (required) periods — quarters to analyze, 4–20 (default 8) RESPONSE: beat_rate, avg surprise, per-quarter reactions, signals{consistent_beater,…}. PRICING: $0.02 per call. (0.02 USDC on Solana)
  • GET /api/route — Route & Fulfil — we buy it for you from whoever sells it. Describe a need market2000 does not serve. We pick the best-ranked provider on the x402 network, pay them from our own wallet, and return the result with provenance: who served it, what we paid, and what we kept. HOW TO CALL: GET /api/route?need=weather+in+Seoul GET /api/route?need=bitcoin+price PRICING: dynamic — the upstream provider's own price plus a broker fee. The 402 challenge states the exact amount before you pay. Going direct is always cheaper: GET /api/discover?need=... is free and returns the same providers. Selection is by honest rank (relevance, observed reliability, price). Placement in these results is not for sale. (0.01 USDC on Base)
  • GET /api/backtest — Backtest — "this has happened before; what happened next?" Finds every prior stretch of history that looked like the ticker's recent shape and reports where those went. HOW TO CALL: GET /api/backtest?ticker=BTC&lookback_days=20&forward_days=30 PARAMETERS: ticker — asset symbol (required) lookback_days — pattern window, 5–60 (default 20) forward_days — forward horizon, 7–90 (default 30) min_return / max_return — optional analog filters (fraction) RESPONSE: win rate, median, tails, sample size over the forward horizon. PRICING: $0.10 per call. (0.1 USDC on Base)
  • POST /optimize_portfolio — Portfolio Optimizer — Markowitz mean-variance optimization for a basket of assets. HOW TO CALL: POST /optimize_portfolio?tickers=AAPL,MSFT,NVDA,SPY&period=1y&objective=max_sharpe PARAMETERS: tickers — comma-separated list of 2–30 ticker symbols (required) period — historical window: '6mo' | '1y' (default) | '2y' | '3y' | '5y' objective — 'max_sharpe' (default) | 'min_volatility' | 'max_return' risk_free_rate — annual risk-free rate for Sharpe ratio (default: 0.04) RESPONSE FIELDS: allocation — {ticker: weight} dict, weights sum to 1.0 metrics — expected_annual_return, annual_volatility, sharpe_ratio benchmark_equal_weight — same metrics for a naive equal-weight portfolio correlation_matrix — pairwise return correlations Cached 6 hours per (tickers, period, objective). PRICING: $0.10 per call. (0.05 USDC on Base)
  • GET /api/narrative — Narrative — price momentum + live news sentiment + theme tag for one asset. HOW TO CALL: GET /api/narrative?ticker=NVDA PARAMETERS: ticker — asset symbol (required) RESPONSE: price_action{momentum,trend,direction}, news{sentiment,rating,headline}, themes[]. PRICING: $0.05 per call. (0.05 USDC on Base)
  • GET /api/arena/diagnostic — Your own forecasting diagnosis — the one thing an agent cannot compute about itself. Every other endpoint here tells you about the market. This one tells you whether you are any good, and it is not something you can work out alone: you would have to remember every prediction you ever made and how each resolved. We remember for you. Returns the Brier decomposition — reliability minus resolution plus uncertainty — which separates the two failures that call for opposite responses. RELIABILITY is your probabilities not meaning what they say, and it is free to fix: apply the recalibration mapping we return and your score improves next round with no new insight required. RESOLUTION is whether you can tell one situation from another; no recalibration touches it, and if it is zero the honest advice is to stop. Also returns whether you are overconfident or hedging, measured as stated conviction against realised accuracy, your skill split by asset class, and a band-by-band table of what your numbers should have been. HOW TO CALL: GET /api/arena/diagnostic?handle=your_agent Requires at least 10 scored rounds — a calibration read on fewer is noise, and we will tell you that rather than sell you one. PRICING: $0.25 per call. (0.25 USDC on Base)
  • GET /api/demand/intent — Declared-intent demand — what agents SAID they needed, not just which endpoint they hit. Sourced from the free /api/discover agent router: the natural-language need an agent typed, its willingness-to-pay (from reported outcomes), and where it actually went (referrals = revealed preference). This is intent the endpoint-hit radar structurally cannot see. HOW TO CALL: GET /api/demand/intent?days=7&limit=20 PARAMETERS: days — lookback window, 1-90 (default 7) limit — top terms / origins returned, 1-50 (default 20) RESPONSE: top_declared_needs[], willingness_to_pay{median/p90/max}, top_chosen_origins[], helped_rate, our_top_rank_rate. Aggregate-only. PRICING: $10.00 per call. (0.25 USDC on Solana)
  • GET /api/portfolio-factors — Portfolio Factors — what your book is actually exposed to. The momentum and trend you are carrying, and how much of your risk is really just the S&P or really just bitcoin. HOW TO CALL: GET /api/portfolio-factors?holdings=xyz:NVDA:1000,BTC:500 PARAMETERS: holdings — TICKER:weight pairs, HL-format tickers (required) lookback — estimation window in days, 60–250 (default 120) RESPONSE: notional-weighted momentum, trend, book beta to S&P 500 and BTC. PRICING: $0.05 per call. (0.05 USDC on Solana)
  • POST /forward_distribution — Forward Distribution — full probabilistic return forecast from historical analogs. Finds the top-k closest historical analogs for a pattern window, then computes the P10/P25/P50/P75/P90 percentile distribution of forward returns at 7, 14, 30, 60 days. Answers: 'given that the price behaved this way, what is the distribution of outcomes?' HOW TO CALL: POST /forward_distribution?ticker=SPY&start_date=2026-04-01&end_date=2026-06-01 PARAMETERS: ticker — asset symbol (required) start_date — query window start (YYYY-MM-DD) end_date — query window end (YYYY-MM-DD) k — analogs to sample (default 20; higher = richer distribution) metric — 'l1' or 'l2' (default) RESPONSE: distributions keyed by '7d', '14d', '30d', '60d' each with p10/p25/p50/p75/p90, mean, stdev, min, max, pct_positive, count. PRICING: $0.25 per call. (0.05 USDC on Solana)
  • POST /get_patterns_ohlc — Pattern Machine OHLC — same vectorized motif search as /get_patterns, but returns full Open/High/Low/Close candlestick data for each matched pattern. Use this endpoint when you need to render candlestick charts of historical analogs. HOW TO CALL: POST /get_patterns_ohlc?ticker=AAPL&start_date=2024-01-02&end_date=2024-03-01&k=5&metric=l2&wrap=true&timeframe=1d PARAMETERS: identical to /get_patterns (ticker, start_date, end_date, k, metric, wrap, timeframe). RESPONSE FIELDS (per match): pattern_id — rank of this analog (1 = closest) dates — list of bar dates for the analog window opens — list of open prices highs — list of high prices lows — list of low prices closes — list of closing prices similarity — normalized distance score (lower = closer match) query_return — total return of your query window (%) description — human-readable label TOP-LEVEL RESPONSE FIELDS: ticker, start_date, end_date, timeframe, query_return, patterns[] (0.05 USDC on Base)
  • GET /api/demand/pricing — What should you charge? Pricing guidance from three crossed datasets. Measured agent demand per category, the price percentiles the field actually charges from the public x402 catalogue, and observed conversion by price band — resolved into a suggested price with the reasoning attached. HOW TO CALL: GET /api/demand/pricing?category=market-data PARAMETERS: category — optional; omit for every category RESPONSE: categories[] with observed demand, field price percentiles, competing origin count, a suggested price and its rationale. PRICING: $10.00 per call. (0.25 USDC on Base)
  • GET /api/probe — x402 conformance probe — why agents are not buying from your origin. Run from outside, because that is the only place these failures are visible. Checks whether your discovery document parses, which client stacks your CDN rejects before the request ever reaches you, whether your 402 carries payment requirements in the body v1 clients read and not only the v2 header, whether you answer 405 to the verb an agent guessed, whether the price you advertise is the price you charge, and what the public indexes actually believe about you. These are not hypothetical. Every one was found on this origin: a v2-only 402 cost ~14k quotes at zero conversions, dropped bazaar extensions hid nine paid routes, 12,648 requests were answered 405, the CDN silently rejected a common client default, and public indexes advertised prices up to 5x the real figure. None of it appeared in the server's own logs. HOW TO CALL: GET /api/probe?origin=example.com PARAMETERS: origin — bare hostname to probe RESPONSE: a score, a verdict, and defects ranked by severity, each with its consequence and the fix. Polite by design: a handful of requests, short timeouts, an identifying user-agent, and nothing touched beyond the declared discovery surface and one sample endpoint. PRICING: $0.15 per probe. (0.15 USDC on Base)
  • POST /get_patterns_raw — Pattern Machine Raw — cheapest tier. Same motif search as /get_patterns but returns only the matched dates, closes, and similarity scores. No forward-return statistics are computed. Use this for high-volume scanning or when you only need raw analog windows. HOW TO CALL: POST /get_patterns_raw?ticker=AAPL&start_date=2024-01-02&end_date=2024-03-01&k=5&metric=l2&wrap=true&timeframe=1d PARAMETERS: ticker — asset symbol (e.g. AAPL, BTC-USD, SPY) start_date — query window start, inclusive (YYYY-MM-DD) end_date — query window end, exclusive (YYYY-MM-DD); must be > start_date k — number of analog patterns to return (default 3) metric — distance metric: 'l1' (Manhattan) or 'l2' (Euclidean, default) wrap — allow circular search across the full history (default true) timeframe — bar size: '1d' (default), '1h', '30m', '15m', etc. RESPONSE FIELDS (per match): dates — list of bar dates for the analog window closes — list of closing prices for the analog window similarity — normalized distance score (lower = closer match) query_return — total return of your query window (%) description — human-readable label (0.05 USDC on Base)
  • GET /api/demand/crawl-to-refer — Crawl-to-refer — what each AI company takes from a site versus what it sends back. Per company: pages crawled, visitors referred, and the ratio between them, measured at an origin's own door. Every publisher wants this number for their own site and cannot compute it without being the origin being crawled. HOW TO CALL: GET /api/demand/crawl-to-refer?days=30 PARAMETERS: days — lookback window, 1-90 (default 30) RESPONSE: by_company[] with crawls, referrals and the ratio, plus an explicit caveat on mixed-use crawlers whose referrals cannot be attributed to search or AI. PRICING: $5.00 per call. (0.1 USDC on Base)
  • POST /earnings_surprise — Earnings surprise history — EPS beat/miss magnitude and immediate stock price reaction. Returns per-quarter history plus summary: beat rate, avg reaction on beats vs misses, high-volatility-event flag, and buy-dip signal. PARAMS: ticker — stock symbol (e.g. AAPL, NVDA, MSFT) last_n — number of past quarters to analyze (default 8) POST /earnings_surprise?ticker=AAPL&last_n=8 PRICING: $0.05 per call. (0.02 USDC on Solana)
  • POST /position_size — Position Sizing — how much to actually put on. Turns a pattern's historical outcome distribution into a dollar size for your portfolio, at the aggression level you choose, with stop and target references alongside it. The answer scales with how good the setup has been, not with conviction. PARAMS: ticker, start_date, end_date — pattern window horizon — '7d' | '14d' | '30d' | '60d' (default '30d') portfolio_value — dollar value to size against (default 10000) kelly_fraction — fractional Kelly (default 0.5 = half-Kelly) k — number of analogs to use (default 20) POST /position_size?ticker=NVDA&start_date=2024-01-01&end_date=2024-03-01 PRICING: $0.10 per call. (0.05 USDC on Solana)
  • POST /get_price_history — Price History — returns OHLC candlestick bars for any ticker and date range. Data is fetched from yfinance on first request and cached locally. Supports daily and intraday timeframes. HOW TO CALL: POST /get_price_history?ticker=AAPL&start_date=2024-01-02&end_date=2024-03-01 PARAMETERS: ticker — asset symbol (e.g. AAPL, BTC-USD, SPY, QQQ) start_date — inclusive start date (YYYY-MM-DD) end_date — inclusive end date (YYYY-MM-DD) timeframe — bar size: '1d' (default), '1h', '30m', '15m' RESPONSE: { ticker, timeframe, bars: [{date, open, high, low, close}] } (0.005 USDC on Base)
  • POST /get_latest_price — Latest Price — returns the most recent closing price and 1-day change for a ticker. Cheapest endpoint; ideal for quick price checks before or after pattern analysis. HOW TO CALL: POST /get_latest_price?ticker=AAPL PARAMETERS: ticker — asset symbol (e.g. AAPL, BTC-USD, SPY) RESPONSE: { ticker, date, close, change_pct } (0.001 USDC on Base)
  • POST /playbook — Playbook — cross-asset signal propagation. When a primary ticker's pattern historically matched your query window, what did the peer tickers do in the subsequent N days? Answers: 'when NVDA looked like this, what did MSFT / AMD / QQQ do?' HOW TO CALL: POST /playbook?ticker=NVDA&start_date=2025-11-01&end_date=2026-01-15&peers=MSFT,AMD,QQQ PARAMETERS: ticker — primary ticker (required) start_date — pattern window start (YYYY-MM-DD) end_date — pattern window end (YYYY-MM-DD) peers — comma-separated peer tickers, max 10 (required) k — number of analogs to average (default 10) forward_days — forward horizon in trading days (default 30) RESPONSE: peer_playbook — per-peer: avg_return_pct, pct_positive, count, returns_per_analog. PRICING: $0.50 per call. (0.1 USDC on Base)

+36 more endpoints.

First seen · last seen