idstringobbligatorio
Asset platform's ID. *refers to [`/asset_platforms`](/reference/asset-platforms-list)
Predefinito: "ethereum"
https://api.sandbase.ai/v1/api/coingecko/simple-token-priceGet one or more token prices using their token contract addresses
Il tuo output apparirà qui
Completa gli input, poi fai clic su Esegui.
Get one or more token prices using their token contract addresses
The response is the official CoinGecko API response, unchanged.
curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-token-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "ethereum", "contract_addresses": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "vs_currencies": "usd"}'
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Asset platform's ID. *refers to /asset_platforms |
contract_addresses | string | Yes | Token contract addresses, comma-separated if querying more than 1 token |
include_24hr_change | boolean | No | Include 24-hour change percentage. Default: false |
include_24hr_vol | boolean | No | Include 24-hour trading volume. Default: false |
include_last_updated_at | boolean | No | Include last updated price time as a UNIX timestamp. Default: false |
include_market_cap | boolean | No | Include market capitalization. Default: false |
precision | string | No | Decimal places for currency price value |
vs_currencies | string | Yes | Target currency of coins, comma-separated if querying more than 1 currency. *refers to [/simple/supported_vs_currencies](/reference/simple-supported-currencie |
Flat price per call. Failed calls are not charged.
Inizia a costruire
Endpoint API della piattaforma con autenticazione unificata e tracciamento dell'utilizzo.
curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-token-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "ethereum",
"vs_currencies": "usd",
"contract_addresses": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
}'Imposta la tua SandBase API key nell'ambiente del server. Le richieste usano l'autenticazione Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Conserva la tua key sul server. Non esporla nel codice del browser.
idstringobbligatorioAsset platform's ID. *refers to [`/asset_platforms`](/reference/asset-platforms-list)
Predefinito: "ethereum"
contract_addressesstringobbligatorioToken contract addresses, comma-separated if querying more than 1 token
Predefinito: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
vs_currenciesstringobbligatorioTarget currency of coins, comma-separated if querying more than 1 currency. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)
Predefinito: "usd"
include_24hr_changebooleanInclude 24-hour change percentage. Default: false
include_24hr_volbooleanInclude 24-hour trading volume. Default: false
include_last_updated_atbooleanInclude last updated price time as a UNIX timestamp. Default: false
include_market_capbooleanInclude market capitalization. Default: false
precisionstringDecimal places for currency price value
Valori possibili: full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
Risposta di esempio salvata per questa API; durante la visualizzazione non viene eseguita alcuna richiesta live.
Nessuna risposta salvata è stata pubblicata. Esegui l'API in Playground per ispezionarne la risposta.
Esplora altro
| API | Prezzo | Risposta |
|---|---|---|
CoinGecko Coin Price by Token AddressesQuesta API CoinGecko | $0.008 per chiamata | JSON |
CoinGecko | $0.008 per chiamata | JSON |
CoinGecko | $0.008 per chiamata | JSON |
CoinGecko | $0.008 per chiamata | JSON |
CoinGecko | $0.008 per chiamata | JSON |
CoinGecko | $0.008 per chiamata | JSON |
Domande
Invia una richiesta POST a https://api.sandbase.ai/v1/api/coingecko/simple-token-price con la tua chiave API di SandBase nell'header Authorization (Bearer) e i parametri nel body JSON. Puoi anche provarla nel Playground di questa pagina senza scrivere codice.
$0.008 per chiamata, addebitato dal tuo saldo SandBase. Paghi solo le chiamate che effettui; non c'è alcun abbonamento.
Richiesti: id (string), contract_addresses (string) e vs_currencies (string). Facoltativi: include_24hr_change (boolean), include_24hr_vol (boolean), include_last_updated_at (boolean), include_market_cap (boolean) e precision (uno tra full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18). La tabella dei parametri e il Playground di questa pagina elencano tutti i campi.
Una risposta JSON restituita nella stessa richiesta HTTP (sincrona).
No. CoinGecko Coin Price by Token Addresses funziona tramite SandBase, quindi una sola chiave API SandBase copre questo endpoint e tutte le altre API e modelli del catalogo. Non è necessario richiedere separatamente l'accesso alle API CoinGecko.