Sand AISand AI MAGI-2MAGI-2 ya está en SandBase: video en 1080p con audio nativoPruébalo ahora

CoinGecko Coin Historical Chart Data by ID

Documentación de la API
https://api.sandbase.ai/v1/api/coingecko/coins-market-chart

Get the historical chart data of a coin including time in UNIX, price, market cap and 24hr volume based on particular coin ID

Precio
$0.008USD / llamada
Método
POST
Respuesta
JSON
Parámetros
3 obligatorios · 2 opcionales

Entorno de pruebas

Entrada
Coin ID. *refers to [`/coins/list`](/reference/coins-list).
Data up to number of days ago. You may use any integer or `max` for number of days.
Target currency of market data. *refers to [`/simple/supported_vs_currencies`](/reference/simple-supported-currencies).
Data interval, leave empty for auto granularity.
Decimal place for currency price value.
SalidaListo

Su salida aparecerá aquí

Complete las entradas y luego haga clic en Ejecutar.

README de la API

CoinGecko Coin Historical Chart Data by ID API

Returns historical price, market cap and total volume series for one coin on CoinGecko. You pass a coin id such as bitcoin, a number of days and a vs_currency such as usd.

Use cases

  • Draw a price chart for a coin over the last day, week or full history.
  • Compare market cap and trading volume trends for one coin over time.
  • Export time series data for backtesting or analysis in a spreadsheet or notebook.
  • Show price in a local currency by changing vs_currency.

Request

curl -X POST "https://api.sandbase.ai/v1/api/coingecko/coins-market-chart" \
  -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.

Parameters

NameTypeRequiredDescription
daysstringYesData up to number of days ago. You may use any integer or max for number of days.
idstringYesCoin ID. *refers to /coins/list.
vs_currencystringYesTarget currency of market data. *refers to /simple/supported_vs_currencies.
intervalstringNoData interval, leave empty for auto granularity.
precisionstringNoDecimal place for currency price value.

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "market_caps": [
    [
      1793604600000
    ]
  ],
  "prices": [
    [
      1793604600000
    ]
  ],
  "total_volumes": [
    [
      1793604600000
    ]
  ]
}

Response fields

FieldMeaning
pricesList of [timestamp, price] pairs. The price is in the currency set by vs_currency.
prices[][0] / market_caps[][0] / total_volumes[][0]Timestamp of the data point, as a UNIX time value in milliseconds (for example 1793604600000).
prices[][1]Coin price at that timestamp.
market_capsList of [timestamp, market cap] pairs for the coin.
market_caps[][1]Market cap value at that timestamp.
total_volumesList of [timestamp, volume] pairs for the coin's trading volume.
total_volumes[][1]Trading volume value at that timestamp.

Notes

Pricing

$0.008 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

Explorar más

APIs relacionadas

Todas las APIs
APIPrecioRespuesta
CoinGecko$0.008 por llamadaJSON
CoinGecko$0.008 por llamadaJSON
CoinGecko$0.008 por llamadaJSON
CoinGecko$0.008 por llamadaJSON
CoinGecko$0.008 por llamadaJSON
CoinGecko$0.008 por llamadaJSON

Preguntas

FAQ

¿Cómo uso la API de CoinGecko Coin Historical Chart Data by ID?

Envía una solicitud POST a https://api.sandbase.ai/v1/api/coingecko/coins-market-chart con tu clave API de SandBase en el encabezado Authorization (Bearer) y los parámetros como un cuerpo JSON. También puedes probarlo en el Playground de esta página sin escribir código.

¿Cuánto cuesta la API de CoinGecko Coin Historical Chart Data by ID?

$0.008 por llamada, facturado desde tu saldo de SandBase. Solo se te cobra por las llamadas que haces; no hay suscripción.

¿Qué parámetros acepta la API de CoinGecko Coin Historical Chart Data by ID?

Requeridos: id (string), days (string) y vs_currency (string). Opcionales: interval (una de 1m, 5m, hourly, daily) y precision (una de full, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18). La tabla de Parámetros y el Playground de esta página enumeran todos los campos.

¿Qué devuelve la API de CoinGecko Coin Historical Chart Data by ID?

Una respuesta JSON devuelta en la misma solicitud HTTP (sincrónica). El README de esta página incluye una respuesta de ejemplo.

¿Necesito una cuenta de desarrollador o una clave API de CoinGecko?

No. CoinGecko Coin Historical Chart Data by ID funciona a través de SandBase, así que una sola clave API de SandBase cubre este endpoint y todas las demás APIs y modelos del catálogo. No necesitas solicitar acceso a la API de CoinGecko por separado.