Getting started / DEX token data for agents
Live DEX token prices for your agent in 3 lines
One HTTP call returns near-live on-chain market data for a token: price, liquidity, 24h volume, buys and sells, market cap and pair age, across 80+ chains and DEXes. No key to try it: the first 3 calls a day from your address are free. After that it is a tenth of a cent a call.
1. Call it
curl -s -X POST https://aipaygen.com/v1/dex_token -H 'content-type: application/json' -d '{"query": "PEPE", "limit": 3}'
The answer is JSON: data.pairs[], most liquid first, each with chain, dex, pair, price_usd, liquidity_usd, volume_24h_usd, change_24h_pct, buys_24h, sells_24h, market_cap_usd, pair_age_days and a url. Data is up to 60 seconds old.
2. Look up a contract
curl -s -X POST https://aipaygen.com/v1/dex_token -H 'content-type: application/json' -d '{"address": "0x4200000000000000000000000000000000000006", "chain": "base"}'
Pass address (EVM or Solana) instead of query, and optionally chain (base, ethereum, solana, bsc). limit is 1 to 20, default 5.
3. From code
JavaScript
// Node 20+, no packages
const r = await fetch("https://aipaygen.com/v1/dex_token", {
method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ query: "PEPE", limit: 3 }),
});
const { data } = await r.json();
for (const p of data.pairs) console.log(p.chain, p.pair, p.price_usd, p.liquidity_usd);
Python
import requests
r = requests.post("https://aipaygen.com/v1/dex_token", json={"query": "PEPE", "limit": 3})
for p in r.json()["data"]["pairs"]: print(p["chain"], p["pair"], p["price_usd"], p["liquidity_usd"])Keep going past the free calls
Get a free key (no card, no email) and send it as a Bearer token, or pay per call with no key: an unpaid call answers 402 with the price ($0.001) and any x402 client pays it in USDC on Base. Same tool over MCP: dex_token at https://mcp.aipaygen.com/mcp. Failed calls are never charged. All tools and prices: docs.