Skip to main content
GET
/
api
/
v1
/
index
/
{index}
/
composition-history
Get index composition history
curl --request GET \
  --url https://api.international.coinbase.com/api/v1/index/{index}/composition-history \
  --header 'CB-ACCESS-KEY: <api-key>' \
  --header 'CB-ACCESS-PASSPHRASE: <api-key>' \
  --header 'CB-ACCESS-SIGN: <api-key>' \
  --header 'CB-ACCESS-TIMESTAMP: <api-key>'
import requests

url = "https://api.international.coinbase.com/api/v1/index/{index}/composition-history"

headers = {
"CB-ACCESS-KEY": "<api-key>",
"CB-ACCESS-PASSPHRASE": "<api-key>",
"CB-ACCESS-SIGN": "<api-key>",
"CB-ACCESS-TIMESTAMP": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {
'CB-ACCESS-KEY': '<api-key>',
'CB-ACCESS-PASSPHRASE': '<api-key>',
'CB-ACCESS-SIGN': '<api-key>',
'CB-ACCESS-TIMESTAMP': '<api-key>'
}
};

fetch('https://api.international.coinbase.com/api/v1/index/{index}/composition-history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.international.coinbase.com/api/v1/index/{index}/composition-history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"CB-ACCESS-KEY: <api-key>",
"CB-ACCESS-PASSPHRASE: <api-key>",
"CB-ACCESS-SIGN: <api-key>",
"CB-ACCESS-TIMESTAMP: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.international.coinbase.com/api/v1/index/{index}/composition-history"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("CB-ACCESS-KEY", "<api-key>")
req.Header.Add("CB-ACCESS-PASSPHRASE", "<api-key>")
req.Header.Add("CB-ACCESS-SIGN", "<api-key>")
req.Header.Add("CB-ACCESS-TIMESTAMP", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.international.coinbase.com/api/v1/index/{index}/composition-history")
.header("CB-ACCESS-KEY", "<api-key>")
.header("CB-ACCESS-PASSPHRASE", "<api-key>")
.header("CB-ACCESS-SIGN", "<api-key>")
.header("CB-ACCESS-TIMESTAMP", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.international.coinbase.com/api/v1/index/{index}/composition-history")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["CB-ACCESS-KEY"] = '<api-key>'
request["CB-ACCESS-PASSPHRASE"] = '<api-key>'
request["CB-ACCESS-SIGN"] = '<api-key>'
request["CB-ACCESS-TIMESTAMP"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "product_id": "COIN50",
  "divisor": 3935813421.91702,
  "timestamp": "2024-11-11T14:47:26Z",
  "inception_timestamp": "2020-12-31T00:00:00Z",
  "last_rebalance": "2024-08-30T00:00:00Z",
  "constituents": [
    {
      "symbol": "BTC-USD",
      "name": "Bitcoin",
      "rank": 1,
      "cap_factor": "0.456192678887042",
      "amount": "19745468",
      "market_cap": "1625637364529.9463",
      "index_market_cap": "741603864223.787",
      "weight": "0.5130230783794717",
      "running_weight": "0.5130230783794717"
    }
  ]
}
const indexService = new IndexService(client);

indexService.getIndexCompositionHistory({
    index: 'COIN50',
}).then(async (response) => {
    console.log('Index Composition History: ', response);
})
For more information, please visit the INTX TS SDK.

Authorizations

CB-ACCESS-KEY
string
header
required

The Client ID that owns the API Key for the request

CB-ACCESS-PASSPHRASE
string
header
required

The pass phrase affiliated with the API Key

CB-ACCESS-SIGN
string
header
required

A HMAC SHA-256 signature using the API Key secret on the string TIMESTAMP, METHOD, REQUEST_PATH, BODY

CB-ACCESS-TIMESTAMP
string
header
required

The timestamp of when the request is being made

Path Parameters

index
string
required

Identifies the index by name (e.g., COIN50)

Query Parameters

time_from
string

Filters look back history for returned data (accepts an ISO 8601 timestamp format)

Example:

"2024-10-31T00:00:00Z"

result_limit
integer

The number of results to return (defaults to 5)

Example:

3

result_offset
integer

The number of results from the beginning to skip past

Example:

0

Response

Index composition list

product_id
string

The Product ID for the index

Example:

"COIN50"

divisor
string

The index divisor

Example:

3935813421.91702

timestamp
string

The snapshot timestamp for this index composition

Example:

"2024-11-11T14:47:26Z"

inception_timestamp
string

The timestamp of when this index was first created

Example:

"2020-12-31T00:00:00Z"

last_rebalance
string

The timestamp of when the last index rebalance occurred

Example:

"2024-08-30T00:00:00Z"

constituents
object[]