Skip to content

Latest commit

 

History

History
286 lines (187 loc) · 13.1 KB

README.md

File metadata and controls

286 lines (187 loc) · 13.1 KB

Indexes

(indexes)

Overview

Indexes section of the API is in the Alpha release cycle. Use only for testing, evaluaton and feedback.

Available Operations

get_v1_indexes

List of available indexes

Example Usage

import coinapi

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)


res = s.indexes.get_v1_indexes()

if res.content is not None:
    # handle response
    pass

Response

operations.GetV1IndexesResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

post_v1_indexes_json

Create index

Example Usage

import coinapi
from coinapi.models import components

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)

req = components.V1IndexData()

res = s.indexes.post_v1_indexes_json(req)

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request components.V1IndexData ✔️ The request object to use for the request.

Response

operations.PostV1IndexesJSONResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

get_v1_indexes_index_id

Get index data

Example Usage

import coinapi

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)

res = s.indexes.get_v1_indexes_index_id(index_id='<value>')

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
index_id str ✔️ N/A

Response

operations.GetV1IndexesIndexIDResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

put_v1_indexes_index_id_json

Update index

Example Usage

import coinapi
from coinapi.models import components

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)


res = s.indexes.put_v1_indexes_index_id_json(index_id='<value>', v1_index_data=components.V1IndexData())

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
index_id str ✔️ N/A
v1_index_data Optional[components.V1IndexData] N/A

Response

operations.PutV1IndexesIndexIDJSONResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

get_v1_indexes_index_id_history

Retrieve Historical Index Value and Composition

Example Usage

import coinapi
import dateutil.parser

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)


res = s.indexes.get_v1_indexes_index_id_history(index_id='<value>', time_start=dateutil.parser.isoparse('2024-10-21T14:08:54.780Z'), time_end=dateutil.parser.isoparse('2022-08-14T15:13:35.032Z'), limit=100)

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
index_id str ✔️ N/A
time_start date N/A
time_end date N/A
limit Optional[int] N/A

Response

operations.GetV1IndexesIndexIDHistoryResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

get_v1_indexes_index_id_timeseries

Retrieve Historical Index Value Timeseries

Example Usage

import coinapi
import dateutil.parser

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)


res = s.indexes.get_v1_indexes_index_id_timeseries(index_id='<value>', time_start=dateutil.parser.isoparse('2022-09-29T06:10:23.640Z'), time_end=dateutil.parser.isoparse('2022-11-21T03:10:01.688Z'), limit=100)

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
index_id str ✔️ N/A
time_start date N/A
time_end date N/A
limit Optional[int] N/A

Response

operations.GetV1IndexesIndexIDTimeseriesResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /

get_v1_indexes_index_id_timeseries_to_be_announced

Retrieve Historical Composition Value Timeseries Retrieves historical timeseries for the specific composition value for an index

Example Usage

import coinapi
from coinapi.models import operations

s = coinapi.CoinAPI(
    api_key="<YOUR_API_KEY_HERE>",
)

req = operations.GetV1IndexesIndexIDTimeseriesTOBEANNOUNCEDRequest(
    index_id='<value>',
)

res = s.indexes.get_v1_indexes_index_id_timeseries_to_be_announced(req)

if res.content is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request operations.GetV1IndexesIndexIDTimeseriesTOBEANNOUNCEDRequest ✔️ The request object to use for the request.

Response

operations.GetV1IndexesIndexIDTimeseriesTOBEANNOUNCEDResponse

Errors

Error Object Status Code Content Type
errors.CoinAPIError 4x-5xx /