Skip to main content
x402 support is currently in beta. Endpoints, pricing, and supported networks may change. Join the Mobula Telegram to report issues or share feedback.
The /x402/market/details endpoint provides real-time DEX pool and token market data, gated by a $0.001 USDC micropayment using the x402 payment protocol. No API key required — payment is the credential. This endpoint is identical to Get Market Details but uses pay-per-use access instead of API key authentication. It is designed for AI agents, autonomous scripts, and any x402-compatible client.

Supported Networks

Payment is accepted in USDC on:
NetworkCAIP-2
Base mainneteip155:8453
Solana mainnetsolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp

Price Per Call

$0.001 USDC per request, settled on-chain via the Coinbase CDP Facilitator.

Query Parameters

ParameterRequiredDescription
addressYesPool or token contract address. EVM: checksummed hex (0x…). Solana: base58 address. Pass a DEX pool address for exact pool data, or a token address to resolve the most liquid pool automatically.
blockchainYesBlockchain identifier. Accepted formats: full name (Ethereum, Solana), short code (eth, sol), CAIP-2 (eip155:1), or numeric chain ID (1, 56, 8453).
baseTokenNoOverride which token in the pair is treated as base for price calculations. Pass the contract address of the desired base token.
currenciesNoComma-separated currency codes for additional price fields. Example: EUR,GBP,BTC. USD is always included.

How x402 Payment Works

The x402 protocol follows a standard two-step flow: Step 1 — Request without payment (receives 402)
curl -i "https://api.mobula.io/x402/market/details?address=0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640&blockchain=Ethereum"
HTTP/1.1 402 Payment Required
payment-required: <base64-encoded payment requirements>
The payment-required header contains the accepted payment options (network, asset, amount, receiving address). Step 2 — Sign and retry with payment header Your x402-compatible client reads the payment-required header, signs a USDC transfer, and retries with the x-payment header:
curl -i "https://api.mobula.io/x402/market/details?address=0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640&blockchain=Ethereum" \
  -H "x-payment: <signed-payment-payload>"
HTTP/1.1 200 OK
Content-Type: application/json
The server verifies the payment via the facilitator and settles the USDC transfer on-chain before returning the response.

What the Response Includes

The response is identical to the standard Market Details endpoint:
  • priceUSD / priceToken — current price of the base token
  • liquidityUSD — total liquidity in the pool in USD
  • base / quote — full token metadata for both sides of the pair (symbol, name, logo, marketCapUSD, circulatingSupply, approximateReserveUSD, security flags, holder stats)
  • priceChange* — price change percentages across 1m, 5m, 1h, 4h, 6h, 12h, 24h
  • volume* / volumeBuy* / volumeSell* — volume metrics across all timeframes
  • trades* / buys* / sells* / buyers* / sellers* / traders* — trade and participant counts
  • holdersCount — number of unique holders
  • security — honeypot status, buy/sell tax, renounced, mintable flags
  • socials — Twitter, website, Telegram links when available
  • exchange — exchange name and logo

Using with AI Agents

Any agent or autonomous script using an x402-compatible HTTP client automatically handles the 402 → sign → retry flow. The payment-required response embeds the full type schema of the response (via the Bazaar extension), so agents know exactly what fields to expect before paying. Compatible client libraries:

Testing

Two test scripts are included in the repository for end-to-end testing of the full 402 → sign → settle flow. Both scripts accept an ENDPOINT env var to target any x402 route.

Prerequisites

Solana mainnet
  • Solana wallet private key in base58 format (export from Phantom or Backpack)
  • USDC on Solana mainnet at EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Base mainnet
  • EVM wallet private key (0x-prefixed)
  • USDC on Base mainnet at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
  • ETH on Base for gas

Run the test

Solana:
SOLANA_PRIVATE_KEY="<base58_private_key>" \
ENDPOINT="/x402/market/details?address=0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640&blockchain=Ethereum" \
API_URL="https://api.mobula.io" \
bun run apps/api/src/x402/test-payment-solana.ts
Base (EVM):
TEST_PRIVATE_KEY="0x<evm_private_key>" \
ENDPOINT="/x402/market/details?address=0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640&blockchain=Ethereum" \
API_URL="https://api.mobula.io" \
bun run apps/api/src/x402/test-payment.ts
The script prints each step: the initial 402 response, the payment option selected, the signing step, and the final 200 response with a data summary. The full JSON response is written to /tmp/x402-response.json.

Try Mobula for Free

You can also access this data with a standard API key via Get Market Details. Get your free API key: admin.mobula.io