Token spot price (USD)

$0.001 per call · USDC via x402 · POST /api/token-price

Return the current USD spot price for an ERC-20 token, identified by its contract address and network. Send POST /api/token-price with the required field contract and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with contract, network, symbol, priceUsd and lastUpdated.

Sourced from Alchemy's aggregated price feed. Use this for portfolio-value calculations or to denominate a balance in fiat without depending on a separate market-data API.

Category: Crypto & onchain data · Tags: crypto price token usd spot erc20

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
contractstringyes0x-prefixed 40-char ERC-20 contract address. Also accepted as contractAddress, token, address.
networkstringnoethereum / base / polygon / arbitrum / optimism (default base).

Example request

curl -i -X POST https://agent402.tools/api/token-price \
  -H "Content-Type: application/json" \
  -d '{"contract":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","network":"base"}'

Without payment this returns HTTP 402 Payment Required with the exact price for token-price; any x402 v2 or MPP client pays it and retries.

Example response

{
  "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "network": "base",
  "symbol": "USDC",
  "priceUsd": 1.0001,
  "lastUpdated": "2026-06-22T17:30:00Z"
}
FieldTypeAlways presentIn the example
contractstringyes0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
networkstringyesbase
symbolstringyesUSDC
priceUsdnumberyes1.0001
lastUpdatedstringyes2026-06-22T17:30:00Z

From an MCP client

catalog.call {
  "slug": "token-price",
  "params": {
    "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "network": "base"
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for token-price; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/token-price", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
    "network": "base"
  }),
});

Related tools

Token price history (USD)

$0.004 · POST /api/token-price-history

Historical USD price series for a token, by ticker symbol (ETH, BTC, SOL, ...) or by ERC-20 contract + network, at 5-min…

Token price by contract address

$0.005 · GET /api/coin-price-by-contract

Live price, market cap, 24h volume and 24h change for ERC-20 / SPL / other chain tokens looked up by CONTRACT ADDRESS on…

CoinGecko spot price

$0.001 · POST /api/price-coingecko

Live spot price for up to 25 coins by CoinGecko id, one row per id in the order asked: prices[] of {id, price, change24h…

ERC-20 token metadata

$0.001 · POST /api/token-metadata

Resolve an ERC-20 contract address to its on-chain metadata: symbol, decimals, name, and logo URL where available. Use t…

Wallet balance (native + ERC-20)

$0.002 · POST /api/wallet-balance

Look up the native coin balance (ETH/MATIC) plus every ERC-20 holding for a wallet address on Ethereum, Base, Polygon, A…

Known-address label lookup

FREE w/ compute · or $0.002 · POST /api/address-label

Label a known EVM address from a curated, committed dataset: major stablecoin + token contracts (the USDC and USDG contr…