Skip to content

Latest commit

 

History

History
131 lines (85 loc) · 10.7 KB

README.md

File metadata and controls

131 lines (85 loc) · 10.7 KB

Trades

(trades)

Overview

Controller for retrieving trade data related to executed transactions.

Available Operations

get_v1_trades_symbol_id_history

Get history transactions from specific symbol, returned in time ascending order.

Example Usage

import coinapi
from coinapi.models import operations

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

req = operations.GetV1TradesSymbolIDHistoryRequest(
    symbol_id='<value>',
)

res = s.trades.get_v1_trades_symbol_id_history(req)

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

Parameters

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

Response

operations.GetV1TradesSymbolIDHistoryResponse

Errors

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

get_v1_trades_symbol_id_latest

Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order.

Example Usage

import coinapi

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


res = s.trades.get_v1_trades_symbol_id_latest(symbol_id='<value>', limit=100, include_id=False)

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

Parameters

Parameter Type Required Description
symbol_id str ✔️ Symbol identifier for requested timeseries (from the Metadata -> Symbols)
limit Optional[int] Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)
include_id Optional[bool] Information that additional exchange trade identifier should be included in the id_trade parameter of the trade if exchange providing identifiers.

Response

operations.GetV1TradesSymbolIDLatestResponse

Errors

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

get_v1_trades_latest

Get latest trades executed up to 1 minute ago. Latest data is always returned in time descending order.

Example Usage

import coinapi

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


res = s.trades.get_v1_trades_latest(filter_symbol_id='<value>', include_id=False, limit=100)

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

Parameters

Parameter Type Required Description
filter_symbol_id Optional[str] Comma or semicolon delimited parts of symbol identifier used to filter response. (optional)
include_id Optional[bool] Information that additional exchange trade identifier should be included in the id_trade parameter of the trade if exchange providing identifiers.
limit Optional[int] Amount of items to return (optional, mininum is 1, maximum is 100000, default value is 100, if the parameter is used then every 100 output items are counted as one request)

Response

operations.GetV1TradesLatestResponse

Errors

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