81trust / 100

Token Price

by d21 token_price in Onchain & crypto

x402 APIPassing, checked 3 h ago

Token Price ($0.003): Base token price derived from on-chain state, not a resold price-API feed. Curated majors (ETH, WETH, USDC, DAI, cbETH, cbBTC, BTC) are priced from Chainlink's own Data Feed aggregator contracts on Base; any other Base ERC-20 address is priced from its deepest discoverable Uniswap V3 pool against USDC (with a liquidity read and a low-liquidity flag), or a clean unsupported-token error if no pool is discoverable. Also accepts { coins }, a comma-separated batch of symbols…

POST https://draconic21-x402-api.onrender.com/v1/token_price

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
227 ms typical, 227 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://draconic21-x402-api.onrender.com/v1/token_price" \
  -H "content-type: application/json" \
  -d '{"symbol":"WETH"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.03:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fdraconic21-x402-api.onrender.com%2Fv1%2Ftoken_price
const res = await pay("https://draconic21-x402-api.onrender.com/v1/token_price", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"symbol":"WETH"}),
});
console.log(await res.json());

Example input

{
  "symbol": "WETH"
}

Example output

{
  "caveats": [
    "Chainlink price feeds update on their own deviation-threshold/heartbeat schedule, not ever…"
  ],
  "price": {
    "quote": "USD",
    "value": "2683.92507148",
    "value_number": 2683.92507148
  },
  "source": {
    "chainlink": {
      "feed_address": "0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70",
      "pair": "ETH / USD"
    },
    "method": "chainlink"
  },
  "token": {
    "address": "0x4200000000000000000000000000000000000006",
    "decimals": 18,
    "symbol": "WETH"
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402227 ms$0.003