81trust / 100
Token Price 0x940181a94a35a4569e4529a3cdfb74e38fd98631,0x311935cd80b76769bf2ecc9d8ab7635b2139cf82,0x42000000000000000000
by CoinGecko in Onchain & crypto
x402 APIPassing, checked 10 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/0x940181a94a35a4569e4529a3cdfb74e38fd98631,0x311935cd80b76769bf2ecc9d8ab7635b2139cf82,0x4200000000000000000000000000000000000006,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0x16ee7ecac70d1028e7712751e2ee6ba808a7dd92,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x5ab3d4c385b400f3abb49e80de2faf6a88a7b691,0xeb466342c4d449bc9f53a865d5cb90586f405215
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 177 ms typical, 177 ms slowest 5%
- Last check
- 10 min ago
- Next check
- in 21 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/0x940181a94a35a4569e4529a3cdfb74e38fd98631,0x311935cd80b76769bf2ecc9d8ab7635b2139cf82,0x4200000000000000000000000000000000000006,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0x16ee7ecac70d1028e7712751e2ee6ba808a7dd92,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x5ab3d4c385b400f3abb49e80de2faf6a88a7b691,0xeb466342c4d449bc9f53a865d5cb90586f405215?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%2F0x940181a94a35a4569e4529a3cdfb74e38fd98631%2C0x311935cd80b76769bf2ecc9d8ab7635b2139cf82%2C0x4200000000000000000000000000000000000006%2C0x9b5e262cf9bb04869ab40b19af91d2dc85761722%2C0x16ee7ecac70d1028e7712751e2ee6ba808a7dd92%2C0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca%2C0x5ab3d4c385b400f3abb49e80de2faf6a88a7b691%2C0xeb466342c4d449bc9f53a865d5cb90586f405215
const res = await pay("https://pro-api.coingecko.com/api/v3/x402/onchain/simple/networks/base/token_price/0x940181a94a35a4569e4529a3cdfb74e38fd98631,0x311935cd80b76769bf2ecc9d8ab7635b2139cf82,0x4200000000000000000000000000000000000006,0x9b5e262cf9bb04869ab40b19af91d2dc85761722,0x16ee7ecac70d1028e7712751e2ee6ba808a7dd92,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x5ab3d4c385b400f3abb49e80de2faf6a88a7b691,0xeb466342c4d449bc9f53a865d5cb90586f405215?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 |
|---|---|---|---|---|
| 10 min ago | Passed | 402 | 177 ms | $0.01 |
| 5 h ago | Passed | 402 | 201 ms | $0.01 |