Home / API docs / Crypto Conversion API
Crypto Markets

Crypto Conversion API

GET /api/convert $0.001 per call USDC on Base · x402

Live crypto conversion at CoinGecko prices: any coin to any coin or fiat, and fiat to coin. ?amount=0.5&from=bitcoin&to=ethereum — common tickers (btc, eth, sol…) accepted. Returns the rate, the converted amount, and the underlying prices. Prices cached ≤30s; cheap enough to call in a loop.

Parameters

NameInDescription
amountqueryquantity of 'from' (default 1)
fromqueryrequiredCoinGecko id or ticker (bitcoin/btc), or fiat code (usd, eur…)
toqueryrequiredCoinGecko id/ticker or fiat code

Example request

curl "https://api.webbersites.com/api/convert?amount=0.5&from=bitcoin&to=ethereum"
# first call returns 402 + payment requirements; an x402 client pays and retries automatically

Example response

{
    "amount": 0.5,
    "from": "bitcoin",
    "to": "ethereum",
    "rate": 26.4,
    "result": 13.2,
    "prices": {
        "bitcoin_usd": 60000,
        "ethereum_usd": 2272.7
    }
}
MCP tool: get_convert — via npx -y webbersites-x402-mcp (local, key stays on your machine) or the remote endpoint https://api.webbersites.com/mcp.

How payment works

There is no signup and no API key. Call the endpoint; it replies 402 Payment Required with machine-readable payment requirements. Your client signs a USDC transfer authorization (EIP-3009, gasless) and retries with the X-PAYMENT header — @x402/fetch does this automatically. See the overview for a working snippet.