LogoLogo
  • Kaiko Knowledge Hub
  • GETTING STARTED
    • About Kaiko Indices
    • General information
      • API Key
      • Timestamps
      • Index codes
  • Benchmarks: Single-Asset Reference Rates
    • Subscribe
    • Reference data
    • Historical prices
    • FOREX conversion
    • Replication data
  • Benchmarks: Indices
    • Subscribe
  • Customized Indices
    • Valour - CDF Index
Powered by GitBook
On this page
  • What is this endpoint for?
  • Endpoint
  • Parameters
  • Fields
  • Request example
  • Response example

Was this helpful?

Export as PDF
  1. Benchmarks: Single-Asset Reference Rates

Replication data

Identify the underlying trades used to calculate each rate publication

PreviousFOREX conversionNextSubscribe

Last updated 22 days ago

Was this helpful?

What is this endpoint for?

Kaiko Reference Rates are available exclusively through our Service. This helps you identify the underlying trades used to calculate each publication. Simply take the sequence_id field from any published rate you receive via Stream, and query this endpoint. The endpoint then generates a URL to query our Tick-Level Trades endpoint where you'll see all the trades.

We support publications for up to 72 hours using this endpoint. If you require the trades for a rate published more than 72 hours ago, contact our operations team.

Endpoint

https://us.market-api.kaiko.io/v1/data/index_replication.v1/rates

Parameters

Parameter
Required
Description
Example

sequence_id

Yes

List of publication ID to explore. A publication is defined by event occurring on a specific instrument at a given point in time. Publication IDs can be retrieved from your index response.

cmrqt2dugrtbh9jbhlk0,cmt40b74tfbpmrtbk180

sort

No

If asc, sort time-series in ascending. If desc, sort time-series in descending.

asc

page_size

No

100

Fields

Field
Description
Example

index_code

Ticker identifying the rate.

KK_PR_BTCUSD

index_type

Type of publication: real-time or fixings.

SIC_REAL_TIME

sequenceID

cnb0k3vvavm8ib6863qg

underlying_data

List of links to specific pre-filtered queries on the Rest API trades endpoint for the selected SequenceID.

[ "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/bfnx/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863ZZ&sort=asc", "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/cbse/spot/btc-usd/trades?start_time=2024-02-21T14:29:55.000Z&end_time=2024-02-21T14:34:55.000Z&index_inserted_at=2024-02-21T14:34:50.863ZZ&sort=asc"]

Request example

curl --compressed \
  -H 'Accept: application/json' \
  -H 'X-Api-Key: <client-api-key>' \
  'https://us.market-api.kaiko.io/v1/data/index_replication.v1/rates?sequence_id=csibfhkth8ejovmc3fcg'
import http.client
import json

# Enter your Kaiko API Key
api_key = "KAIKO_API_KEY"
api_host = "us.market-api.kaiko.io"
api_base_endpoint = "/v1/data/index_replication.v1/rates"
# Start of mandatory parameter configuration
mandatory_params = {
    "sequence_id": "csibfhkth8ejovmc3fcg",
}
# End of mandatory parameter configuration
# Start of optional parameter configuration
optional_params = {
        "sort": "asc",
}
# End of optional parameter configuration
conn = http.client.HTTPSConnection(api_host)
headers = {
    "X-Api-Key": api_key,
    "Accept": "application/json"
}

all_params = {**mandatory_params, **optional_params}

url_params = []
for param, value in all_params.items():
    url_params.append(f"{param}={value}")
url_params = '&'.join(url_params)

endpoint_with_params = f"{api_base_endpoint}?{url_params}"

# Pagination for next pages
all_data = []
next_url = endpoint_with_params
while next_url:
    conn.request("GET", next_url, headers=headers)
    response = conn.getresponse()
    data = json.loads(response.read().decode("utf-8"))
    all_data.extend(data.get("data", []))
    print(f"Fetched {len(data.get('data', []))} datapoints. Total: {len(all_data)}")
    next_url = data.get("next_url", "").replace("https://us.market-api.kaiko.io", "")
    if not next_url:
        break
conn.close()
print(f" datapoints fetched: {(all_data)}")

Response example

{
    "time": "2024-11-01T11:18:09.931Z",
    "timestamp": 1730459889931,
    "data": [
        {
            "index_code": "KK_BRR_BTCUSD",
            "index_type": "SIC_REAL_TIME",
            "sequence_id": "csibfhkth8ejovmc3fcg",
            "underlying_data": [
                "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/cbse/spot/btc-usd/trades?start_time=2024-11-01T11:12:55Z&end_time=2024-11-01T11:13:10Z&index_inserted_at=2024-11-01T11:13:09.839473378Z&sort=asc",
                "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/gmni/spot/btc-usd/trades?start_time=2024-11-01T11:12:55Z&end_time=2024-11-01T11:13:10Z&index_inserted_at=2024-11-01T11:13:09.839473378Z&sort=asc",
                "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/krkn/spot/btc-usd/trades?start_time=2024-11-01T11:12:55Z&end_time=2024-11-01T11:13:10Z&index_inserted_at=2024-11-01T11:13:09.839473378Z&sort=asc",
                "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/lmax/spot/btc-usd/trades?start_time=2024-11-01T11:12:55Z&end_time=2024-11-01T11:13:10Z&index_inserted_at=2024-11-01T11:13:09.839473378Z&sort=asc",
                "https://us.market-api.kaiko.io/v3/data/trades.v1/exchanges/stmp/spot/btc-usd/trades?start_time=2024-11-01T11:12:55Z&end_time=2024-11-01T11:13:10Z&index_inserted_at=2024-11-01T11:13:09.839473378Z&sort=asc"
            ]
        }
    ],
    "result": "success",
    "continuation_token": "",
    "next_url": "",
    "access": {
        "access_range": {
            "start_timestamp": 1454284800000,
            "end_timestamp": null
        },
        "data_range": {
            "start_timestamp": null,
            "end_timestamp": null
        }
    }
}

See Min: 1 Max: 100 Default: 10

The publication ID to explore. A publication is defined by event occurring on a specific instrument at a given point in time. Publication IDs can be retrieved from response.

publication stream
Stream