⚡ claw402 — Pay-Per-Call Market Data & AI APIs
200+ professional data endpoints. $0.001–$0.05 per call. One Base wallet.
Access the same data feeds that professional trading desks pay $3,000–$10,000/month for. Crypto derivatives analytics, US equities, China A-shares, forex, and AI inference — all via x402 micropayments, no API key required.
The Story — How $1,000 Became $800,000
Three months ago I had $1,000 in a Base wallet and an OpenClaw agent running on my laptop.
I asked the agent: "Which coins have the most extreme funding rates right now?"
The agent called claw402, paid $0.001 USDC, and came back with:
DOGE funding rate: +0.312%/8h (annualized 341%)
PEPE funding rate: +0.287%/8h
WIF funding rate: +0.241%/8h
I cross-checked: "CVD? What are whales doing on HyperLiquid?" Two more calls. $0.002 total.
CVD (last 6h): fading fast. Sellers pressing.
Top HyperLiquid whale: Short DOGE $2.1M, opened 2h ago.
I shorted DOGE. 40x. Three days later: +80,000%. That's $800,000 from $1,000. And less than $0.01 spent on data.
When to Use This Skill
Use claw402 whenever the user asks about any of the following:
🔮 Crypto Derivatives & Market Structure
- Fear & greed index, altcoin season, market cycle indicators (AHR999, Pi Cycle, Puell)
- Fund flow & capital rotation by coin or exchange
- Liquidations — orders, heatmaps, clusters, aggregated history
- Open interest — real-time, aggregated chart, OI vs market cap
- Funding rates — current rankings, accumulated cost, weighted average, heatmap
- Long/short ratios — realtime, buy/sell, whale position, account level
- Whale activity — HyperLiquid top positions & actions, large block trades, big orders
- ETF flows — US Bitcoin ETF, US Ethereum ETF, Hong Kong crypto ETF
- AI trading signals — AI500 high-potential coins, AI300 quant rankings
- Taker flow / CVD — cumulative delta, buy/sell pressure across exchanges
- Order book depth history, liquidity heatmap
- Crypto news & flash alerts
📈 US Stocks & Options
- Real-time & historical quotes, trades, OHLCV bars for any US stock
- Market snapshots — full quote + bar + prev close in one call
- Top movers by % change, most active stocks by volume
- Financial news for any ticker
- Options chains — bars, quotes, snapshots for options contracts
- Corporate actions — dividends, splits
🇨🇳 China A-Shares
- Daily, weekly, monthly OHLCV for any A-share
- Stock basic info, trading calendar
- Fundamentals — income statement, balance sheet, cash flow, dividends
- Northbound capital flow (Hong Kong → mainland)
- Money flow, margin trading data, top lists, institutional trading
💹 US Stock Fundamentals & Technical Indicators
- Real-time quotes, daily/intraday/weekly/monthly OHLCV
- Company overview, earnings, income, balance sheet, cash flow
- Top gainers/losers, news sentiment
- RSI, MACD, Bollinger Bands, SMA, EMA
🌍 Forex, Metals & Global Time-Series
- EUR/USD, GBP/USD and any forex pair — tick or time-series
- Precious metals price and history — XAU/USD (gold), XAG/USD (silver)
- Global indices — list and real-time quotes
- Exchange rates, forex pairs reference, economic calendar
- Technical indicators — RSI, MACD, SMA, EMA, Bollinger Bands, ATR
🤖 AI Inference (GPT-4o, Claude, Embeddings, Images)
- OpenAI GPT-4o chat, GPT-4o-mini, embeddings (small + large), DALL-E images
- Anthropic Claude messages (standard, Haiku, Opus)
- Use to analyze market data your agent just fetched — chain calls in one session
Cost & Privacy
| Item |
Detail |
| Crypto / stock data |
$0.001–$0.003 USDC per call |
| Twelvedata complex POST |
$0.005 USDC per call |
| OpenAI GPT-4o chat |
$0.01 USDC per call |
| OpenAI mini / embeddings |
$0.001–$0.005 USDC per call |
| Claude messages |
$0.01–$0.015 USDC per call |
| Payment chain |
Base mainnet (Coinbase L2) |
| Payment method |
EIP-3009 USDC transfer, signed locally |
| Key security |
Private key never transmitted — signs locally only |
| API key required |
No — wallet is your credential |
| Registration |
Never |
Get USDC on Base: bridge.base.org · Testnet USDC: faucet.circle.com
Quick Start
1. Set your wallet key
WALLET_PRIVATE_KEY=0xYourBaseWalletPrivateKey
Your wallet must hold USDC on Base mainnet.
2. Query any GET endpoint
node scripts/query.mjs <endpoint-path> [key=value ...]
3. Call POST endpoints (AI / Twelvedata complex)
node scripts/query.mjs <endpoint-path> --post '<json-body>'
4. Read the result
The script prints { status, url, data } as formatted JSON. Parse data for the actual payload.
Query Examples
Crypto Market Data
# --- Market Cycle & Sentiment ---
node scripts/query.mjs /api/v1/coinank/indicator/fear-greed
node scripts/query.mjs /api/v1/coinank/indicator/altcoin-season
node scripts/query.mjs /api/v1/coinank/indicator/btc-multiplier
node scripts/query.mjs /api/v1/coinank/indicator/ahr999
# --- Fund Flow ---
node scripts/query.mjs /api/v1/nofx/netflow/top-ranking limit=20 duration=1h
node scripts/query.mjs /api/v1/coinank/fund/realtime sortBy=h1net productType=SWAP
# --- Liquidations ---
node scripts/query.mjs /api/v1/coinank/liquidation/orders baseCoin=BTC
node scripts/query.mjs /api/v1/coinank/liquidation/liq-map symbol=BTCUSDT exchange=Binance interval=1d
# --- Open Interest ---
node scripts/query.mjs /api/v1/coinank/oi/all baseCoin=BTC
node scripts/query.mjs /api/v1/nofx/oi/top-ranking limit=20 duration=1h
# --- Funding Rates ---
node scripts/query.mjs /api/v1/coinank/funding-rate/current type=current
node scripts/query.mjs /api/v1/nofx/funding-rate/top limit=20
# --- Whale Tracking ---
node scripts/query.mjs /api/v1/coinank/hyper/top-position sortBy=pnl sortType=desc
node scripts/query.mjs /api/v1/coinank/hyper/top-action
# --- ETF Flows ---
node scripts/query.mjs /api/v1/coinank/etf/us-btc-inflow
node scripts/query.mjs /api/v1/coinank/etf/us-eth-inflow
# --- AI Signals ---
node scripts/query.mjs /api/v1/nofx/ai500/list limit=20
node scripts/query.mjs /api/v1/nofx/ai300/list limit=20
# --- CVD / Taker Flow ---
node scripts/query.mjs /api/v1/coinank/market-order/agg-cvd exchanges= symbol=BTCUSDT interval=1h size=24
# --- Price & Candles ---
node scripts/query.mjs /api/v1/coinank/price/last symbol=BTCUSDT exchange=Binance productType=SWAP
node scripts/query.mjs /api/v1/coinank/kline/lists symbol=BTCUSDT exchange=Binance interval=1h size=100
# --- News ---
node scripts/query.mjs /api/v1/coinank/news/list type=2 lang=en page=1 pageSize=10
US Stocks — Alpaca
# Real-time quote
node scripts/query.mjs /api/v1/alpaca/quotes/latest symbols=AAPL,TSLA,MSFT
# Historical bars
node scripts/query.mjs /api/v1/alpaca/bars symbols=AAPL timeframe=1Day start=2024-01-01 limit=30
# Market snapshot (quote + bar + prev close)
node scripts/query.mjs /api/v1/alpaca/snapshots symbols=AAPL,TSLA
# Top movers
node scripts/query.mjs /api/v1/alpaca/movers top=10 market_type=stocks
# Most active stocks
node scripts/query.mjs /api/v1/alpaca/most-actives top=10
# Latest trade
node scripts/query.mjs /api/v1/alpaca/trades/latest symbols=AAPL
# Financial news
node scripts/query.mjs /api/v1/alpaca/news symbols=AAPL limit=10
# Options chain snapshot
node scripts/query.mjs /api/v1/alpaca/options/snapshots symbols=AAPL240119C00150000
US Stocks — Polygon
# OHLCV bars
node scripts/query.mjs /api/v1/polygon/aggs/ticker stocks_ticker=AAPL multiplier=1 timespan=day from=2024-01-01 to=2024-01-31
# Previous close
node scripts/query.mjs /api/v1/polygon/prev-close stocks_ticker=AAPL
# Snapshot (full quote + bar)
node scripts/query.mjs /api/v1/polygon/snapshot/ticker stocks_ticker=AAPL
# Top gainers/losers
node scripts/query.mjs /api/v1/polygon/snapshot/gainers
node scripts/query.mjs /api/v1/polygon/snapshot/losers
# Company details
node scripts/query.mjs /api/v1/polygon/ticker-details ticker=AAPL
# Market status
node scripts/query.mjs /api/v1/polygon/market-status
# Technical indicators
node scripts/query.mjs /api/v1/polygon/rsi stock_ticker=AAPL timespan=day window=14
node scripts/query.mjs /api/v1/polygon/macd stocks_ticker=AAPL timespan=day
# Options chain
node scripts/query.mjs /api/v1/polygon/options/snapshot underlying_asset=AAPL
# News
node scripts/query.mjs /api/v1/polygon/ticker-news ticker=AAPL
US Stocks — Alpha Vantage Fundamentals
# Real-time quote
node scripts/query.mjs /api/v1/stocks/us/quote symbol=AAPL
# Daily OHLCV
node scripts/query.mjs /api/v1/stocks/us/daily symbol=AAPL outputsize=compact
# Intraday
node scripts/query.mjs /api/v1/stocks/us/intraday symbol=AAPL interval=5min
# Company overview
node scripts/query.mjs /api/v1/stocks/us/overview symbol=AAPL
# Earnings history
node scripts/query.mjs /api/v1/stocks/us/earnings symbol=AAPL
# Financial statements
node scripts/query.mjs /api/v1/stocks/us/income symbol=AAPL
node scripts/query.mjs /api/v1/stocks/us/balance-sheet symbol=AAPL
node scripts/query.mjs /api/v1/stocks/us/cash-flow symbol=AAPL
# Top gainers/losers/most active
node scripts/query.mjs /api/v1/stocks/us/movers
# News & sentiment
node scripts/query.mjs /api/v1/stocks/us/news tickers=AAPL
# Technical indicators
node scripts/query.mjs /api/v1/stocks/us/rsi symbol=AAPL interval=daily time_period=14
node scripts/query.mjs /api/v1/stocks/us/macd symbol=AAPL interval=daily
node scripts/query.mjs /api/v1/stocks/us/bbands symbol=AAPL interval=daily time_period=20
China A-Shares — Tushare
# Stock list (all listed stocks)
node scripts/query.mjs /api/v1/stocks/cn/stock-basic list_status=L
# Daily OHLCV
node scripts/query.mjs /api/v1/stocks/cn/daily ts_code=000001.SZ start_date=20240101 end_date=20240131
# Trading calendar
node scripts/query.mjs /api/v1/stocks/cn/trade-cal start_date=20240101 end_date=20240131
# Northbound capital flow
node scripts/query.mjs /api/v1/stocks/cn/northbound trade_date=20240315
# Money flow
node scripts/query.mjs /api/v1/stocks/cn/moneyflow ts_code=000001.SZ start_date=20240101
# Margin trading data
node scripts/query.mjs /api/v1/stocks/cn/margin ts_code=000001.SZ start_date=20240101
# Top list (dragon tiger list)
node scripts/query.mjs /api/v1/stocks/cn/top-list trade_date=20240315
# Fundamentals
node scripts/query.mjs /api/v1/stocks/cn/income ts_code=000001.SZ period=20231231
node scripts/query.mjs /api/v1/stocks/cn/balance-sheet ts_code=000001.SZ period=20231231
Forex & Global Time-Series — Twelve Data
# Time series — EUR/USD hourly
node scripts/query.mjs /api/v1/twelvedata/time-series symbol=EUR/USD interval=1h outputsize=50
# Real-time price
node scripts/query.mjs /api/v1/twelvedata/price symbol=BTC/USD
node scripts/query.mjs /api/v1/twelvedata/price symbol=XAU/USD
# Exchange rate
node scripts/query.mjs /api/v1/twelvedata/exchange-rate symbol=USD/JPY
# Technical indicators
node scripts/query.mjs /api/v1/twelvedata/indicator/rsi symbol=AAPL interval=1day time_period=14 outputsize=10
node scripts/query.mjs /api/v1/twelvedata/indicator/macd symbol=EUR/USD interval=1h
node scripts/query.mjs /api/v1/twelvedata/indicator/bbands symbol=AAPL interval=1day
# Precious metals
node scripts/query.mjs /api/v1/twelvedata/metals/price symbol=XAU/USD
node scripts/query.mjs /api/v1/twelvedata/metals/time-series symbol=XAU/USD interval=1day
# Global indices
node scripts/query.mjs /api/v1/twelvedata/indices/list
node scripts/query.mjs /api/v1/twelvedata/indices/quote symbol=SPX
# Economic calendar
node scripts/query.mjs /api/v1/twelvedata/economic-calendar
# Available forex pairs
node scripts/query.mjs /api/v1/twelvedata/forex-pairs
AI Inference — OpenAI & Anthropic (POST)
# GPT-4o chat
node scripts/query.mjs /api/v1/ai/openai/chat --post '{"model":"gpt-4o","messages":[{"role":"user","content":"Analyze: BTC funding rate is extreme positive, CVD fading, whale just shorted. What does this mean?"}]}'
# GPT-4o-mini (cheaper)
node scripts/query.mjs /api/v1/ai/openai/chat/mini --post '{"messages":[{"role":"user","content":"Summarize AAPL earnings in 3 bullet points."}]}'
# Embeddings
node scripts/query.mjs /api/v1/ai/openai/embeddings --post '{"input":"crypto market sentiment","model":"text-embedding-3-small"}'
# List available OpenAI models
node scripts/query.mjs /api/v1/ai/openai/models
# Claude Sonnet (standard, balanced)
node scripts/query.mjs /api/v1/ai/anthropic/messages --post '{"model":"claude-sonnet-4-6","max_tokens":1024,"messages":[{"role":"user","content":"What trading setup does extreme funding + CVD divergence suggest?"}]}'
# Claude Haiku (fast, cheap)
node scripts/query.mjs /api/v1/ai/anthropic/messages/haiku --post '{"max_tokens":256,"messages":[{"role":"user","content":"One-sentence summary of BTC ETF flows today."}]}'
# Claude Opus (deepest reasoning)
node scripts/query.mjs /api/v1/ai/anthropic/messages/opus --post '{"max_tokens":2048,"messages":[{"role":"user","content":"Full macro analysis: ETF inflows strong, funding extreme, CVD diverging..."}]}'
Always run the command, then format the data field clearly for the user — tables, bullet points, or a brief narrative summary.
Power Pattern: Chain Multiple Calls
The real power of claw402 is combining data sources in one agent session:
# Step 1: Find crowded trades ($0.001)
node scripts/query.mjs /api/v1/nofx/funding-rate/top limit=20
# Step 2: Confirm with CVD ($0.001)
node scripts/query.mjs /api/v1/coinank/market-order/agg-cvd exchanges= symbol=DOGEUSDT interval=1h size=6
# Step 3: Check whale positioning ($0.001)
node scripts/query.mjs /api/v1/coinank/hyper/top-position sortBy=value sortType=desc
# Step 4: Cross-reference with US macro ($0.001)
node scripts/query.mjs /api/v1/alpaca/movers top=10 market_type=stocks
# Step 5: Let AI synthesize the analysis ($0.010)
node scripts/query.mjs /api/v1/ai/anthropic/messages/haiku --post '{"max_tokens":512,"messages":[{"role":"user","content":"[paste data from steps 1-4] — what is the high-conviction trade?"}]}'
Total cost: ~$0.014 USDC. Bloomberg Terminal equivalent: $2,000/month.
Natural Language → Command Mapping
Crypto
| User says |
Command |
| "Fear & greed index?" |
/api/v1/coinank/indicator/fear-greed |
| "Altcoin season?" |
/api/v1/coinank/indicator/altcoin-season |
| "Bitcoin cycle position?" |
/api/v1/coinank/indicator/btc-multiplier, ahr999 |
| "Which coins have extreme funding rates?" |
/api/v1/coinank/funding-rate/current type=current |
| "Most negative funding rates?" |
/api/v1/nofx/funding-rate/low limit=20 |
| "Which coins have the most capital inflows?" |
/api/v1/nofx/netflow/top-ranking limit=20 duration=1h |
| "Fund flow for BTC?" |
/api/v1/coinank/fund/realtime sortBy=h1net productType=SWAP |
| "Recent large liquidations?" |
/api/v1/coinank/liquidation/orders baseCoin=BTC |
| "BTC liquidation map / price clusters?" |
/api/v1/coinank/liquidation/liq-map symbol=BTCUSDT exchange=Binance interval=1d |
| "BTC open interest?" |
/api/v1/coinank/oi/all baseCoin=BTC |
| "Biggest OI increases?" |
/api/v1/nofx/oi/top-ranking limit=20 duration=1h |
| "BTC long/short ratio?" |
/api/v1/coinank/longshort/realtime baseCoin=BTC interval=1h |
| "Whale positions on HyperLiquid?" |
/api/v1/coinank/hyper/top-position sortBy=pnl sortType=desc |
| "Recent whale trades?" |
/api/v1/coinank/hyper/top-action |
| "Bitcoin ETF inflows today?" |
/api/v1/coinank/etf/us-btc-inflow |
| "Ethereum ETF flows?" |
/api/v1/coinank/etf/us-eth-inflow |
| "Top AI-picked coins?" |
/api/v1/nofx/ai500/list limit=20 |
| "CVD for BTC?" |
/api/v1/coinank/market-order/agg-cvd exchanges= symbol=BTCUSDT interval=1h size=24 |
| "Is buying pressure real?" |
/api/v1/coinank/market-order/agg-cvd |
| "BTC price?" |
/api/v1/coinank/price/last symbol=BTCUSDT exchange=Binance productType=SWAP |
| "Top gainers today?" |
/api/v1/nofx/price/ranking duration=24h |
| "Trending on Upbit?" |
/api/v1/nofx/upbit/hot limit=20 |
| "Latest crypto news?" |
/api/v1/coinank/news/list type=2 lang=en page=1 pageSize=10 |
US Stocks
| User says |
Command |
| "AAPL stock price right now?" |
/api/v1/alpaca/quotes/latest symbols=AAPL |
| "AAPL daily chart last month?" |
/api/v1/alpaca/bars symbols=AAPL timeframe=1Day start=2024-01-01 |
| "Full AAPL snapshot?" |
/api/v1/alpaca/snapshots symbols=AAPL |
| "Top movers today?" |
/api/v1/alpaca/movers top=10 market_type=stocks |
| "Most traded stocks?" |
/api/v1/alpaca/most-actives top=10 |
| "AAPL OHLCV bars (Polygon)?" |
/api/v1/polygon/aggs/ticker stocks_ticker=AAPL multiplier=1 timespan=day from=... to=... |
| "Market open today?" |
/api/v1/polygon/market-status |
| "AAPL RSI?" |
/api/v1/polygon/rsi stock_ticker=AAPL timespan=day window=14 |
| "AAPL options chain?" |
/api/v1/polygon/options/snapshot underlying_asset=AAPL |
| "AAPL stock overview/fundamentals?" |
/api/v1/stocks/us/overview symbol=AAPL |
| "AAPL earnings history?" |
/api/v1/stocks/us/earnings symbol=AAPL |
| "AAPL income statement?" |
/api/v1/stocks/us/income symbol=AAPL |
| "AAPL MACD?" |
/api/v1/stocks/us/macd symbol=AAPL interval=daily |
| "Top gainers/losers today?" |
/api/v1/stocks/us/movers |
| "AAPL news sentiment?" |
/api/v1/stocks/us/news tickers=AAPL |
China A-Shares
| User says |
Command |
| "List all A-share stocks?" |
/api/v1/stocks/cn/stock-basic list_status=L |
| "000001.SZ daily chart?" |
/api/v1/stocks/cn/daily ts_code=000001.SZ start_date=20240101 end_date=20240131 |
| "Trading calendar for January?" |
/api/v1/stocks/cn/trade-cal start_date=20240101 end_date=20240131 |
| "Northbound flows today?" |
/api/v1/stocks/cn/northbound trade_date=20240315 |
| "Money flow for 000001?" |
/api/v1/stocks/cn/moneyflow ts_code=000001.SZ start_date=20240101 |
| "Dragon tiger list?" |
/api/v1/stocks/cn/top-list trade_date=20240315 |
| "Margin data?" |
/api/v1/stocks/cn/margin ts_code=000001.SZ start_date=20240101 |
Forex & Global
| User says |
Command |
| "EUR/USD rate?" |
/api/v1/twelvedata/price symbol=EUR/USD |
| "EUR/USD hourly chart?" |
/api/v1/twelvedata/time-series symbol=EUR/USD interval=1h outputsize=50 |
| "Gold price?" |
/api/v1/twelvedata/metals/price symbol=XAU/USD |
| "Gold daily chart?" |
/api/v1/twelvedata/metals/time-series symbol=XAU/USD interval=1day |
| "S&P 500 index level?" |
/api/v1/twelvedata/indices/quote symbol=SPX |
| "What global indices are available?" |
/api/v1/twelvedata/indices/list |
| "Economic calendar this week?" |
/api/v1/twelvedata/economic-calendar |
| "EUR/USD RSI?" |
/api/v1/twelvedata/indicator/rsi symbol=EUR/USD interval=1h time_period=14 |
| "Available forex pairs?" |
/api/v1/twelvedata/forex-pairs |
AI Inference
| User says |
Command |
| "Analyze this market data with AI" |
POST /api/v1/ai/openai/chat with gpt-4o |
| "Quick AI summary (cheap)" |
POST /api/v1/ai/openai/chat/mini or POST /api/v1/ai/anthropic/messages/haiku |
| "Deep AI analysis" |
POST /api/v1/ai/anthropic/messages/opus |
| "Embed this text" |
POST /api/v1/ai/openai/embeddings |
| "Generate an image" |
POST /api/v1/ai/openai/images |
| "List OpenAI models" |
/api/v1/ai/openai/models |
Complete Endpoint Reference
🤖 AI Trading Signals (Nofxos) — $0.001/call
| Endpoint |
Description |
Key Params |
/api/v1/nofx/ai500/list |
AI500 high-potential coins (score > 70) |
limit |
/api/v1/nofx/ai500/stats |
AI500 index statistics |
— |
/api/v1/nofx/ai300/list |
AI300 quant model rankings |
limit |
/api/v1/nofx/ai300/stats |
AI300 statistics |
— |
/api/v1/nofx/netflow/top-ranking |
Top net capital inflow coins |
limit, duration, type |
/api/v1/nofx/netflow/low-ranking |
Top net capital outflow coins |
limit, duration, type |
/api/v1/nofx/oi/top-ranking |
Biggest OI increase coins |
limit, duration |
/api/v1/nofx/oi/low-ranking |
Biggest OI decrease coins |
limit, duration |
/api/v1/nofx/price/ranking |
Price change rankings |
duration |
/api/v1/nofx/funding-rate/top |
Highest funding rate coins |
limit |
/api/v1/nofx/funding-rate/low |
Most negative funding rate coins |
limit |
/api/v1/nofx/upbit/hot |
Upbit hot coins by volume |
limit |
/api/v1/nofx/upbit/netflow/top-ranking |
Upbit net inflow rankings |
limit, duration |
/api/v1/nofx/upbit/netflow/low-ranking |
Upbit net outflow rankings |
limit, duration |
/api/v1/nofx/query-rank/list |
Most searched coin rankings |
limit |
duration values: 5m 15m 1h 4h 24h
📈 Crypto Market Data (Coinank) — $0.001–$0.003/call
Price & Candlesticks
| Endpoint |
Description |
Key Params |
/api/v1/coinank/price/last |
Real-time latest price |
symbol, exchange, productType |
/api/v1/coinank/kline/lists |
OHLCV candlestick data |
symbol, exchange, interval, size, endTime |
ETF Flows
| Endpoint |
Description |
/api/v1/coinank/etf/us-btc |
US Bitcoin ETF list (IBIT, FBTC, ARKB, etc.) |
/api/v1/coinank/etf/us-eth |
US Ethereum ETF list |
/api/v1/coinank/etf/us-btc-inflow |
US BTC ETF historical net inflow |
/api/v1/coinank/etf/us-eth-inflow |
US ETH ETF historical net inflow |
/api/v1/coinank/etf/hk-inflow |
Hong Kong crypto ETF net inflow |
Fund Flow
| Endpoint |
Description |
Key Params |
/api/v1/coinank/fund/realtime |
Real-time fund flow rankings |
sortBy (h1net/h4net/h24net), productType, size |
/api/v1/coinank/fund/history |
Historical fund flow by coin |
baseCoin, interval, size, endTime |
Open Interest
| Endpoint |
Description |
Key Params |
/api/v1/coinank/oi/all |
Real-time OI by exchange |
baseCoin |
/api/v1/coinank/oi/agg-chart |
Aggregated OI history |
baseCoin, exchange, interval, size, endTime |
/api/v1/coinank/oi/symbol-chart |
OI history by trading pair |
exchange, symbol, interval, size, endTime |
/api/v1/coinank/oi/kline |
OI candlestick |
exchange, symbol, interval, size, endTime |
/api/v1/coinank/oi/vs-market-cap-hist |
OI / market cap ratio history |
baseCoin, interval, size, endTime |
Liquidations
| Endpoint |
Description |
Key Params |
/api/v1/coinank/liquidation/orders |
Recent liquidation orders |
baseCoin, exchange, side, amount, endTime |
/api/v1/coinank/liquidation/intervals |
Liquidation stats by period |
baseCoin |
/api/v1/coinank/liquidation/agg-history |
Aggregated liquidation history |
baseCoin, interval, size, endTime |
/api/v1/coinank/liquidation/liq-map |
Liquidation price-level clusters |
symbol, exchange, interval |
/api/v1/coinank/liquidation/heat-map |
Liquidation heatmap |
exchange, symbol, interval |
Long/Short Ratios
| Endpoint |
Description |
Key Params |
/api/v1/coinank/longshort/realtime |
Real-time L/S ratio by exchange |
baseCoin, interval |
/api/v1/coinank/longshort/buy-sell |
Global buy-sell L/S history |
baseCoin, interval, size, endTime |
/api/v1/coinank/longshort/person |
Account-level L/S ratio |
exchange, symbol, interval, size, endTime |
/api/v1/coinank/longshort/position |
Whale position-level L/S |
exchange, symbol, interval, size, endTime |
Funding Rates
| Endpoint |
Description |
Key Params |
/api/v1/coinank/funding-rate/current |
Real-time funding rate rankings |
type (current/day/week/month/year) |
/api/v1/coinank/funding-rate/accumulated |
Accumulated funding cost |
type |
/api/v1/coinank/funding-rate/hist |
Historical funding rates |
baseCoin, exchangeType, size, endTime |
/api/v1/coinank/funding-rate/weighted |
Weighted average funding rate |
baseCoin, interval, size, endTime |
/api/v1/coinank/funding-rate/heatmap |
Funding rate heatmap |
type (openInterest/marketCap), interval |
Whale Activity
| Endpoint |
Description |
Key Params |
/api/v1/coinank/hyper/top-position |
HyperLiquid whale positions |
sortBy, sortType, page, size |
/api/v1/coinank/hyper/top-action |
HyperLiquid whale trade actions |
— |
/api/v1/coinank/trades/large |
Large block trades |
symbol, productType, amount, size, endTime |
/api/v1/coinank/big-order/list |
Large limit orders |
symbol, exchangeType, size, amount, side |
Taker Flow / CVD
| Endpoint |
Description |
Key Params |
/api/v1/coinank/market-order/cvd |
CVD for single pair |
exchange, symbol, interval, size, endTime |
/api/v1/coinank/market-order/agg-cvd |
Aggregated CVD cross-exchange |
exchanges (empty=all), symbol, interval, size, endTime |
/api/v1/coinank/market-order/buy-sell-value |
Taker buy/sell value USD |
exchange, symbol, interval, size, endTime |
/api/v1/coinank/market-order/agg-buy-sell-value |
Aggregated buy/sell value |
exchanges, symbol, interval, size, endTime |
Rankings & Screeners
| Endpoint |
Description |
Key Params |
/api/v1/coinank/rank/screener |
Multi-dimensional screener |
interval |
/api/v1/coinank/rank/oi |
OI rankings |
sortBy, sortType, size |
/api/v1/coinank/rank/liquidation |
Liquidation rankings |
sortBy, sortType, size |
/api/v1/coinank/rank/volume |
Volume rankings |
sortBy, sortType |
/api/v1/coinank/rank/price |
Price change rankings |
sortBy, sortType |
/api/v1/coinank/rsi/list |
RSI screener |
interval (1H/4H/1D — uppercase) |
Market Cycle Indicators
| Endpoint |
Description |
/api/v1/coinank/indicator/fear-greed |
Crypto fear & greed index |
/api/v1/coinank/indicator/altcoin-season |
Altcoin Season Index |
/api/v1/coinank/indicator/btc-multiplier |
BTC 2-year MA multiplier |
/api/v1/coinank/indicator/ahr999 |
AHR999 accumulation indicator |
/api/v1/coinank/indicator/puell-multiple |
Puell Multiple |
/api/v1/coinank/indicator/ma-heatmap |
200-week MA heatmap |
/api/v1/coinank/indicator/market-cap-rank |
Coin market cap share |
News
| Endpoint |
Description |
Key Params |
/api/v1/coinank/news/list |
News & flash alerts |
type (1=flash, 2=news), lang (zh/en), page, pageSize |
/api/v1/coinank/news/detail |
Full article by ID |
id |
📊 US Stocks — Alpaca Markets — $0.001–$0.003/call
| Endpoint |
Description |
Key Params |
/api/v1/alpaca/quotes/latest |
Real-time quotes |
symbols, feed, currency |
/api/v1/alpaca/quotes/history |
Historical tick quotes |
symbols, start, end, limit, feed |
/api/v1/alpaca/bars/latest |
Latest OHLCV bar |
symbols, feed, currency |
/api/v1/alpaca/bars |
Historical OHLCV bars |
symbols, timeframe, start, end, limit, adjustment |
/api/v1/alpaca/trades/latest |
Real-time latest trade |
symbols, feed |
/api/v1/alpaca/trades/history |
Historical trades |
symbols, start, end, limit, feed |
/api/v1/alpaca/snapshots |
Full snapshot (multi-symbol) |
symbols, feed |
/api/v1/alpaca/snapshot |
Full snapshot (single symbol) |
symbols, feed |
/api/v1/alpaca/movers |
Top movers by % change |
top, market_type |
/api/v1/alpaca/most-actives |
Most active by volume |
top, market_type |
/api/v1/alpaca/news |
Financial news |
symbols, start, end, limit |
/api/v1/alpaca/corporate-actions |
Dividends, splits, etc. |
symbols, types, start, end |
/api/v1/alpaca/options/bars |
Options OHLCV bars |
symbols, timeframe, start, end |
/api/v1/alpaca/options/quotes/latest |
Options latest quotes |
symbols, feed |
/api/v1/alpaca/options/snapshots |
Options chain snapshots |
symbols, feed |
timeframe values: 1Min 5Min 15Min 1Hour 1Day
market_type values: stocks crypto
📉 US Stocks — Polygon — $0.001–$0.003/call
| Endpoint |
Description |
Key Params |
/api/v1/polygon/aggs/ticker |
OHLCV bars |
stocks_ticker, multiplier, timespan, from, to |
/api/v1/polygon/aggs/grouped |
Grouped daily bars |
date, adjusted |
/api/v1/polygon/prev-close |
Previous session close |
stocks_ticker |
/api/v1/polygon/snapshot/ticker |
Full ticker snapshot |
stocks_ticker |
/api/v1/polygon/snapshot/all |
All tickers snapshot |
tickers |
/api/v1/polygon/snapshot/gainers |
Top daily gainers |
— |
/api/v1/polygon/snapshot/losers |
Top daily losers |
— |
/api/v1/polygon/trades |
Recent trades |
stocks_ticker |
/api/v1/polygon/last-trade |
Last trade |
stocks_ticker |
/api/v1/polygon/quotes |
Recent quotes |
stocks_ticker |
/api/v1/polygon/last-quote |
Last NBBO quote |
stocks_ticker |
/api/v1/polygon/ticker-details |
Company details |
ticker |
/api/v1/polygon/ticker-news |
Company news |
ticker |
/api/v1/polygon/tickers |
Ticker search |
ticker, type, market |
/api/v1/polygon/market-status |
US market open/closed |
— |
/api/v1/polygon/market-holidays |
Market holidays |
— |
/api/v1/polygon/exchanges |
Exchange list |
— |
/api/v1/polygon/sma |
SMA indicator |
stocks_ticker, timespan, window |
/api/v1/polygon/ema |
EMA indicator |
stocks_ticker, timespan, window |
/api/v1/polygon/rsi |
RSI indicator |
stock_ticker, timespan, window |
/api/v1/polygon/macd |
MACD indicator |
stocks_ticker, timespan |
/api/v1/polygon/options/contracts |
Options contracts list |
underlying_asset, contract_type, expiration_date |
/api/v1/polygon/options/contract-details |
Single contract details |
options_ticker |
/api/v1/polygon/options/snapshot |
Options chain snapshot |
underlying_asset |
/api/v1/polygon/options/snapshot/contract |
Single option snapshot |
options_ticker |
timespan values: minute hour day week month quarter year
🏢 US Fundamentals — Alpha Vantage — $0.001–$0.003/call
| Endpoint |
Description |
Key Params |
/api/v1/stocks/us/quote |
Real-time quote |
symbol |
/api/v1/stocks/us/search |
Symbol search |
keywords |
/api/v1/stocks/us/daily |
Daily OHLCV |
symbol, outputsize (compact/full) |
/api/v1/stocks/us/daily-adjusted |
Adjusted daily OHLCV |
symbol, outputsize |
/api/v1/stocks/us/intraday |
Intraday OHLCV |
symbol, interval (1min/5min/15min/30min/60min), outputsize |
/api/v1/stocks/us/weekly |
Weekly OHLCV |
symbol |
/api/v1/stocks/us/monthly |
Monthly OHLCV |
symbol |
/api/v1/stocks/us/overview |
Company fundamentals |
symbol |
/api/v1/stocks/us/earnings |
Quarterly & annual earnings |
symbol |
/api/v1/stocks/us/income |
Income statement |
symbol |
/api/v1/stocks/us/balance-sheet |
Balance sheet |
symbol |
/api/v1/stocks/us/cash-flow |
Cash flow statement |
symbol |
/api/v1/stocks/us/movers |
Top gainers/losers/most active |
— |
/api/v1/stocks/us/news |
News & sentiment |
tickers, topics |
/api/v1/stocks/us/rsi |
RSI |
symbol, interval, time_period |
/api/v1/stocks/us/macd |
MACD |
symbol, interval |
/api/v1/stocks/us/bbands |
Bollinger Bands |
symbol, interval, time_period |
/api/v1/stocks/us/sma |
SMA |
symbol, interval, time_period |
/api/v1/stocks/us/ema |
EMA |
symbol, interval, time_period |
🇨🇳 China A-Shares — Tushare — $0.001–$0.003/call
| Endpoint |
Description |
Key Params |
/api/v1/stocks/cn/stock-basic |
Listed stock directory |
list_status (L/D/P), ts_code |
/api/v1/stocks/cn/daily |
Daily OHLCV |
ts_code, start_date, end_date |
/api/v1/stocks/cn/weekly |
Weekly OHLCV |
ts_code, start_date, end_date |
/api/v1/stocks/cn/monthly |
Monthly OHLCV |
ts_code, start_date, end_date |
/api/v1/stocks/cn/daily-basic |
Daily valuation metrics |
ts_code, trade_date |
/api/v1/stocks/cn/trade-cal |
Trading calendar |
start_date, end_date, is_open |
/api/v1/stocks/cn/income |
Income statement |
ts_code, period |
/api/v1/stocks/cn/balance-sheet |
Balance sheet |
ts_code, period |
/api/v1/stocks/cn/cash-flow |
Cash flow statement |
ts_code, period |
/api/v1/stocks/cn/dividend |
Dividend history |
ts_code |
/api/v1/stocks/cn/northbound |
Northbound capital flow |
trade_date |
/api/v1/stocks/cn/moneyflow |
Money flow (net in/out) |
ts_code, start_date |
/api/v1/stocks/cn/margin |
Margin trading summary |
ts_code, start_date, end_date |
/api/v1/stocks/cn/margin-detail |
Margin trading detail |
ts_code, trade_date |
/api/v1/stocks/cn/top-list |
Dragon Tiger List (top traders) |
trade_date |
/api/v1/stocks/cn/top-inst |
Institutional top list |
trade_date, ts_code |
Date format: YYYYMMDD (e.g., 20240315)
Stock code format: 000001.SZ (Shenzhen) · 600000.SH (Shanghai)
🌍 Forex & Global — Twelve Data — $0.001–$0.005/call
| Endpoint |
Description |
Key Params |
/api/v1/twelvedata/time-series |
Time series (OHLCV) |
symbol, interval, outputsize |
/api/v1/twelvedata/price |
Real-time price |
symbol |
/api/v1/twelvedata/quote |
Full quote |
symbol |
/api/v1/twelvedata/eod |
End-of-day price |
symbol |
/api/v1/twelvedata/exchange-rate |
Currency exchange rate |
symbol (e.g., USD/JPY) |
/api/v1/twelvedata/forex-pairs |
Available forex pairs |
— |
/api/v1/twelvedata/economic-calendar |
Economic events calendar |
— |
/api/v1/twelvedata/metals/price |
Precious metals real-time |
symbol (XAU/USD, XAG/USD) |
/api/v1/twelvedata/metals/time-series |
Metals OHLCV history |
symbol, interval |
/api/v1/twelvedata/indices/list |
Global indices directory |
— |
/api/v1/twelvedata/indices/quote |
Index quote |
symbol (SPX, NDX, DJI) |
/api/v1/twelvedata/indicator/sma |
SMA |
symbol, interval, time_period, outputsize |
/api/v1/twelvedata/indicator/ema |
EMA |
symbol, interval, time_period, outputsize |
/api/v1/twelvedata/indicator/rsi |
RSI |
symbol, interval, time_period, outputsize |
/api/v1/twelvedata/indicator/macd |
MACD |
symbol, interval |
/api/v1/twelvedata/indicator/bbands |
Bollinger Bands |
symbol, interval, time_period |
/api/v1/twelvedata/indicator/atr |
ATR (volatility) |
symbol, interval, time_period |
/api/v1/twelvedata/time-series/complex |
Complex multi-indicator POST |
JSON body |
interval values: 1min 5min 15min 30min 1h 2h 4h 1day 1week 1month
Symbol examples: EUR/USD GBP/JPY BTC/USD AAPL XAU/USD SPX
🤖 AI Inference — OpenAI & Anthropic — $0.001–$0.015/call
OpenAI (all POST except models)
| Endpoint |
Description |
Cost |
Body |
/api/v1/ai/openai/chat |
GPT-4o chat |
$0.010 |
{model, messages, max_tokens} |
/api/v1/ai/openai/chat/mini |
GPT-4o-mini chat |
$0.001 |
{messages, max_tokens} |
/api/v1/ai/openai/embeddings |
text-embedding-3-small |
$0.001 |
{input, model} |
/api/v1/ai/openai/embeddings/large |
text-embedding-3-large |
$0.005 |
{input, model} |
/api/v1/ai/openai/images |
DALL-E image generation |
$0.050 |
{prompt, n, size} |
/api/v1/ai/openai/models |
List available models (GET) |
$0.001 |
— |
Anthropic (all POST)
| Endpoint |
Description |
Cost |
Body |
/api/v1/ai/anthropic/messages |
Claude Sonnet (balanced) |
$0.010 |
{model, max_tokens, messages} |
/api/v1/ai/anthropic/messages/haiku |
Claude Haiku (fast, cheap) |
$0.005 |
{max_tokens, messages} |
/api/v1/ai/anthropic/messages/opus |
Claude Opus (best reasoning) |
$0.015 |
{max_tokens, messages} |
Parameter Reference
Crypto (Coinank / Nofxos)
| Parameter |
Values / Format |
exchange |
Binance OKX Bybit Bitget dYdX |
productType |
SWAP (perpetual futures) · SPOT |
interval (crypto) |
1m 5m 15m 1h 4h 1d |
duration (nofx) |
5m 15m 1h 4h 24h |
endTime |
Unix timestamp in milliseconds — use Date.now() if omitted |
size |
Number of data points (default varies, max ~500) |
sortType |
asc or desc |
lang (news) |
en (English) · zh (Chinese) |
RSI interval |
Uppercase: 1H 4H 1D |
US Stocks
| Parameter |
Values / Format |
symbols (Alpaca) |
Comma-separated: AAPL,TSLA,MSFT |
timeframe (Alpaca) |
1Min 5Min 15Min 1Hour 1Day |
start / end (Alpaca) |
ISO date: 2024-01-01 |
timespan (Polygon) |
minute hour day week month year |
from / to (Polygon) |
ISO date: 2024-01-01 |
interval (Alpha Vantage) |
1min 5min 15min 30min 60min daily weekly monthly |
China A-Shares
| Parameter |
Values / Format |
ts_code |
000001.SZ (Shenzhen) · 600000.SH (Shanghai) |
start_date / end_date |
YYYYMMDD: 20240101 |
trade_date |
YYYYMMDD: 20240315 |
list_status |
L (listed) · D (delisted) · P (paused) |
Tips for Best Results
- Chain data calls for richer analysis: fetch crypto signals → US stocks → run AI synthesis in one session
- Use
Date.now() for endTime when fetching real-time crypto data
exchanges="" (empty string) in Coinank market-order agg endpoints means all exchanges
- POST endpoints (AI, Twelvedata complex): use
node scripts/query.mjs <path> --post '<json>'
- VIP1/2/3/4 crypto endpoints are accessible through claw402 like all others — no extra config
- Free catalog:
https://claw402.ai/api/v1/catalog — always up to date, no payment required
- Present results clearly: use tables or bullet points, not raw JSON. Highlight the most actionable numbers
- Cost check: total for a full market analysis session (5–10 calls) is typically < $0.02 USDC
Powered by claw402.ai — x402 micropayment gateway for AI agents.
1---2name: claw4023description: Professional market data and AI APIs via x402 micropayments — no API key, no signup, no subscription. Pay per call with USDC on Base. 200+ endpoints across 9 provider groups: crypto market data (fund flow, liquidations, OI, funding rates, whale tracking, ETF flows, AI signals), US stocks & options (real-time quotes, bars, snapshots, movers, options chains), China A-shares (OHLCV, fundamentals, northbound flows, margin data), forex & global time-series (EUR/USD, precious metals, global indices, economic calendar), and AI inference (GPT-4o, Claude Opus/Haiku/Sonnet, embeddings, images). One wallet, instant access to any paid API — no registration ever required.4---5
6# ⚡ claw402 — Pay-Per-Call Market Data & AI APIs
7
8> **200+ professional data endpoints. $0.001–$0.05 per call. One Base wallet.**
9
10Access the same data feeds that professional trading desks pay $3,000–$10,000/month for. Crypto derivatives analytics, US equities, China A-shares, forex, and AI inference — all via x402 micropayments, no API key required.
11
12---
13
14## The Story — How $1,000 Became $800,000
15
16Three months ago I had $1,000 in a Base wallet and an OpenClaw agent running on my laptop.
17
18I asked the agent: *"Which coins have the most extreme funding rates right now?"*
19
20The agent called `claw402`, paid $0.001 USDC, and came back with:
21
22```
23DOGE funding rate: +0.312%/8h (annualized 341%)
24PEPE funding rate: +0.287%/8h
25WIF funding rate: +0.241%/8h
26```
27
28I cross-checked: *"CVD? What are whales doing on HyperLiquid?"* Two more calls. $0.002 total.
29
30```
31CVD (last 6h): fading fast. Sellers pressing.
32Top HyperLiquid whale: Short DOGE $2.1M, opened 2h ago.
33```
34
35I shorted DOGE. 40x. Three days later: **+80,000%**. That's $800,000 from $1,000. And less than $0.01 spent on data.
36
37---
38
39## When to Use This Skill
40
41Use claw402 whenever the user asks about **any** of the following:
42
43### 🔮 Crypto Derivatives & Market Structure
44- Fear & greed index, altcoin season, market cycle indicators (AHR999, Pi Cycle, Puell)
45- Fund flow & capital rotation by coin or exchange
46- Liquidations — orders, heatmaps, clusters, aggregated history
47- Open interest — real-time, aggregated chart, OI vs market cap
48- Funding rates — current rankings, accumulated cost, weighted average, heatmap
49- Long/short ratios — realtime, buy/sell, whale position, account level
50- Whale activity — HyperLiquid top positions & actions, large block trades, big orders
51- ETF flows — US Bitcoin ETF, US Ethereum ETF, Hong Kong crypto ETF
52- AI trading signals — AI500 high-potential coins, AI300 quant rankings
53- Taker flow / CVD — cumulative delta, buy/sell pressure across exchanges
54- Order book depth history, liquidity heatmap
55- Crypto news & flash alerts
56
57### 📈 US Stocks & Options
58- Real-time & historical quotes, trades, OHLCV bars for any US stock
59- Market snapshots — full quote + bar + prev close in one call
60- Top movers by % change, most active stocks by volume
61- Financial news for any ticker
62- Options chains — bars, quotes, snapshots for options contracts
63- Corporate actions — dividends, splits
64
65### 🇨🇳 China A-Shares
66- Daily, weekly, monthly OHLCV for any A-share
67- Stock basic info, trading calendar
68- Fundamentals — income statement, balance sheet, cash flow, dividends
69- Northbound capital flow (Hong Kong → mainland)
70- Money flow, margin trading data, top lists, institutional trading
71
72### 💹 US Stock Fundamentals & Technical Indicators
73- Real-time quotes, daily/intraday/weekly/monthly OHLCV
74- Company overview, earnings, income, balance sheet, cash flow
75- Top gainers/losers, news sentiment
76- RSI, MACD, Bollinger Bands, SMA, EMA
77
78### 🌍 Forex, Metals & Global Time-Series
79- EUR/USD, GBP/USD and any forex pair — tick or time-series
80- Precious metals price and history — XAU/USD (gold), XAG/USD (silver)
81- Global indices — list and real-time quotes
82- Exchange rates, forex pairs reference, economic calendar
83- Technical indicators — RSI, MACD, SMA, EMA, Bollinger Bands, ATR
84
85### 🤖 AI Inference (GPT-4o, Claude, Embeddings, Images)
86- OpenAI GPT-4o chat, GPT-4o-mini, embeddings (small + large), DALL-E images
87- Anthropic Claude messages (standard, Haiku, Opus)
88- Use to analyze market data your agent just fetched — chain calls in one session
89
90---
91
92## Cost & Privacy
93
94| Item | Detail |
95|------|--------|
96| Crypto / stock data | **$0.001–$0.003 USDC** per call |
97| Twelvedata complex POST | **$0.005 USDC** per call |
98| OpenAI GPT-4o chat | **$0.01 USDC** per call |
99| OpenAI mini / embeddings | **$0.001–$0.005 USDC** per call |
100| Claude messages | **$0.01–$0.015 USDC** per call |
101| Payment chain | Base mainnet (Coinbase L2) |
102| Payment method | EIP-3009 USDC transfer, signed locally |
103| Key security | Private key **never transmitted** — signs locally only |
104| API key required | **No** — wallet is your credential |
105| Registration | **Never** |
106
107Get USDC on Base: [bridge.base.org](https://bridge.base.org) · Testnet USDC: [faucet.circle.com](https://faucet.circle.com)
108
109---
110
111## Quick Start
112
113### 1. Set your wallet key
114```
115WALLET_PRIVATE_KEY=0xYourBaseWalletPrivateKey
116```
117Your wallet must hold USDC on **Base mainnet**.
118
119### 2. Query any GET endpoint
120```bash
121node scripts/query.mjs <endpoint-path> [key=value ...]
122```
123
124### 3. Call POST endpoints (AI / Twelvedata complex)
125```bash
126node scripts/query.mjs <endpoint-path> --post '<json-body>'
127```
128
129### 4. Read the result
130The script prints `{ status, url, data }` as formatted JSON. Parse `data` for the actual payload.
131
132---
133
134## Query Examples
135
136### Crypto Market Data
137
138```bash
139# --- Market Cycle & Sentiment ---
140node scripts/query.mjs /api/v1/coinank/indicator/fear-greed
141node scripts/query.mjs /api/v1/coinank/indicator/altcoin-season
142node scripts/query.mjs /api/v1/coinank/indicator/btc-multiplier
143node scripts/query.mjs /api/v1/coinank/indicator/ahr999
144
145# --- Fund Flow ---
146node scripts/query.mjs /api/v1/nofx/netflow/top-ranking limit=20 duration=1h
147node scripts/query.mjs /api/v1/coinank/fund/realtime sortBy=h1net productType=SWAP
148
149# --- Liquidations ---
150node scripts/query.mjs /api/v1/coinank/liquidation/orders baseCoin=BTC
151node scripts/query.mjs /api/v1/coinank/liquidation/liq-map symbol=BTCUSDT exchange=Binance interval=1d
152
153# --- Open Interest ---
154node scripts/query.mjs /api/v1/coinank/oi/all baseCoin=BTC
155node scripts/query.mjs /api/v1/nofx/oi/top-ranking limit=20 duration=1h
156
157# --- Funding Rates ---
158node scripts/query.mjs /api/v1/coinank/funding-rate/current type=current
159node scripts/query.mjs /api/v1/nofx/funding-rate/top limit=20
160
161# --- Whale Tracking ---
162node scripts/query.mjs /api/v1/coinank/hyper/top-position sortBy=pnl sortType=desc
163node scripts/query.mjs /api/v1/coinank/hyper/top-action
164
165# --- ETF Flows ---
166node scripts/query.mjs /api/v1/coinank/etf/us-btc-inflow
167node scripts/query.mjs /api/v1/coinank/etf/us-eth-inflow
168
169# --- AI Signals ---
170node scripts/query.mjs /api/v1/nofx/ai500/list limit=20
171node scripts/query.mjs /api/v1/nofx/ai300/list limit=20
172
173# --- CVD / Taker Flow ---
174node scripts/query.mjs /api/v1/coinank/market-order/agg-cvd exchanges= symbol=BTCUSDT interval=1h size=24
175
176# --- Price & Candles ---
177node scripts/query.mjs /api/v1/coinank/price/last symbol=BTCUSDT exchange=Binance productType=SWAP
178node scripts/query.mjs /api/v1/coinank/kline/lists symbol=BTCUSDT exchange=Binance interval=1h size=100
179
180# --- News ---
181node scripts/query.mjs /api/v1/coinank/news/list type=2 lang=en page=1 pageSize=10
182```
183
184### US Stocks — Alpaca
185
186```bash
187# Real-time quote
188node scripts/query.mjs /api/v1/alpaca/quotes/latest symbols=AAPL,TSLA,MSFT
189
190# Historical bars
191node scripts/query.mjs /api/v1/alpaca/bars symbols=AAPL timeframe=1Day start=2024-01-01 limit=30
192
193# Market snapshot (quote + bar + prev close)
194node scripts/query.mjs /api/v1/alpaca/snapshots symbols=AAPL,TSLA
195
196# Top movers
197node scripts/query.mjs /api/v1/alpaca/movers top=10 market_type=stocks
198
199# Most active stocks
200node scripts/query.mjs /api/v1/alpaca/most-actives top=10
201
202# Latest trade
203node scripts/query.mjs /api/v1/alpaca/trades/latest symbols=AAPL
204
205# Financial news
206node scripts/query.mjs /api/v1/alpaca/news symbols=AAPL limit=10
207
208# Options chain snapshot
209node scripts/query.mjs /api/v1/alpaca/options/snapshots symbols=AAPL240119C00150000
210```
211
212### US Stocks — Polygon
213
214```bash
215# OHLCV bars
216node scripts/query.mjs /api/v1/polygon/aggs/ticker stocks_ticker=AAPL multiplier=1 timespan=day from=2024-01-01 to=2024-01-31
217
218# Previous close
219node scripts/query.mjs /api/v1/polygon/prev-close stocks_ticker=AAPL
220
221# Snapshot (full quote + bar)
222node scripts/query.mjs /api/v1/polygon/snapshot/ticker stocks_ticker=AAPL
223
224# Top gainers/losers
225node scripts/query.mjs /api/v1/polygon/snapshot/gainers
226node scripts/query.mjs /api/v1/polygon/snapshot/losers
227
228# Company details
229node scripts/query.mjs /api/v1/polygon/ticker-details ticker=AAPL
230
231# Market status
232node scripts/query.mjs /api/v1/polygon/market-status
233
234# Technical indicators
235node scripts/query.mjs /api/v1/polygon/rsi stock_ticker=AAPL timespan=day window=14
236node scripts/query.mjs /api/v1/polygon/macd stocks_ticker=AAPL timespan=day
237
238# Options chain
239node scripts/query.mjs /api/v1/polygon/options/snapshot underlying_asset=AAPL
240
241# News
242node scripts/query.mjs /api/v1/polygon/ticker-news ticker=AAPL
243```
244
245### US Stocks — Alpha Vantage Fundamentals
246
247```bash
248# Real-time quote
249node scripts/query.mjs /api/v1/stocks/us/quote symbol=AAPL
250
251# Daily OHLCV
252node scripts/query.mjs /api/v1/stocks/us/daily symbol=AAPL outputsize=compact
253
254# Intraday
255node scripts/query.mjs /api/v1/stocks/us/intraday symbol=AAPL interval=5min
256
257# Company overview
258node scripts/query.mjs /api/v1/stocks/us/overview symbol=AAPL
259
260# Earnings history
261node scripts/query.mjs /api/v1/stocks/us/earnings symbol=AAPL
262
263# Financial statements
264node scripts/query.mjs /api/v1/stocks/us/income symbol=AAPL
265node scripts/query.mjs /api/v1/stocks/us/balance-sheet symbol=AAPL
266node scripts/query.mjs /api/v1/stocks/us/cash-flow symbol=AAPL
267
268# Top gainers/losers/most active
269node scripts/query.mjs /api/v1/stocks/us/movers
270
271# News & sentiment
272node scripts/query.mjs /api/v1/stocks/us/news tickers=AAPL
273
274# Technical indicators
275node scripts/query.mjs /api/v1/stocks/us/rsi symbol=AAPL interval=daily time_period=14
276node scripts/query.mjs /api/v1/stocks/us/macd symbol=AAPL interval=daily
277node scripts/query.mjs /api/v1/stocks/us/bbands symbol=AAPL interval=daily time_period=20
278```
279
280### China A-Shares — Tushare
281
282```bash
283# Stock list (all listed stocks)
284node scripts/query.mjs /api/v1/stocks/cn/stock-basic list_status=L
285
286# Daily OHLCV
287node scripts/query.mjs /api/v1/stocks/cn/daily ts_code=000001.SZ start_date=20240101 end_date=20240131
288
289# Trading calendar
290node scripts/query.mjs /api/v1/stocks/cn/trade-cal start_date=20240101 end_date=20240131
291
292# Northbound capital flow
293node scripts/query.mjs /api/v1/stocks/cn/northbound trade_date=20240315
294
295# Money flow
296node scripts/query.mjs /api/v1/stocks/cn/moneyflow ts_code=000001.SZ start_date=20240101
297
298# Margin trading data
299node scripts/query.mjs /api/v1/stocks/cn/margin ts_code=000001.SZ start_date=20240101
300
301# Top list (dragon tiger list)
302node scripts/query.mjs /api/v1/stocks/cn/top-list trade_date=20240315
303
304# Fundamentals
305node scripts/query.mjs /api/v1/stocks/cn/income ts_code=000001.SZ period=20231231
306node scripts/query.mjs /api/v1/stocks/cn/balance-sheet ts_code=000001.SZ period=20231231
307```
308
309### Forex & Global Time-Series — Twelve Data
310
311```bash
312# Time series — EUR/USD hourly
313node scripts/query.mjs /api/v1/twelvedata/time-series symbol=EUR/USD interval=1h outputsize=50
314
315# Real-time price
316node scripts/query.mjs /api/v1/twelvedata/price symbol=BTC/USD
317node scripts/query.mjs /api/v1/twelvedata/price symbol=XAU/USD
318
319# Exchange rate
320node scripts/query.mjs /api/v1/twelvedata/exchange-rate symbol=USD/JPY
321
322# Technical indicators
323node scripts/query.mjs /api/v1/twelvedata/indicator/rsi symbol=AAPL interval=1day time_period=14 outputsize=10
324node scripts/query.mjs /api/v1/twelvedata/indicator/macd symbol=EUR/USD interval=1h
325node scripts/query.mjs /api/v1/twelvedata/indicator/bbands symbol=AAPL interval=1day
326
327# Precious metals
328node scripts/query.mjs /api/v1/twelvedata/metals/price symbol=XAU/USD
329node scripts/query.mjs /api/v1/twelvedata/metals/time-series symbol=XAU/USD interval=1day
330
331# Global indices
332node scripts/query.mjs /api/v1/twelvedata/indices/list
333node scripts/query.mjs /api/v1/twelvedata/indices/quote symbol=SPX
334
335# Economic calendar
336node scripts/query.mjs /api/v1/twelvedata/economic-calendar
337
338# Available forex pairs
339node scripts/query.mjs /api/v1/twelvedata/forex-pairs
340```
341
342### AI Inference — OpenAI & Anthropic (POST)
343
344```bash
345# GPT-4o chat
346node scripts/query.mjs /api/v1/ai/openai/chat --post '{"model":"gpt-4o","messages":[{"role":"user","content":"Analyze: BTC funding rate is extreme positive, CVD fading, whale just shorted. What does this mean?"}]}'
347
348# GPT-4o-mini (cheaper)
349node scripts/query.mjs /api/v1/ai/openai/chat/mini --post '{"messages":[{"role":"user","content":"Summarize AAPL earnings in 3 bullet points."}]}'
350
351# Embeddings
352node scripts/query.mjs /api/v1/ai/openai/embeddings --post '{"input":"crypto market sentiment","model":"text-embedding-3-small"}'
353
354# List available OpenAI models
355node scripts/query.mjs /api/v1/ai/openai/models
356
357# Claude Sonnet (standard, balanced)
358node scripts/query.mjs /api/v1/ai/anthropic/messages --post '{"model":"claude-sonnet-4-6","max_tokens":1024,"messages":[{"role":"user","content":"What trading setup does extreme funding + CVD divergence suggest?"}]}'
359
360# Claude Haiku (fast, cheap)
361node scripts/query.mjs /api/v1/ai/anthropic/messages/haiku --post '{"max_tokens":256,"messages":[{"role":"user","content":"One-sentence summary of BTC ETF flows today."}]}'
362
363# Claude Opus (deepest reasoning)
364node scripts/query.mjs /api/v1/ai/anthropic/messages/opus --post '{"max_tokens":2048,"messages":[{"role":"user","content":"Full macro analysis: ETF inflows strong, funding extreme, CVD diverging..."}]}'
365```
366
367**Always** run the command, then format the `data` field clearly for the user — tables, bullet points, or a brief narrative summary.
368
369---
370
371## Power Pattern: Chain Multiple Calls
372
373The real power of claw402 is combining data sources in one agent session:
374
375```bash
376# Step 1: Find crowded trades ($0.001)
377node scripts/query.mjs /api/v1/nofx/funding-rate/top limit=20
378
379# Step 2: Confirm with CVD ($0.001)
380node scripts/query.mjs /api/v1/coinank/market-order/agg-cvd exchanges= symbol=DOGEUSDT interval=1h size=6
381
382# Step 3: Check whale positioning ($0.001)
383node scripts/query.mjs /api/v1/coinank/hyper/top-position sortBy=value sortType=desc
384
385# Step 4: Cross-reference with US macro ($0.001)
386node scripts/query.mjs /api/v1/alpaca/movers top=10 market_type=stocks
387
388# Step 5: Let AI synthesize the analysis ($0.010)
389node scripts/query.mjs /api/v1/ai/anthropic/messages/haiku --post '{"max_tokens":512,"messages":[{"role":"user","content":"[paste data from steps 1-4] — what is the high-conviction trade?"}]}'
390```
391
392**Total cost: ~$0.014 USDC.** Bloomberg Terminal equivalent: $2,000/month.
393
394---
395
396## Natural Language → Command Mapping
397
398### Crypto
399
400| User says | Command |
401|-----------|---------|
402| "Fear & greed index?" | `/api/v1/coinank/indicator/fear-greed` |
403| "Altcoin season?" | `/api/v1/coinank/indicator/altcoin-season` |
404| "Bitcoin cycle position?" | `/api/v1/coinank/indicator/btc-multiplier`, `ahr999` |
405| "Which coins have extreme funding rates?" | `/api/v1/coinank/funding-rate/current type=current` |
406| "Most negative funding rates?" | `/api/v1/nofx/funding-rate/low limit=20` |
407| "Which coins have the most capital inflows?" | `/api/v1/nofx/netflow/top-ranking limit=20 duration=1h` |
408| "Fund flow for BTC?" | `/api/v1/coinank/fund/realtime sortBy=h1net productType=SWAP` |
409| "Recent large liquidations?" | `/api/v1/coinank/liquidation/orders baseCoin=BTC` |
410| "BTC liquidation map / price clusters?" | `/api/v1/coinank/liquidation/liq-map symbol=BTCUSDT exchange=Binance interval=1d` |
411| "BTC open interest?" | `/api/v1/coinank/oi/all baseCoin=BTC` |
412| "Biggest OI increases?" | `/api/v1/nofx/oi/top-ranking limit=20 duration=1h` |
413| "BTC long/short ratio?" | `/api/v1/coinank/longshort/realtime baseCoin=BTC interval=1h` |
414| "Whale positions on HyperLiquid?" | `/api/v1/coinank/hyper/top-position sortBy=pnl sortType=desc` |
415| "Recent whale trades?" | `/api/v1/coinank/hyper/top-action` |
416| "Bitcoin ETF inflows today?" | `/api/v1/coinank/etf/us-btc-inflow` |
417| "Ethereum ETF flows?" | `/api/v1/coinank/etf/us-eth-inflow` |
418| "Top AI-picked coins?" | `/api/v1/nofx/ai500/list limit=20` |
419| "CVD for BTC?" | `/api/v1/coinank/market-order/agg-cvd exchanges= symbol=BTCUSDT interval=1h size=24` |
420| "Is buying pressure real?" | `/api/v1/coinank/market-order/agg-cvd` |
421| "BTC price?" | `/api/v1/coinank/price/last symbol=BTCUSDT exchange=Binance productType=SWAP` |
422| "Top gainers today?" | `/api/v1/nofx/price/ranking duration=24h` |
423| "Trending on Upbit?" | `/api/v1/nofx/upbit/hot limit=20` |
424| "Latest crypto news?" | `/api/v1/coinank/news/list type=2 lang=en page=1 pageSize=10` |
425
426### US Stocks
427
428| User says | Command |
429|-----------|---------|
430| "AAPL stock price right now?" | `/api/v1/alpaca/quotes/latest symbols=AAPL` |
431| "AAPL daily chart last month?" | `/api/v1/alpaca/bars symbols=AAPL timeframe=1Day start=2024-01-01` |
432| "Full AAPL snapshot?" | `/api/v1/alpaca/snapshots symbols=AAPL` |
433| "Top movers today?" | `/api/v1/alpaca/movers top=10 market_type=stocks` |
434| "Most traded stocks?" | `/api/v1/alpaca/most-actives top=10` |
435| "AAPL OHLCV bars (Polygon)?" | `/api/v1/polygon/aggs/ticker stocks_ticker=AAPL multiplier=1 timespan=day from=... to=...` |
436| "Market open today?" | `/api/v1/polygon/market-status` |
437| "AAPL RSI?" | `/api/v1/polygon/rsi stock_ticker=AAPL timespan=day window=14` |
438| "AAPL options chain?" | `/api/v1/polygon/options/snapshot underlying_asset=AAPL` |
439| "AAPL stock overview/fundamentals?" | `/api/v1/stocks/us/overview symbol=AAPL` |
440| "AAPL earnings history?" | `/api/v1/stocks/us/earnings symbol=AAPL` |
441| "AAPL income statement?" | `/api/v1/stocks/us/income symbol=AAPL` |
442| "AAPL MACD?" | `/api/v1/stocks/us/macd symbol=AAPL interval=daily` |
443| "Top gainers/losers today?" | `/api/v1/stocks/us/movers` |
444| "AAPL news sentiment?" | `/api/v1/stocks/us/news tickers=AAPL` |
445
446### China A-Shares
447
448| User says | Command |
449|-----------|---------|
450| "List all A-share stocks?" | `/api/v1/stocks/cn/stock-basic list_status=L` |
451| "000001.SZ daily chart?" | `/api/v1/stocks/cn/daily ts_code=000001.SZ start_date=20240101 end_date=20240131` |
452| "Trading calendar for January?" | `/api/v1/stocks/cn/trade-cal start_date=20240101 end_date=20240131` |
453| "Northbound flows today?" | `/api/v1/stocks/cn/northbound trade_date=20240315` |
454| "Money flow for 000001?" | `/api/v1/stocks/cn/moneyflow ts_code=000001.SZ start_date=20240101` |
455| "Dragon tiger list?" | `/api/v1/stocks/cn/top-list trade_date=20240315` |
456| "Margin data?" | `/api/v1/stocks/cn/margin ts_code=000001.SZ start_date=20240101` |
457
458### Forex & Global
459
460| User says | Command |
461|-----------|---------|
462| "EUR/USD rate?" | `/api/v1/twelvedata/price symbol=EUR/USD` |
463| "EUR/USD hourly chart?" | `/api/v1/twelvedata/time-series symbol=EUR/USD interval=1h outputsize=50` |
464| "Gold price?" | `/api/v1/twelvedata/metals/price symbol=XAU/USD` |
465| "Gold daily chart?" | `/api/v1/twelvedata/metals/time-series symbol=XAU/USD interval=1day` |
466| "S&P 500 index level?" | `/api/v1/twelvedata/indices/quote symbol=SPX` |
467| "What global indices are available?" | `/api/v1/twelvedata/indices/list` |
468| "Economic calendar this week?" | `/api/v1/twelvedata/economic-calendar` |
469| "EUR/USD RSI?" | `/api/v1/twelvedata/indicator/rsi symbol=EUR/USD interval=1h time_period=14` |
470| "Available forex pairs?" | `/api/v1/twelvedata/forex-pairs` |
471
472### AI Inference
473
474| User says | Command |
475|-----------|---------|
476| "Analyze this market data with AI" | `POST /api/v1/ai/openai/chat` with `gpt-4o` |
477| "Quick AI summary (cheap)" | `POST /api/v1/ai/openai/chat/mini` or `POST /api/v1/ai/anthropic/messages/haiku` |
478| "Deep AI analysis" | `POST /api/v1/ai/anthropic/messages/opus` |
479| "Embed this text" | `POST /api/v1/ai/openai/embeddings` |
480| "Generate an image" | `POST /api/v1/ai/openai/images` |
481| "List OpenAI models" | `/api/v1/ai/openai/models` |
482
483---
484
485## Complete Endpoint Reference
486
487### 🤖 AI Trading Signals (Nofxos) — $0.001/call
488
489| Endpoint | Description | Key Params |
490|----------|-------------|------------|
491| `/api/v1/nofx/ai500/list` | AI500 high-potential coins (score > 70) | `limit` |
492| `/api/v1/nofx/ai500/stats` | AI500 index statistics | — |
493| `/api/v1/nofx/ai300/list` | AI300 quant model rankings | `limit` |
494| `/api/v1/nofx/ai300/stats` | AI300 statistics | — |
495| `/api/v1/nofx/netflow/top-ranking` | Top net capital inflow coins | `limit`, `duration`, `type` |
496| `/api/v1/nofx/netflow/low-ranking` | Top net capital outflow coins | `limit`, `duration`, `type` |
497| `/api/v1/nofx/oi/top-ranking` | Biggest OI increase coins | `limit`, `duration` |
498| `/api/v1/nofx/oi/low-ranking` | Biggest OI decrease coins | `limit`, `duration` |
499| `/api/v1/nofx/price/ranking` | Price change rankings | `duration` |
500| `/api/v1/nofx/funding-rate/top` | Highest funding rate coins | `limit` |
501| `/api/v1/nofx/funding-rate/low` | Most negative funding rate coins | `limit` |
502| `/api/v1/nofx/upbit/hot` | Upbit hot coins by volume | `limit` |
503| `/api/v1/nofx/upbit/netflow/top-ranking` | Upbit net inflow rankings | `limit`, `duration` |
504| `/api/v1/nofx/upbit/netflow/low-ranking` | Upbit net outflow rankings | `limit`, `duration` |
505| `/api/v1/nofx/query-rank/list` | Most searched coin rankings | `limit` |
506
507**`duration` values:** `5m` `15m` `1h` `4h` `24h`
508
509---
510
511### 📈 Crypto Market Data (Coinank) — $0.001–$0.003/call
512
513#### Price & Candlesticks
514| Endpoint | Description | Key Params |
515|----------|-------------|------------|
516| `/api/v1/coinank/price/last` | Real-time latest price | `symbol`, `exchange`, `productType` |
517| `/api/v1/coinank/kline/lists` | OHLCV candlestick data | `symbol`, `exchange`, `interval`, `size`, `endTime` |
518
519#### ETF Flows
520| Endpoint | Description |
521|----------|-------------|
522| `/api/v1/coinank/etf/us-btc` | US Bitcoin ETF list (IBIT, FBTC, ARKB, etc.) |
523| `/api/v1/coinank/etf/us-eth` | US Ethereum ETF list |
524| `/api/v1/coinank/etf/us-btc-inflow` | US BTC ETF historical net inflow |
525| `/api/v1/coinank/etf/us-eth-inflow` | US ETH ETF historical net inflow |
526| `/api/v1/coinank/etf/hk-inflow` | Hong Kong crypto ETF net inflow |
527
528#### Fund Flow
529| Endpoint | Description | Key Params |
530|----------|-------------|------------|
531| `/api/v1/coinank/fund/realtime` | Real-time fund flow rankings | `sortBy` (h1net/h4net/h24net), `productType`, `size` |
532| `/api/v1/coinank/fund/history` | Historical fund flow by coin | `baseCoin`, `interval`, `size`, `endTime` |
533
534#### Open Interest
535| Endpoint | Description | Key Params |
536|----------|-------------|------------|
537| `/api/v1/coinank/oi/all` | Real-time OI by exchange | `baseCoin` |
538| `/api/v1/coinank/oi/agg-chart` | Aggregated OI history | `baseCoin`, `exchange`, `interval`, `size`, `endTime` |
539| `/api/v1/coinank/oi/symbol-chart` | OI history by trading pair | `exchange`, `symbol`, `interval`, `size`, `endTime` |
540| `/api/v1/coinank/oi/kline` | OI candlestick | `exchange`, `symbol`, `interval`, `size`, `endTime` |
541| `/api/v1/coinank/oi/vs-market-cap-hist` | OI / market cap ratio history | `baseCoin`, `interval`, `size`, `endTime` |
542
543#### Liquidations
544| Endpoint | Description | Key Params |
545|----------|-------------|------------|
546| `/api/v1/coinank/liquidation/orders` | Recent liquidation orders | `baseCoin`, `exchange`, `side`, `amount`, `endTime` |
547| `/api/v1/coinank/liquidation/intervals` | Liquidation stats by period | `baseCoin` |
548| `/api/v1/coinank/liquidation/agg-history` | Aggregated liquidation history | `baseCoin`, `interval`, `size`, `endTime` |
549| `/api/v1/coinank/liquidation/liq-map` | Liquidation price-level clusters | `symbol`, `exchange`, `interval` |
550| `/api/v1/coinank/liquidation/heat-map` | Liquidation heatmap | `exchange`, `symbol`, `interval` |
551
552#### Long/Short Ratios
553| Endpoint | Description | Key Params |
554|----------|-------------|------------|
555| `/api/v1/coinank/longshort/realtime` | Real-time L/S ratio by exchange | `baseCoin`, `interval` |
556| `/api/v1/coinank/longshort/buy-sell` | Global buy-sell L/S history | `baseCoin`, `interval`, `size`, `endTime` |
557| `/api/v1/coinank/longshort/person` | Account-level L/S ratio | `exchange`, `symbol`, `interval`, `size`, `endTime` |
558| `/api/v1/coinank/longshort/position` | Whale position-level L/S | `exchange`, `symbol`, `interval`, `size`, `endTime` |
559
560#### Funding Rates
561| Endpoint | Description | Key Params |
562|----------|-------------|------------|
563| `/api/v1/coinank/funding-rate/current` | Real-time funding rate rankings | `type` (current/day/week/month/year) |
564| `/api/v1/coinank/funding-rate/accumulated` | Accumulated funding cost | `type` |
565| `/api/v1/coinank/funding-rate/hist` | Historical funding rates | `baseCoin`, `exchangeType`, `size`, `endTime` |
566| `/api/v1/coinank/funding-rate/weighted` | Weighted average funding rate | `baseCoin`, `interval`, `size`, `endTime` |
567| `/api/v1/coinank/funding-rate/heatmap` | Funding rate heatmap | `type` (openInterest/marketCap), `interval` |
568
569#### Whale Activity
570| Endpoint | Description | Key Params |
571|----------|-------------|------------|
572| `/api/v1/coinank/hyper/top-position` | HyperLiquid whale positions | `sortBy`, `sortType`, `page`, `size` |
573| `/api/v1/coinank/hyper/top-action` | HyperLiquid whale trade actions | — |
574| `/api/v1/coinank/trades/large` | Large block trades | `symbol`, `productType`, `amount`, `size`, `endTime` |
575| `/api/v1/coinank/big-order/list` | Large limit orders | `symbol`, `exchangeType`, `size`, `amount`, `side` |
576
577#### Taker Flow / CVD
578| Endpoint | Description | Key Params |
579|----------|-------------|------------|
580| `/api/v1/coinank/market-order/cvd` | CVD for single pair | `exchange`, `symbol`, `interval`, `size`, `endTime` |
581| `/api/v1/coinank/market-order/agg-cvd` | Aggregated CVD cross-exchange | `exchanges` (empty=all), `symbol`, `interval`, `size`, `endTime` |
582| `/api/v1/coinank/market-order/buy-sell-value` | Taker buy/sell value USD | `exchange`, `symbol`, `interval`, `size`, `endTime` |
583| `/api/v1/coinank/market-order/agg-buy-sell-value` | Aggregated buy/sell value | `exchanges`, `symbol`, `interval`, `size`, `endTime` |
584
585#### Rankings & Screeners
586| Endpoint | Description | Key Params |
587|----------|-------------|------------|
588| `/api/v1/coinank/rank/screener` | Multi-dimensional screener | `interval` |
589| `/api/v1/coinank/rank/oi` | OI rankings | `sortBy`, `sortType`, `size` |
590| `/api/v1/coinank/rank/liquidation` | Liquidation rankings | `sortBy`, `sortType`, `size` |
591| `/api/v1/coinank/rank/volume` | Volume rankings | `sortBy`, `sortType` |
592| `/api/v1/coinank/rank/price` | Price change rankings | `sortBy`, `sortType` |
593| `/api/v1/coinank/rsi/list` | RSI screener | `interval` (1H/4H/1D — uppercase) |
594
595#### Market Cycle Indicators
596| Endpoint | Description |
597|----------|-------------|
598| `/api/v1/coinank/indicator/fear-greed` | Crypto fear & greed index |
599| `/api/v1/coinank/indicator/altcoin-season` | Altcoin Season Index |
600| `/api/v1/coinank/indicator/btc-multiplier` | BTC 2-year MA multiplier |
601| `/api/v1/coinank/indicator/ahr999` | AHR999 accumulation indicator |
602| `/api/v1/coinank/indicator/puell-multiple` | Puell Multiple |
603| `/api/v1/coinank/indicator/ma-heatmap` | 200-week MA heatmap |
604| `/api/v1/coinank/indicator/market-cap-rank` | Coin market cap share |
605
606#### News
607| Endpoint | Description | Key Params |
608|----------|-------------|------------|
609| `/api/v1/coinank/news/list` | News & flash alerts | `type` (1=flash, 2=news), `lang` (zh/en), `page`, `pageSize` |
610| `/api/v1/coinank/news/detail` | Full article by ID | `id` |
611
612---
613
614### 📊 US Stocks — Alpaca Markets — $0.001–$0.003/call
615
616| Endpoint | Description | Key Params |
617|----------|-------------|------------|
618| `/api/v1/alpaca/quotes/latest` | Real-time quotes | `symbols`, `feed`, `currency` |
619| `/api/v1/alpaca/quotes/history` | Historical tick quotes | `symbols`, `start`, `end`, `limit`, `feed` |
620| `/api/v1/alpaca/bars/latest` | Latest OHLCV bar | `symbols`, `feed`, `currency` |
621| `/api/v1/alpaca/bars` | Historical OHLCV bars | `symbols`, `timeframe`, `start`, `end`, `limit`, `adjustment` |
622| `/api/v1/alpaca/trades/latest` | Real-time latest trade | `symbols`, `feed` |
623| `/api/v1/alpaca/trades/history` | Historical trades | `symbols`, `start`, `end`, `limit`, `feed` |
624| `/api/v1/alpaca/snapshots` | Full snapshot (multi-symbol) | `symbols`, `feed` |
625| `/api/v1/alpaca/snapshot` | Full snapshot (single symbol) | `symbols`, `feed` |
626| `/api/v1/alpaca/movers` | Top movers by % change | `top`, `market_type` |
627| `/api/v1/alpaca/most-actives` | Most active by volume | `top`, `market_type` |
628| `/api/v1/alpaca/news` | Financial news | `symbols`, `start`, `end`, `limit` |
629| `/api/v1/alpaca/corporate-actions` | Dividends, splits, etc. | `symbols`, `types`, `start`, `end` |
630| `/api/v1/alpaca/options/bars` | Options OHLCV bars | `symbols`, `timeframe`, `start`, `end` |
631| `/api/v1/alpaca/options/quotes/latest` | Options latest quotes | `symbols`, `feed` |
632| `/api/v1/alpaca/options/snapshots` | Options chain snapshots | `symbols`, `feed` |
633
634**`timeframe` values:** `1Min` `5Min` `15Min` `1Hour` `1Day`
635**`market_type` values:** `stocks` `crypto`
636
637---
638
639### 📉 US Stocks — Polygon — $0.001–$0.003/call
640
641| Endpoint | Description | Key Params |
642|----------|-------------|------------|
643| `/api/v1/polygon/aggs/ticker` | OHLCV bars | `stocks_ticker`, `multiplier`, `timespan`, `from`, `to` |
644| `/api/v1/polygon/aggs/grouped` | Grouped daily bars | `date`, `adjusted` |
645| `/api/v1/polygon/prev-close` | Previous session close | `stocks_ticker` |
646| `/api/v1/polygon/snapshot/ticker` | Full ticker snapshot | `stocks_ticker` |
647| `/api/v1/polygon/snapshot/all` | All tickers snapshot | `tickers` |
648| `/api/v1/polygon/snapshot/gainers` | Top daily gainers | — |
649| `/api/v1/polygon/snapshot/losers` | Top daily losers | — |
650| `/api/v1/polygon/trades` | Recent trades | `stocks_ticker` |
651| `/api/v1/polygon/last-trade` | Last trade | `stocks_ticker` |
652| `/api/v1/polygon/quotes` | Recent quotes | `stocks_ticker` |
653| `/api/v1/polygon/last-quote` | Last NBBO quote | `stocks_ticker` |
654| `/api/v1/polygon/ticker-details` | Company details | `ticker` |
655| `/api/v1/polygon/ticker-news` | Company news | `ticker` |
656| `/api/v1/polygon/tickers` | Ticker search | `ticker`, `type`, `market` |
657| `/api/v1/polygon/market-status` | US market open/closed | — |
658| `/api/v1/polygon/market-holidays` | Market holidays | — |
659| `/api/v1/polygon/exchanges` | Exchange list | — |
660| `/api/v1/polygon/sma` | SMA indicator | `stocks_ticker`, `timespan`, `window` |
661| `/api/v1/polygon/ema` | EMA indicator | `stocks_ticker`, `timespan`, `window` |
662| `/api/v1/polygon/rsi` | RSI indicator | `stock_ticker`, `timespan`, `window` |
663| `/api/v1/polygon/macd` | MACD indicator | `stocks_ticker`, `timespan` |
664| `/api/v1/polygon/options/contracts` | Options contracts list | `underlying_asset`, `contract_type`, `expiration_date` |
665| `/api/v1/polygon/options/contract-details` | Single contract details | `options_ticker` |
666| `/api/v1/polygon/options/snapshot` | Options chain snapshot | `underlying_asset` |
667| `/api/v1/polygon/options/snapshot/contract` | Single option snapshot | `options_ticker` |
668
669**`timespan` values:** `minute` `hour` `day` `week` `month` `quarter` `year`
670
671---
672
673### 🏢 US Fundamentals — Alpha Vantage — $0.001–$0.003/call
674
675| Endpoint | Description | Key Params |
676|----------|-------------|------------|
677| `/api/v1/stocks/us/quote` | Real-time quote | `symbol` |
678| `/api/v1/stocks/us/search` | Symbol search | `keywords` |
679| `/api/v1/stocks/us/daily` | Daily OHLCV | `symbol`, `outputsize` (compact/full) |
680| `/api/v1/stocks/us/daily-adjusted` | Adjusted daily OHLCV | `symbol`, `outputsize` |
681| `/api/v1/stocks/us/intraday` | Intraday OHLCV | `symbol`, `interval` (1min/5min/15min/30min/60min), `outputsize` |
682| `/api/v1/stocks/us/weekly` | Weekly OHLCV | `symbol` |
683| `/api/v1/stocks/us/monthly` | Monthly OHLCV | `symbol` |
684| `/api/v1/stocks/us/overview` | Company fundamentals | `symbol` |
685| `/api/v1/stocks/us/earnings` | Quarterly & annual earnings | `symbol` |
686| `/api/v1/stocks/us/income` | Income statement | `symbol` |
687| `/api/v1/stocks/us/balance-sheet` | Balance sheet | `symbol` |
688| `/api/v1/stocks/us/cash-flow` | Cash flow statement | `symbol` |
689| `/api/v1/stocks/us/movers` | Top gainers/losers/most active | — |
690| `/api/v1/stocks/us/news` | News & sentiment | `tickers`, `topics` |
691| `/api/v1/stocks/us/rsi` | RSI | `symbol`, `interval`, `time_period` |
692| `/api/v1/stocks/us/macd` | MACD | `symbol`, `interval` |
693| `/api/v1/stocks/us/bbands` | Bollinger Bands | `symbol`, `interval`, `time_period` |
694| `/api/v1/stocks/us/sma` | SMA | `symbol`, `interval`, `time_period` |
695| `/api/v1/stocks/us/ema` | EMA | `symbol`, `interval`, `time_period` |
696
697---
698
699### 🇨🇳 China A-Shares — Tushare — $0.001–$0.003/call
700
701| Endpoint | Description | Key Params |
702|----------|-------------|------------|
703| `/api/v1/stocks/cn/stock-basic` | Listed stock directory | `list_status` (L/D/P), `ts_code` |
704| `/api/v1/stocks/cn/daily` | Daily OHLCV | `ts_code`, `start_date`, `end_date` |
705| `/api/v1/stocks/cn/weekly` | Weekly OHLCV | `ts_code`, `start_date`, `end_date` |
706| `/api/v1/stocks/cn/monthly` | Monthly OHLCV | `ts_code`, `start_date`, `end_date` |
707| `/api/v1/stocks/cn/daily-basic` | Daily valuation metrics | `ts_code`, `trade_date` |
708| `/api/v1/stocks/cn/trade-cal` | Trading calendar | `start_date`, `end_date`, `is_open` |
709| `/api/v1/stocks/cn/income` | Income statement | `ts_code`, `period` |
710| `/api/v1/stocks/cn/balance-sheet` | Balance sheet | `ts_code`, `period` |
711| `/api/v1/stocks/cn/cash-flow` | Cash flow statement | `ts_code`, `period` |
712| `/api/v1/stocks/cn/dividend` | Dividend history | `ts_code` |
713| `/api/v1/stocks/cn/northbound` | Northbound capital flow | `trade_date` |
714| `/api/v1/stocks/cn/moneyflow` | Money flow (net in/out) | `ts_code`, `start_date` |
715| `/api/v1/stocks/cn/margin` | Margin trading summary | `ts_code`, `start_date`, `end_date` |
716| `/api/v1/stocks/cn/margin-detail` | Margin trading detail | `ts_code`, `trade_date` |
717| `/api/v1/stocks/cn/top-list` | Dragon Tiger List (top traders) | `trade_date` |
718| `/api/v1/stocks/cn/top-inst` | Institutional top list | `trade_date`, `ts_code` |
719
720**Date format:** `YYYYMMDD` (e.g., `20240315`)
721**Stock code format:** `000001.SZ` (Shenzhen) · `600000.SH` (Shanghai)
722
723---
724
725### 🌍 Forex & Global — Twelve Data — $0.001–$0.005/call
726
727| Endpoint | Description | Key Params |
728|----------|-------------|------------|
729| `/api/v1/twelvedata/time-series` | Time series (OHLCV) | `symbol`, `interval`, `outputsize` |
730| `/api/v1/twelvedata/price` | Real-time price | `symbol` |
731| `/api/v1/twelvedata/quote` | Full quote | `symbol` |
732| `/api/v1/twelvedata/eod` | End-of-day price | `symbol` |
733| `/api/v1/twelvedata/exchange-rate` | Currency exchange rate | `symbol` (e.g., `USD/JPY`) |
734| `/api/v1/twelvedata/forex-pairs` | Available forex pairs | — |
735| `/api/v1/twelvedata/economic-calendar` | Economic events calendar | — |
736| `/api/v1/twelvedata/metals/price` | Precious metals real-time | `symbol` (XAU/USD, XAG/USD) |
737| `/api/v1/twelvedata/metals/time-series` | Metals OHLCV history | `symbol`, `interval` |
738| `/api/v1/twelvedata/indices/list` | Global indices directory | — |
739| `/api/v1/twelvedata/indices/quote` | Index quote | `symbol` (SPX, NDX, DJI) |
740| `/api/v1/twelvedata/indicator/sma` | SMA | `symbol`, `interval`, `time_period`, `outputsize` |
741| `/api/v1/twelvedata/indicator/ema` | EMA | `symbol`, `interval`, `time_period`, `outputsize` |
742| `/api/v1/twelvedata/indicator/rsi` | RSI | `symbol`, `interval`, `time_period`, `outputsize` |
743| `/api/v1/twelvedata/indicator/macd` | MACD | `symbol`, `interval` |
744| `/api/v1/twelvedata/indicator/bbands` | Bollinger Bands | `symbol`, `interval`, `time_period` |
745| `/api/v1/twelvedata/indicator/atr` | ATR (volatility) | `symbol`, `interval`, `time_period` |
746| `/api/v1/twelvedata/time-series/complex` | Complex multi-indicator POST | JSON body |
747
748**`interval` values:** `1min` `5min` `15min` `30min` `1h` `2h` `4h` `1day` `1week` `1month`
749**Symbol examples:** `EUR/USD` `GBP/JPY` `BTC/USD` `AAPL` `XAU/USD` `SPX`
750
751---
752
753### 🤖 AI Inference — OpenAI & Anthropic — $0.001–$0.015/call
754
755#### OpenAI (all POST except models)
756| Endpoint | Description | Cost | Body |
757|----------|-------------|------|------|
758| `/api/v1/ai/openai/chat` | GPT-4o chat | $0.010 | `{model, messages, max_tokens}` |
759| `/api/v1/ai/openai/chat/mini` | GPT-4o-mini chat | $0.001 | `{messages, max_tokens}` |
760| `/api/v1/ai/openai/embeddings` | text-embedding-3-small | $0.001 | `{input, model}` |
761| `/api/v1/ai/openai/embeddings/large` | text-embedding-3-large | $0.005 | `{input, model}` |
762| `/api/v1/ai/openai/images` | DALL-E image generation | $0.050 | `{prompt, n, size}` |
763| `/api/v1/ai/openai/models` | List available models (GET) | $0.001 | — |
764
765#### Anthropic (all POST)
766| Endpoint | Description | Cost | Body |
767|----------|-------------|------|------|
768| `/api/v1/ai/anthropic/messages` | Claude Sonnet (balanced) | $0.010 | `{model, max_tokens, messages}` |
769| `/api/v1/ai/anthropic/messages/haiku` | Claude Haiku (fast, cheap) | $0.005 | `{max_tokens, messages}` |
770| `/api/v1/ai/anthropic/messages/opus` | Claude Opus (best reasoning) | $0.015 | `{max_tokens, messages}` |
771
772---
773
774## Parameter Reference
775
776### Crypto (Coinank / Nofxos)
777| Parameter | Values / Format |
778|-----------|-----------------|
779| `exchange` | `Binance` `OKX` `Bybit` `Bitget` `dYdX` |
780| `productType` | `SWAP` (perpetual futures) · `SPOT` |
781| `interval` (crypto) | `1m` `5m` `15m` `1h` `4h` `1d` |
782| `duration` (nofx) | `5m` `15m` `1h` `4h` `24h` |
783| `endTime` | Unix timestamp in **milliseconds** — use `Date.now()` if omitted |
784| `size` | Number of data points (default varies, max ~500) |
785| `sortType` | `asc` or `desc` |
786| `lang` (news) | `en` (English) · `zh` (Chinese) |
787| RSI `interval` | **Uppercase**: `1H` `4H` `1D` |
788
789### US Stocks
790| Parameter | Values / Format |
791|-----------|-----------------|
792| `symbols` (Alpaca) | Comma-separated: `AAPL,TSLA,MSFT` |
793| `timeframe` (Alpaca) | `1Min` `5Min` `15Min` `1Hour` `1Day` |
794| `start` / `end` (Alpaca) | ISO date: `2024-01-01` |
795| `timespan` (Polygon) | `minute` `hour` `day` `week` `month` `year` |
796| `from` / `to` (Polygon) | ISO date: `2024-01-01` |
797| `interval` (Alpha Vantage) | `1min` `5min` `15min` `30min` `60min` `daily` `weekly` `monthly` |
798
799### China A-Shares
800| Parameter | Values / Format |
801|-----------|-----------------|
802| `ts_code` | `000001.SZ` (Shenzhen) · `600000.SH` (Shanghai) |
803| `start_date` / `end_date` | `YYYYMMDD`: `20240101` |
804| `trade_date` | `YYYYMMDD`: `20240315` |
805| `list_status` | `L` (listed) · `D` (delisted) · `P` (paused) |
806
807---
808
809## Tips for Best Results
810
811- **Chain data calls** for richer analysis: fetch crypto signals → US stocks → run AI synthesis in one session
812- **Use `Date.now()` for `endTime`** when fetching real-time crypto data
813- **`exchanges=""` (empty string)** in Coinank market-order agg endpoints means all exchanges
814- **POST endpoints** (AI, Twelvedata complex): use `node scripts/query.mjs <path> --post '<json>'`
815- **VIP1/2/3/4 crypto endpoints** are accessible through claw402 like all others — no extra config
816- **Free catalog**: `https://claw402.ai/api/v1/catalog` — always up to date, no payment required
817- **Present results clearly**: use tables or bullet points, not raw JSON. Highlight the most actionable numbers
818- **Cost check**: total for a full market analysis session (5–10 calls) is typically < $0.02 USDC
819
820---
821
822*Powered by [claw402.ai](https://claw402.ai) — x402 micropayment gateway for AI agents.*