Agent-payable crypto data API (x402)
AI agents and developers can call SwapHunt directly: 30 endpoints for prices, hourly funding rates, volatility, market regime, sanity and anti-FOMO checks, coin strength and momentum, the SwapHunt Alt Season Index, the Crypto Fear & Greed Index, the next halving, and trading session context. Paid per call in USDC, with no account or API key.
Pricing per call
Each call costs $0.001 to $0.005 in USDC, depending on the endpoint, and you only pay for successful calls. Pay on Base, Polygon, Arbitrum or Solana; the price is the same on every network. No account, no API key, no subscription. The server answers an unpaid request with 402 Payment Required and the price; an x402 client pays and retries automatically.
Interactive docs, OpenAPI spec, Agentic Market listing, Code examples on GitHub, API status, free widgets to embed
Endpoints
Prices in USDC per successful call. Base URL https://x402.swaphunt.dev. Last updated .
Prices
| Endpoint | What you get | Price |
|---|---|---|
/v1/tools/price |
Get asset price (Hyperliquid perpetuals, USDC)asset, currency, price_type
Details and exampleSwapHunt is a crypto market-context API for trading agents, with live prices, funding, volatility and market regime from Hyperliquid perpetuals, the SwapHunt Alt Season Index, Fear & Greed, the halving and session context, all pay-per-call (docs and pricing at https://swaphunt.dev/api). This route returns one asset's live price from Hyperliquid perpetuals (USDC-margined), quoted in USDC: the perp mark price (or the order-book mid with price_type=mid), 24h mark change % and 24h notional volume in USDC. high_24h/low_24h are null. Any active Hyperliquid perp such as BTC, ETH or SOL; see /v1/tools/price/supported. For many assets at once use /v1/tools/price/multi.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
/v1/tools/price/multi |
Get multiple asset prices (Hyperliquid perpetuals, USDC)assets, currency, price_type
Details and exampleBatch prices for up to 20 assets in one call from Hyperliquid perpetuals (USDC-margined), quoted in USDC, each with the perp mark price (or order-book mid with price_type=mid), 24h mark change % and 24h notional volume, keyed by symbol. Unknown symbols are skipped. The cost-efficient way to price a basket or portfolio in a single request instead of N calls.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/tools/price/supported |
Get supported assets (active Hyperliquid perpetuals)
Details and exampleEvery asset /v1/tools/price and /v1/tools/price/multi can quote: all active Hyperliquid perpetuals (USDC-margined), by Hyperliquid name (e.g. kPEPE = 1,000 PEPE). Call this once to discover valid `asset` symbols before pricing. Returns an object with the asset list, count, quote currency (USDC) and source, plus `covered`: the coins the analysis endpoints accept (top 50 Hyperliquid perpetuals by 30-day volume, recomputed daily) and the `coverage_rule`.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
Market
| Endpoint | What you get | Price |
|---|---|---|
/v1/market/alt-season |
SwapHunt Alt Season Index (Hyperliquid perpetuals)
Details and exampleSwapHunt Alt Season Index (0-100), computed daily from Hyperliquid perpetuals (USDC-margined): share of the top 100 Hyperliquid perpetuals by 30-day volume (excl. BTC and stablecoins, delisted perps included while traded) outperforming BTC over 90 days. 75 or above is alt season, 25 or below is bitcoin season, otherwise neutral. Returns the index, label, is_alt_season, universe size, number outperforming and BTC's 90-day return. Use to time rotation between BTC and alts.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/market/coin-strength |
Coin strength vs BTC (Hyperliquid perpetuals)coin, period, quote
Details and exampleRelative strength of a coin vs BTC on Hyperliquid perpetuals (USDC-margined): the coin's return minus BTC's over 24h, 7d or 30d, as a category (very_strong to very_weak) plus the strength ratio. Use to see whether an alt is leading or lagging BTC before entering. A strength read, not a price target. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/market/correlation |
Coin correlation with BTC (Hyperliquid perpetuals)coin, period, quote
Details and examplePearson correlation (-1 to +1) of a coin's returns vs BTC on Hyperliquid perpetuals (USDC-margined): 7d on 1h candles or 30d on 4h candles, with a strength label and data point count. Use to judge diversification and whether an alt moves on its own or just tracks BTC. A correlation coefficient, not a beta. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/market/fear-greed |
Get Fear & Greed Index
Details and exampleCurrent Crypto Fear & Greed Index (0-100) with its label (Extreme Fear to Extreme Greed), updated daily. A single market-mood gauge for risk-on/risk-off context. For trend over time use /v1/market/fear-greed/compare or /v1/market/fear-greed/history.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
/v1/market/fear-greed/compare |
Get Fear & Greed with historical comparison
Details and exampleFear & Greed now vs yesterday, 7 days and 30 days ago, with the deltas, so an agent can see whether market sentiment is improving or deteriorating, not just today's number. Use for momentum-of-mood.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.002 |
/v1/market/fear-greed/history |
Get Fear & Greed historydays, start_date, end_date
Details and exampleHistorical Fear & Greed time series (up to 365 days), each day with value + classification. Use to backtest sentiment, chart mood cycles or correlate fear/greed with price. The raw series, not a summary.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.005 |
/v1/market/halving |
Get halving countdowncoin
Details and exampleBTC or LTC halving countdown: blocks remaining and the estimated date of the next halving. Use for cycle-timing narratives and supply-shock context. Estimate (block-time based), not an exact timestamp.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
/v1/market/momentum-rank |
Top momentum coins (Hyperliquid perpetuals)period, limit, quote
Details and exampleMomentum leaderboard of the covered Hyperliquid perpetuals (USDC-margined): every covered coin ranked by return over 24h, 7d or 30d, with top and bottom performers, notional volume in USDC and the average return. Use to surface rotation candidates and what is bleeding. Ranked movers, not fundamentals. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
Derivatives
| Endpoint | What you get | Price |
|---|---|---|
/v1/derivatives/funding-rates |
Get funding rates (Hyperliquid perpetuals, hourly)symbols
Details and exampleCurrent funding rates for up to 20 Hyperliquid perpetuals (USDC-margined). Funding is settled hourly: funding_rate_pct is the hourly rate and annualized_rate_pct = hourly rate times 8760, plus 7d/30d averages, mark price in USDC and a crowding signal. Positive = longs pay shorts (crowded longs). Use to read positioning before entering. Funding, not open interest.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/derivatives/funding-rates/history |
Get funding rate history (Hyperliquid perpetuals, hourly)symbol, days
Details and exampleSettled hourly funding rates for one coin on Hyperliquid perpetuals (USDC-margined), with average, range, share of positive periods and the percentile of the latest rate. Up to 365 days; history_days shows coverage per coin. Annualized = hourly rate times 8760. Use to judge whether today's funding is unusual for that coin.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.004 |
/v1/derivatives/funding-rates/top |
Get top funding rates (Hyperliquid perpetuals, hourly)limit, sort
Details and exampleTop N current funding rates, highest or lowest, across all active Hyperliquid perpetuals (USDC-margined; funding settled hourly, annualized = hourly rate times 8760): a leaderboard of the most crowded longs (highest) or shorts (lowest). Use to spot squeeze and crowding extremes fast.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
Volatility
| Endpoint | What you get | Price |
|---|---|---|
/v1/vol/compression-alert |
Detect volatility squeeze (Hyperliquid perpetuals)asset, timeframe, quote
Details and exampleBollinger-Band squeeze detector on candles from Hyperliquid perpetuals (USDC-margined): is volatility compressing toward a likely expansion? Returns extreme/strong/moderate/none, band width and its percentile; quote is USDC and pair like BTC-USDC. Use to anticipate breakouts before they fire. Detects the setup, not the direction.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/vol/expected-move |
Expected price range (Hyperliquid perpetuals)asset, period, quote
Details and exampleATR-based expected price range from candles of Hyperliquid perpetuals (USDC-margined): the 68% and 95% bands around the current price, in USDC; quote is USDC and pair like BTC-USDC. Use to set realistic targets, stops and breakout thresholds. A statistical range, not a directional forecast.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/vol/realized |
Get realized volatility (Hyperliquid perpetuals)asset, period
Details and exampleRealized volatility for an asset from daily candles of Hyperliquid perpetuals (USDC-margined): daily and annualized %, a low/normal/high/extreme bucket and the current UTC day's high/low/range vs open. Use to size positions and set expectations. Backward-looking (realized), not implied/option vol.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.002 |
/v1/vol/silence |
Get market silence score (Hyperliquid perpetuals)asset, lookback
Details and exampleMarket-silence score 0-1 from daily candles of Hyperliquid perpetuals (USDC-margined): a composite of low notional volume, low volatility and small price change. High silence often precedes expansion. Use to spot the calm-before-the-move. Pairs with /v1/vol/compression-alert.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.002 |
Market regime
| Endpoint | What you get | Price |
|---|---|---|
/v1/regime/chop-detection |
Is market choppy or trending? (Hyperliquid perpetuals)asset, timeframe, quote
Details and exampleADX-based chop-vs-trend detector on candles from Hyperliquid perpetuals (USDC-margined) for an asset/timeframe: is price trending or stuck in a range? Returns is_chop, a chop level, ADX, +DI/-DI and trend direction; quote is USDC and pair like BTC-USDC. Use to avoid trend strategies in chop (and range strategies in trends).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/regime/current |
Get current market regime (BTC, Hyperliquid perpetuals)
Details and exampleCurrent BTC market regime (BULLISH / BEARISH / NEUTRAL) from Hyperliquid perpetuals (USDC-margined): the BTC perp price vs its 20-period EMA on 12h candles, with the EMA value and slope (prices in USDC). Updates at each 12h close (00:00 and 12:00 UTC). The top-level risk filter: trade-with-trend context before any entry. BTC-based; pair with per-asset tools for alts.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.002 |
Trading context
| Endpoint | What you get | Price |
|---|---|---|
/v1/context/session |
What trading session is it?
Details and exampleCurrent trading session (Asia / London / NY / Off) plus historical volatility for that session. Use to time entries around the most active hours and set session-aware expectations.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
/v1/context/weekend-liquidity |
Is it weekend/low liquidity time?
Details and exampleIs it a weekend / low-liquidity window right now? Returns the current session and a 0-100 liquidity score. Use to widen stops and discount thin-market moves. Lightweight market-condition context.
Example response (real data, 2026-11-03; long lists shortened):
|
$0.001 |
Sanity checks
| Endpoint | What you get | Price |
|---|---|---|
/v1/sanity/is-this-a-breakout |
Is this breakout confirmed? (Hyperliquid perpetuals)symbol, level*, direction, quote
Details and exampleIs a breakout from a given level real or a fakeout? Checks volume vs the 20-candle average and how many 1h closes held beyond the level, on Hyperliquid perpetuals (USDC-margined), and returns is_confirmed, a fakeout probability and a verdict. Use to validate a breakout before chasing it. Requires the level in USDC. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/sanity/is-this-a-dip |
Is this actually a dip? (Hyperliquid perpetuals)symbol, quote
Details and exampleIs this drop a real dip or just noise? Compares the fall from the 14-day high with the 14-day ATR on daily candles of Hyperliquid perpetuals (USDC-margined) and returns is_dip, drop %, ATR %, drop/ATR and a verdict; prices in USDC. Use before buying the dip to check the dip is real. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/sanity/is-this-oversold |
Is this actually oversold? (Hyperliquid perpetuals)symbol, quote
Details and exampleMulti-timeframe RSI oversold check on Hyperliquid perpetuals (USDC-margined): RSI 14 on 1h, 4h and 1d candles, weighted 20/30/50, returning is_oversold, each RSI and the weighted RSI. Use to confirm an oversold condition across timeframes rather than trusting a single chart. RSI-based, not a buy signal on its own. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/sanity/is-this-support |
Is this actually support? (Hyperliquid perpetuals)symbol, level*, quote
Details and exampleIs a price level valid support? Counts touches within 0.5% over 90 daily candles of Hyperliquid perpetuals (USDC-margined), with recency and bounce quality, so an agent can judge whether the level is likely to hold. Use before leaning on a support for entries or stops. Requires the level in USDC. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
Anti-FOMO
| Endpoint | What you get | Price |
|---|---|---|
/v1/fomo/already-extended |
Is price already extended? (Hyperliquid perpetuals)symbol, quote
Details and exampleIs price over-extended? Distance from MA20 and MA50, Bollinger Band position and a z-score on 4h candles of Hyperliquid perpetuals (USDC-margined), in one read. Use to avoid entering after price has stretched far from its mean. Mean-reversion context. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/fomo/green-candles-streak |
How many green candles in a row? (Hyperliquid perpetuals)symbol, interval, quote
Details and exampleCounts consecutive green candles on 1h, 4h or 1d candles of Hyperliquid perpetuals (USDC-margined) and how often the next candle was green after streaks that long in the last 100 candles. Use to gauge exhaustion risk before buying a long green run. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/fomo/how-late-am-i |
How late am I to this move? (Hyperliquid perpetuals)symbol, quote
Details and exampleFOMO guard on 4h candles of Hyperliquid perpetuals (USDC-margined): how far price has already run from the recent swing low, in % and ATR multiples, and where that move ranks against past 20-candle moves, with an early/middle/late verdict. Use so an agent does not buy the top. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
/v1/fomo/pump-age |
How old is this pump? (Hyperliquid perpetuals)symbol, quote
Details and exampleActive pump detector on the last 24 hours of 15m candles of Hyperliquid perpetuals (USDC-margined): is the coin pumping now, since when, how far, and how that compares with the average pump length in the window. Use to judge whether a move is fresh or exhausted before joining it. Coverage: top 50 Hyperliquid perpetuals by 30-day volume; see /v1/tools/price/supported (other coins get 422 not_covered, no charge).
Example response (real data, 2026-11-03; long lists shortened):
|
$0.003 |
Where the data comes from
Prices, funding, volatility, market regime and the Alt Season Index are calculated by SwapHunt from Hyperliquid perpetuals (USDC-margined). Prices are quoted in USDC as mark or mid price, funding is settled hourly, and every response carries a source field.
The sanity, anti-FOMO, coin strength, momentum and correlation endpoints cover the top 50 Hyperliquid perpetuals by 30-day volume, recomputed daily. A covered coin is dropped only after it ranks below 60th place on three daily recomputes in a row, so the list stays stable. Other coins get 422 not_covered before any payment is requested, so you are never charged for them. The current list is in the covered field of /v1/tools/price/supported.
The Fear & Greed Index comes from Alternative.me, and each response includes an attribution field to show next to the number. The halving countdown is calculated from the current block height of each chain. Session and weekend liquidity context is calculated by SwapHunt from the clock and needs no outside data.
Code examples
An unpaid request returns 402 Payment Required. The price and payment details are in the payment-required header, base64-encoded:
curl -i https://x402.swaphunt.dev/v1/tools/price?asset=BTC
HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi...
# decoded:
{"x402Version": 2,
"accepts": [{"scheme": "exact",
"network": "eip155:8453", # Base
"asset": "0x8335...2913", # USDC
"amount": "1000", # 0.001 USDC (6 decimals)
"payTo": "0xD6b5...23a8"},
{"network": "eip155:137", ...}, # Polygon
{"network": "eip155:42161", ...}, # Arbitrum
{"network": "solana:5eykt4Us...", ...}]} # Solana
The client picks the network your wallet holds USDC on. The price is the same on every network.
An x402 client library reads that header, signs a USDC payment from your wallet and repeats the request with the payment attached. The response is the JSON you asked for. Clients exist for JavaScript, Python and Go.
Runnable examples in Python and TypeScript are in swaphunt/x402-examples on GitHub: a single paid call, a daily market brief and an alert bot. Every example does a dry run first and only pays when you ask it to.
See the x402 documentation for client setup.
Use it from Claude
The SwapHunt MCP server gives Claude and other MCP agents SwapHunt's endpoints as tools. Each tool description states its price, so the agent sees what a call costs before it makes it.
- Dry run by default. Without
X402_PAY=1a tool reports its price and returns no data. - Spending cap.
MAX_SPEND_USD(default $0.10) limits what one session can spend. Calls beyond it are refused, not paid. - Locked payments. Each payment is tied to the quoted price, USDC on Base and SwapHunt's receiving address.
The server is on PyPI as swaphunt-mcp. Use a dedicated wallet with a few dollars of USDC on Base. Adding it to Claude Code is one command, and uvx fetches the package on first run:
claude mcp add swaphunt \
--env X402_PAY=1 \
--env PRIVATE_KEY_FILE=$HOME/.swaphunt-wallet.key \
--env MAX_SPEND_USD=0.25 \
-- uvx swaphunt-mcp
Leave out X402_PAY=1 to try it first: every tool then reports its price without paying. Then ask, for example: "Is this BTC drop a real dip, and is ETH already extended?" Setup for Claude Desktop and the full tool list with prices are in the MCP server README.
FAQ
- What is x402?
- x402 is an open payment protocol built on HTTP 402 Payment Required. The server answers an unpaid request with the price, and an x402 client pays in USDC and repeats the request with the payment attached.
- Do I need an account or API key?
- No. There is no sign-up, API key or subscription. Each request is paid on its own.
- Which chains can I pay on?
- USDC on Base, Polygon, Arbitrum or Solana. The price is the same on every network.
- What does it cost?
- From $0.001 to $0.005 in USDC per successful call, depending on the endpoint. The table on this page lists the price of each one.
- Where are code examples?
- Runnable Python and TypeScript examples and an MCP server for Claude are in swaphunt/x402-examples on GitHub: https://github.com/swaphunt/x402-examples