GET /v1/indices/{index}
#GET /v1/indices/{index}getIndexBars
Market-cap index bars (TOTAL, TOTAL2, TOTAL3) and the newest snapshot
| Scope | analytics:read |
|---|---|
| Lowest tier | sandbox |
| Weight (units) | 1; 2 over 1,000 bars |
| History each tier may read | Sandbox: 30 days; Starter: 365 days; Elite (included): 365 days; Developer: 1825 days; Business: all recorded |
| SDK | Python client.indices.bars ยท JavaScript cd.indices.bars |
Parameters
| Parameter | In | Type | Description |
|---|---|---|---|
index required | path | "TOTAL" | "TOTAL2" | "TOTAL3" | The index. |
res | query | string | Resolution (default 1h). |
from | query | string | Start, inclusive: unix seconds or RFC 3339. |
to | query | string | End, exclusive: unix seconds or RFC 3339. Default now. |
Errors
400invalid_param, invalid_cursor401unauthorized: missing, unknown, revoked or expired key403insufficient_scope, tier_required404not_found, not_available, not_in_sandbox422window_too_large429rate_limited (per minute) or quota_exhausted (month; X-Quota-* headers, Retry-After = seconds to the next month); see Retry-After503api_disabled, overloaded
Example
curl "https://api.chartdeck.trade/v1/indices/TOTAL" \
-H "Authorization: Bearer $CHARTDECK_API_KEY"from chartdeck import Client
client = Client() # reads CHARTDECK_API_KEY
r = client.indices.bars("<index>")
print(r.data, r.meta["attribution"])import { ChartDeck } from '@chartdeck/api';
const cd = new ChartDeck(); // reads CHARTDECK_API_KEY
const r = await cd.indices.bars("<index>");
console.log(r.data, r.meta.attribution);