vs_currenciesstringerforderlich
Target currency of coins, comma-separated if querying more than 1 currency. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)
Standard: "usd"
https://api.sandbase.ai/v1/api/coingecko/simple-priceGet the prices of one or more coins by using their unique Coin API IDs, symbols, or names
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
Returns the market value of one or more coins on CoinGecko, quoted in the currencies you choose. You pass vs_currencies plus a coin identifier as ids, symbols, or names. The response is an object keyed by coin ID, with one number per target currency.
ids and vs_currencies.include_* flags.symbols when you do not know the CoinGecko coin ID.curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"ids": "bitcoin", "vs_currencies": "usd"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
vs_currencies | string | Yes | Target currency of coins, comma-separated if querying more than 1 currency. *refers to /simple/supported_vs_currencies |
ids | string | No | Coins' IDs, comma-separated if querying more than 1 coin. *refers to /coins/list |
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 |
include_tokens | string | No | For symbols lookups, specify all to include all matching tokens. Default top returns top-ranked tokens by market cap or volume. |
names | string | No | Coins' names, comma-separated if querying more than 1 coin. |
precision | string | No | Decimal places for currency price value |
symbols | string | No | Coins' symbols, comma-separated if querying more than 1 coin. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"bitcoin": {
"usd": 76688
}
}
| Field | Meaning |
|---|---|
bitcoin | Top-level key. It is the coin ID that was requested. Each requested coin gets its own key. |
bitcoin.usd | Value of one coin in the target currency. The key name is the currency code from vs_currencies, so other currencies appear as sibling keys. |
vs_currencies values from CoinGecko Supported Currencies List.include_24hr_change, include_24hr_vol, include_market_cap, or include_last_updated_at to true to add extra keys next to each currency value. The sample request did not use them, so the sample response has only the currency value.$0.008 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
Jetzt loslegen
Plattform-API-Endpunkt mit einheitlicher Authentifizierung und Nutzungsnachverfolgung.
curl -X POST "https://api.sandbase.ai/v1/api/coingecko/simple-price" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ids": "bitcoin",
"names": "Bitcoin",
"symbols": "btc",
"vs_currencies": "usd"
}'Legen Sie Ihren SandBase API-Schlüssel in Ihrer Serverumgebung fest. Anfragen verwenden Bearer-Authentifizierung.
export SANDBASE_API_KEY="YOUR_API_KEY"Bewahren Sie Ihren Schlüssel auf dem Server auf. Geben Sie ihn nicht in Browser-Code preis.
vs_currenciesstringerforderlichTarget currency of coins, comma-separated if querying more than 1 currency. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies)
Standard: "usd"
idsstringCoins' IDs, comma-separated if querying more than 1 coin. *refers to [`/coins/list`](/reference/coins-list)
Standard: "bitcoin"
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
include_tokensstringFor `symbols` lookups, specify `all` to include all matching tokens. Default `top` returns top-ranked tokens by market cap or volume.
Mögliche Werte: top, all
namesstringCoins' names, comma-separated if querying more than 1 coin.
Standard: "Bitcoin"
precisionstringDecimal places for currency price value
Mögliche Werte: full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
symbolsstringCoins' symbols, comma-separated if querying more than 1 coin.
Standard: "btc"
Gespeicherte Beispielantwort für diese API; beim Anzeigen wird keine Live-Anfrage gesendet.
Es wurde keine gespeicherte Antwort veröffentlicht. Führen Sie die API in Playground aus, um die Antwort zu prüfen.
Mehr entdecken
| API | Preis | Antwort |
|---|---|---|
CoinGecko | $0.008 pro Aufruf | JSON |
CoinGecko | $0.008 pro Aufruf | JSON |
CoinGecko | $0.008 pro Aufruf | JSON |
CoinGecko | $0.008 pro Aufruf | JSON |
CoinGecko | $0.008 pro Aufruf | JSON |
CoinGecko | $0.008 pro Aufruf | JSON |
Fragen
Senden Sie eine POST-Anfrage an https://api.sandbase.ai/v1/api/coingecko/simple-price mit Ihrem SandBase API-Schlüssel im Authorization-Header (Bearer) und den Parametern als JSON-Body. Sie können das auch ohne Code direkt auf dieser Seite im Playground testen.
$0.008 pro Aufruf, abgerechnet von Ihrem SandBase-Guthaben. Es werden nur die von Ihnen getätigten Aufrufe berechnet; es gibt kein Abo.
Erforderlich: vs_currencies (string). Optional: ids (string), include_24hr_change (boolean), include_24hr_vol (boolean), include_last_updated_at (boolean), include_market_cap (boolean) und include_tokens (eines von top, all) und 3 weitere. Die Parametertabelle und der Playground auf dieser Seite listen jedes Feld auf.
Eine JSON-Antwort, die in derselben HTTP-Anfrage zurückgegeben wird (synchron). Die README auf dieser Seite enthält eine Beispielantwort.
Nein. CoinGecko Coin Price by IDs, Symbols, or Names läuft über SandBase, daher deckt ein SandBase API-Schlüssel diesen Endpunkt und jede andere API sowie jedes Modell im Katalog ab. Sie müssen keinen separaten Zugang für CoinGecko API beantragen.