81trust / 100
Token Price 0x4200000000000000000000000000000000000006,0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x940181a94a35a4569e45
by CoinGecko in Onchain & crypto
x402 APIPassing, checked 11 min ago
Query onchain DEX token price & market data based on the provided token contract addresses on a network.
GET https://pro-api.coingecko.com/api/v3/x402/onchain/simple/networks/base/token_price/0x4200000000000000000000000000000000000006,0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x940181a94a35a4569e4529a3cdfb74e38fd98631,0xacfe6019ed1a7dc6f7b508c02d1b04ec88cc21bf,0x95ccfd2b81a9667b0cc979992632f98fc853eba3,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0xed664536023d8e4b1640c394777d34abaff1df8f,0x9a26f5433671751c3276a065f57e5a02d2817973
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 149 ms typical, 149 ms slowest 5%
- Last check
- 11 min ago
- Next check
- in 18 min
How to call it
# See the payment challenge (nothing is charged)
curl -i -X GET "https://pro-api.coingecko.com/api/v3/x402/onchain/simple/networks/base/token_price/0x4200000000000000000000000000000000000006,0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x940181a94a35a4569e4529a3cdfb74e38fd98631,0xacfe6019ed1a7dc6f7b508c02d1b04ec88cc21bf,0x95ccfd2b81a9667b0cc979992632f98fc853eba3,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0xed664536023d8e4b1640c394777d34abaff1df8f,0x9a26f5433671751c3276a065f57e5a02d2817973?include_24hr_price_change=true&include_24hr_vol=true&include_inactive_source=true&include_market_cap=true&include_total_reserve_in_usd=true&mcap_fdv_fallback=true"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.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fpro-api.coingecko.com%2Fapi%2Fv3%2Fx402%2Fonchain%2Fsimple%2Fnetworks%2Fbase%2Ftoken_price%2F0x4200000000000000000000000000000000000006%2C0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b%2C0x940181a94a35a4569e4529a3cdfb74e38fd98631%2C0xacfe6019ed1a7dc6f7b508c02d1b04ec88cc21bf%2C0x95ccfd2b81a9667b0cc979992632f98fc853eba3%2C0x9b5e262cf9bb04869ab40b19af91d2dc85761722%2C0xed664536023d8e4b1640c394777d34abaff1df8f%2C0x9a26f5433671751c3276a065f57e5a02d2817973
const res = await pay("https://pro-api.coingecko.com/api/v3/x402/onchain/simple/networks/base/token_price/0x4200000000000000000000000000000000000006,0x0b3e328455c4059eeb9e3f84b5543f74e24e7e1b,0x940181a94a35a4569e4529a3cdfb74e38fd98631,0xacfe6019ed1a7dc6f7b508c02d1b04ec88cc21bf,0x95ccfd2b81a9667b0cc979992632f98fc853eba3,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0xed664536023d8e4b1640c394777d34abaff1df8f,0x9a26f5433671751c3276a065f57e5a02d2817973?include_24hr_price_change=true&include_24hr_vol=true&include_inactive_source=true&include_market_cap=true&include_total_reserve_in_usd=true&mcap_fdv_fallback=true");
console.log(await res.json());Example input
{
"include_24hr_price_change": true,
"include_24hr_vol": true,
"include_inactive_source": true,
"include_market_cap": true,
"include_total_reserve_in_usd": true,
"mcap_fdv_fallback": true
}Example output
{
"data": {
"attributes": {
"h24_price_change_percentage": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "3.3870290336"
},
"h24_volume_usd": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "965988358.733808"
},
"last_trade_timestamp": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": 1711356300
},
"market_cap_usd": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "6692452895.779648"
},
"token_prices": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "2289.33"
},
"total_reserve_in_usd": {
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2": "1576179559.94669772339136684208"
}
},
"id": "1ba898f0-eda2-4291-9491-9a5b323f66ef",
"type": "simple_token_price"
}
}Security scan
- No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 11 min ago | Passed | 402 | 160 ms | $0.01 |
| 5 h ago | Passed | 402 | 149 ms | $0.01 |