idstringerforderlich
Coin ID. *refers to [`/coins/list`](/reference/coins-list).
Standard: "bitcoin"
https://api.sandbase.ai/v1/api/coingecko/coins-ohlcGet the OHLC chart (Open, High, Low, Close) of a coin based on particular coin ID
Ihre Ausgabe wird hier angezeigt
Vervollständigen Sie die Eingaben und klicken Sie dann auf Ausführen.
Returns OHLC (open, high, low, close) candle data for one coin as a list of arrays. Each array starts with a timestamp and is followed by numeric values in the currency you choose. It needs a CoinGecko coin id, a days range and a vs_currency.
interval to daily.curl -X POST "https://api.sandbase.ai/v1/api/coingecko/coins-ohlc" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id": "bitcoin", "days": "1", "vs_currency": "usd"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
days | string | Yes | Data up to number of days ago. |
id | string | Yes | Coin ID. *refers to /coins/list. |
vs_currency | string | Yes | Target currency of price data. *refers to /simple/supported_vs_currencies. |
interval | string | No | Data interval, leave empty for auto granularity. |
precision | string | No | Decimal place for currency price value. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
[
[
1793604600000
]
]
| Field | Meaning |
|---|---|
[] | One candle. The response is a top-level list of these arrays, ordered from oldest to newest. |
[][0] | Candle timestamp as a Unix time in milliseconds, for example 1793604600000. |
[][1] / [][2] | Numeric values in the vs_currency you requested. The description says each candle holds open, high, low and close, but this sample shows only two values after the timestamp. Check the array length in your own response before you map positions to open, high, low and close. |
id value (for example bitcoin) from CoinGecko Coins List (ID Map).vs_currency values (for example usd) from CoinGecko Supported Currencies List.days accepts 1, 7, 14, 30, 90, 180, 365 or max. In the sample call with days set to 1, the candles are 30 minutes apart (1,800,000 ms).$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/coins-ohlc" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "bitcoin",
"days": "1",
"vs_currency": "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.
idstringerforderlichCoin ID. *refers to [`/coins/list`](/reference/coins-list).
Standard: "bitcoin"
daysstringerforderlichData up to number of days ago.
Standard: "1"
Mögliche Werte: 1, 7, 14, 30, 90, 180, 365, max
vs_currencystringerforderlichTarget currency of price data. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
Standard: "usd"
intervalstringData interval, leave empty for auto granularity.
Mögliche Werte: daily, hourly
precisionstringDecimal place 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
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 Coin OHLC Chart by IDDiese API 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/coins-ohlc 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: id (string), days (eines von 1, 7, 14, 30, 90, 180, 365, max) und vs_currency (string). Optional: interval (eines von daily, hourly) und precision (eines von full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18). 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 OHLC Chart by ID 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.