Skip to main content
x402 is well-suited for trading data: your agent pays per call in USDC, with no API key registration, subscription management, or rate-limit tiers to negotiate. The agent gets the data, the provider gets paid — that’s the entire relationship.

Why x402 for market data

  • No API key management — your agent pays on demand; no credentials to rotate or store securely
  • Pay only for what you use — no monthly subscription for data you might not always need
  • Works across any wallet — Sponge Wallet’s x402 proxy, CDP Agentic Wallet skills, and x402-axios all handle payment automatically
  • Composable — your agent can call multiple data providers in the same session, paying each separately

Discovering x402-compatible endpoints

x402-compatible services publish a discovery document at /.well-known/x402.json. You can also browse the Bazaar catalog for a curated list of x402 data providers. To discover a service with Sponge Wallet:
Terminal
curl "https://api.wallet.paysponge.com/api/discover?query=price+feed" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1"

Curated x402 data sources

CoinGecko — price feeds

CoinGecko provides cryptocurrency price feeds, market cap data, and historical OHLCV via x402-enabled endpoints. Fetch the current ETH price:
Terminal
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd",
    "method": "GET",
    "preferred_chain": "base"
  }'
Or use the CDP Agentic Wallet pay-for-service skill:
Get the current ETH price from CoinGecko

Alchemy — onchain data

Alchemy exposes enhanced APIs for onchain data — token balances, NFT metadata, mempool visibility, and decoded transaction history — via x402-gated endpoints. Fetch token balances for a wallet:
Terminal
curl -X POST "https://api.wallet.paysponge.com/api/x402/fetch" \
  -H "Authorization: Bearer $SPONGE_API_KEY" \
  -H "Sponge-Version: 0.2.1" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://base-mainnet.g.alchemy.com/v2/getTokenBalances",
    "method": "POST",
    "body": { "address": "0xYourAddress" },
    "preferred_chain": "base"
  }'

Nansen — wallet analytics

Nansen provides wallet labeling, smart money flow analysis, and on-chain fund tracking. x402 endpoint availability is expanding — check nansen.ai for current endpoint status.

Making data calls inside an OpenClaw agent

Install the Sponge Wallet skill or CDP Agentic Wallet skills, then prompt your agent directly:
Get the current prices of ETH, BTC, and SOL from a paid data source
Check the token balances at 0xYourWatchAddress on Base
The agent handles service discovery, payment, and data extraction. For a custom implementation using x402-axios:
Terminal
npm install x402-axios axios
TypeScript
import { withPaymentInterceptor } from "x402-axios";
import axios from "axios";

// walletClient must be a viem-compatible WalletClient
const client = withPaymentInterceptor(axios.create(), walletClient);

// If the endpoint returns 402, the interceptor pays automatically and retries
const response = await client.get("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd");
console.log(response.data);
The interceptor handles the full 402 → pay → retry flow. For wiring a viem WalletClient to your setup, see the x402 client docs.

Trade execution

Execute swaps using Flashblocks timing and Base fee calibration.

x402 protocol

Full x402 flow, supported networks, and error handling.