クライアント¶
2 種類の HTTP クライアントです。どちらも Public / Private の全エンドポイントをメソッドとして
公開し、モデル に記載のモデルを返します。コンストラクタ引数、rate_limit、
クローズ処理とコンテキストマネージャーは内部のエンジン由来で、以下に併記されています。
Client
¶
Client(
api_key: str = "",
api_secret: str = "",
*,
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
base_url: str = BASE_URL,
retry: RetryPolicy | None = None,
rate_limits: RateLimits | None = None,
headers: dict[str, str] | None = None,
transport: BaseTransport | None = None,
http_client: Client | None = None,
)
Bases: PublicAPI, PrivateAPI
bitFlyer Lightning API client.
Exposes every Public and Private HTTP endpoint as a method. The constructor arguments are listed below; the key and secret are only needed for Private endpoints.
Prefer the context manager, or call close() yourself, so the
connection pool does not outlive its use::
with Client() as client:
print(client.get_ticker(ProductCode.FX_BTC_JPY).ltp)
with Client(api_key, api_secret) as client:
ack = client.send_child_order(
ProductCode.BTC_JPY, ChildOrderType.LIMIT, Side.BUY, 0.001, price=5_000_000
)
client.cancel_child_order(
ProductCode.BTC_JPY, child_order_acceptance_id=ack.child_order_acceptance_id
)
Instances are safe to share between threads: the underlying
httpx.Client is thread-safe and the rate limiter is locked.
For streaming market data and order events see
RealtimeClient, and for asyncio see
AsyncClient.
rate_limit
property
¶
bitFlyer's rate limit counters as of the most recent response.
None until the first request completes, or if the server stopped
sending the X-RateLimit-* headers.
get_permissions
¶
List the endpoints this API key is allowed to call.
Wraps GET /v1/me/getpermissions.
get_balance
¶
Fetch balances for every currency.
Wraps GET /v1/me/getbalance.
get_collateral
¶
Fetch margin status for the account.
Wraps GET /v1/me/getcollateral.
get_collateral_accounts
¶
Fetch collateral held per currency.
Wraps GET /v1/me/getcollateralaccounts.
get_addresses
¶
List your crypto deposit addresses.
Wraps GET /v1/me/getaddresses.
get_coin_ins
¶
get_coin_ins(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CoinIn]
List incoming crypto transfers.
Wraps GET /v1/me/getcoinins.
get_coin_outs
¶
get_coin_outs(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CoinOut]
List outgoing crypto transfers.
Wraps GET /v1/me/getcoinouts.
get_bank_accounts
¶
List your registered bank accounts.
Wraps GET /v1/me/getbankaccounts.
get_deposits
¶
get_deposits(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[Deposit]
List cash deposits.
Wraps GET /v1/me/getdeposits.
withdraw
¶
withdraw(
currency_code: str,
bank_account_id: int,
amount: int,
code: str | None = None,
) -> WithdrawResponse
Withdraw cash to a registered bank account.
Wraps POST /v1/me/withdraw. This moves real money and cannot be
undone. It is never retried automatically, whatever
RetryPolicy says, because a timed-out withdrawal
may still have been accepted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currency_code
|
str
|
Currency to withdraw, e.g. |
required |
bank_account_id
|
int
|
|
required |
amount
|
int
|
Amount to withdraw. |
required |
code
|
str | None
|
Two-factor confirmation code, if your account requires one. |
None
|
get_withdrawals
¶
get_withdrawals(
count: int | None = None,
before: int | None = None,
after: int | None = None,
message_id: str | None = None,
) -> list[Withdrawal]
List cash withdrawals.
Wraps GET /v1/me/getwithdrawals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only records with a lower |
None
|
after
|
int | None
|
Return only records with a higher |
None
|
message_id
|
str | None
|
Narrow to the withdrawal started by this
|
None
|
send_child_order
¶
send_child_order(
product_code: str,
child_order_type: str,
side: str,
size: float,
price: float | None = None,
minute_to_expire: int | None = None,
time_in_force: str = TimeInForce.GTC,
) -> ChildOrderResponse
Place an order.
Wraps POST /v1/me/sendchildorder. A successful call means the order
was accepted, not filled; see
ChildOrderResponse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to trade. |
required |
child_order_type
|
str
|
|
required |
side
|
str
|
|
required |
size
|
float
|
Order quantity in the base asset. |
required |
price
|
float | None
|
Limit price. Required for |
None
|
minute_to_expire
|
int | None
|
Minutes until the order expires. Defaults to bitFlyer's own default of 43200, i.e. 30 days. |
None
|
time_in_force
|
str
|
|
GTC
|
cancel_child_order
¶
cancel_child_order(
product_code: str = ProductCode.BTC_JPY,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
) -> None
Cancel one order.
Wraps POST /v1/me/cancelchildorder, which answers with an empty body
on success. Pass exactly one of the two identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market the order is on. |
BTC_JPY
|
child_order_id
|
str | None
|
Exchange-assigned order id. |
None
|
child_order_acceptance_id
|
str | None
|
Acceptance id returned by
|
None
|
send_parent_order
¶
send_parent_order(
parameters: Sequence[
ParentOrderParameter | dict[str, Any]
],
order_method: str = OrderMethod.SIMPLE,
minute_to_expire: int | None = None,
time_in_force: str = TimeInForce.GTC,
) -> ParentOrderResponse
Place a conditional or multi-leg order.
Wraps POST /v1/me/sendparentorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
Sequence[ParentOrderParameter | dict[str, Any]]
|
The legs, as
|
required |
order_method
|
str
|
|
SIMPLE
|
minute_to_expire
|
int | None
|
Minutes until the order expires. Defaults to bitFlyer's own default of 43200, i.e. 30 days. |
None
|
time_in_force
|
str
|
|
GTC
|
cancel_parent_order
¶
cancel_parent_order(
product_code: str = ProductCode.BTC_JPY,
parent_order_id: str | None = None,
parent_order_acceptance_id: str | None = None,
) -> None
Cancel one parent order.
Wraps POST /v1/me/cancelparentorder, which answers with an empty body
on success. Pass exactly one of the two identifiers.
cancel_all_child_orders
¶
Cancel every open order on one market.
Wraps POST /v1/me/cancelallchildorders, which answers with an empty
body on success.
get_child_orders
¶
get_child_orders(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
child_order_state: str | None = None,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
parent_order_id: str | None = None,
) -> list[ChildOrder]
List your orders.
Wraps GET /v1/me/getchildorders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only orders with a lower |
None
|
after
|
int | None
|
Return only orders with a higher |
None
|
child_order_state
|
str | None
|
Filter by state, e.g. |
None
|
child_order_id
|
str | None
|
Narrow to one order by exchange id. |
None
|
child_order_acceptance_id
|
str | None
|
Narrow to one order by acceptance id. |
None
|
parent_order_id
|
str | None
|
Narrow to the children of one parent order. |
None
|
get_parent_orders
¶
get_parent_orders(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
parent_order_state: str | None = None,
) -> list[ParentOrder]
List your parent orders.
Wraps GET /v1/me/getparentorders. The rows summarise each parent
order; call get_parent_order() for its legs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only orders with a lower |
None
|
after
|
int | None
|
Return only orders with a higher |
None
|
parent_order_state
|
str | None
|
Filter by state. See
|
None
|
get_parent_order
¶
get_parent_order(
parent_order_id: str | None = None,
parent_order_acceptance_id: str | None = None,
) -> ParentOrderDetail
Fetch one parent order together with its legs.
Wraps GET /v1/me/getparentorder. Pass exactly one of the two
identifiers.
get_my_executions
¶
get_my_executions(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
) -> list[MyExecution]
List your fills.
Wraps GET /v1/me/getexecutions. Named get_my_executions to keep
it distinct from the public get_executions().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only fills with a lower |
None
|
after
|
int | None
|
Return only fills with a higher |
None
|
child_order_id
|
str | None
|
Narrow to the fills of one order. |
None
|
child_order_acceptance_id
|
str | None
|
Narrow to the fills of one order by acceptance id. |
None
|
get_balance_history
¶
get_balance_history(
currency_code: str = "JPY",
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[BalanceHistory]
List balance ledger entries for one currency.
Wraps GET /v1/me/getbalancehistory.
get_positions
¶
List open leveraged positions.
Wraps GET /v1/me/getpositions. Positions come back individually
rather than netted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Leveraged market to query. |
FX_BTC_JPY
|
get_collateral_history
¶
get_collateral_history(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CollateralHistory]
List changes to your collateral.
Wraps GET /v1/me/getcollateralhistory.
get_trading_commission
¶
Fetch your commission rate for one market.
Wraps GET /v1/me/gettradingcommission.
get_board
¶
Fetch the order book.
Wraps GET /v1/getboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_ticker
¶
Fetch the ticker.
Wraps GET /v1/getticker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_executions
¶
get_executions(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[Execution]
List recent public trades, newest first.
Wraps GET /v1/getexecutions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only trades with a lower |
None
|
after
|
int | None
|
Return only trades with a higher |
None
|
get_board_state
¶
Fetch the order book state.
Wraps GET /v1/getboardstate. Use this rather than
get_health()
to decide whether orders are being accepted right now.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_health
¶
Fetch exchange health.
Wraps GET /v1/gethealth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_funding_rate
¶
Fetch the current funding rate.
Wraps GET /v1/getfundingrate. Only perpetual markets have one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Perpetual market to query. |
FX_BTC_JPY
|
get_funding_rate_history
¶
get_funding_rate_history(
product_code: str = ProductCode.FX_BTC_JPY,
count: int | None = None,
from_: str | None = None,
to: str | None = None,
) -> list[FundingRateHistory]
List settled funding rates.
Wraps GET /v1/getfundingratehistory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Perpetual market to query. |
FX_BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
from_
|
str | None
|
Inclusive start date, |
None
|
to
|
str | None
|
Inclusive end date, |
None
|
get_corporate_leverage
¶
Fetch the maximum leverage available to corporate accounts.
Wraps GET /v1/getcorporateleverage.
get_chats
¶
List recent chat room messages.
Wraps GET /v1/getchats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_date
|
str | None
|
ISO 8601 timestamp; only messages after it are returned. Defaults to the last five days. |
None
|
AsyncClient
¶
AsyncClient(
api_key: str = "",
api_secret: str = "",
*,
timeout: float | Timeout | None = DEFAULT_TIMEOUT,
base_url: str = BASE_URL,
retry: RetryPolicy | None = None,
rate_limits: RateLimits | None = None,
headers: dict[str, str] | None = None,
transport: AsyncBaseTransport | None = None,
http_client: AsyncClient | None = None,
)
Bases: AsyncPublicAPI, AsyncPrivateAPI
Asyncio bitFlyer Lightning API client.
The same surface as Client, with every endpoint
as a coroutine. Constructor arguments are listed below.
Use it as an async context manager, or await aclose()::
async with AsyncClient() as client:
board, ticker = await asyncio.gather(
client.get_board(ProductCode.FX_BTC_JPY),
client.get_ticker(ProductCode.FX_BTC_JPY),
)
Concurrent calls on one instance share the connection pool and the
client-side rate limiter, so fanning out with asyncio.gather() will be
throttled as one budget rather than overrunning it.
For streaming market data and order events see
AsyncRealtimeClient.
rate_limit
property
¶
bitFlyer's rate limit counters as of the most recent response.
None until the first request completes, or if the server stopped
sending the X-RateLimit-* headers.
get_permissions
async
¶
List the endpoints this API key is allowed to call.
Wraps GET /v1/me/getpermissions.
get_balance
async
¶
Fetch balances for every currency.
Wraps GET /v1/me/getbalance.
get_collateral
async
¶
Fetch margin status for the account.
Wraps GET /v1/me/getcollateral.
get_collateral_accounts
async
¶
Fetch collateral held per currency.
Wraps GET /v1/me/getcollateralaccounts.
get_addresses
async
¶
List your crypto deposit addresses.
Wraps GET /v1/me/getaddresses.
get_coin_ins
async
¶
get_coin_ins(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CoinIn]
List incoming crypto transfers.
Wraps GET /v1/me/getcoinins.
get_coin_outs
async
¶
get_coin_outs(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CoinOut]
List outgoing crypto transfers.
Wraps GET /v1/me/getcoinouts.
get_bank_accounts
async
¶
List your registered bank accounts.
Wraps GET /v1/me/getbankaccounts.
get_deposits
async
¶
get_deposits(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[Deposit]
List cash deposits.
Wraps GET /v1/me/getdeposits.
withdraw
async
¶
withdraw(
currency_code: str,
bank_account_id: int,
amount: int,
code: str | None = None,
) -> WithdrawResponse
Withdraw cash to a registered bank account.
Wraps POST /v1/me/withdraw. This moves real money and cannot be
undone. It is never retried automatically, whatever
RetryPolicy says, because a timed-out withdrawal
may still have been accepted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currency_code
|
str
|
Currency to withdraw, e.g. |
required |
bank_account_id
|
int
|
|
required |
amount
|
int
|
Amount to withdraw. |
required |
code
|
str | None
|
Two-factor confirmation code, if your account requires one. |
None
|
get_withdrawals
async
¶
get_withdrawals(
count: int | None = None,
before: int | None = None,
after: int | None = None,
message_id: str | None = None,
) -> list[Withdrawal]
List cash withdrawals.
Wraps GET /v1/me/getwithdrawals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only records with a lower |
None
|
after
|
int | None
|
Return only records with a higher |
None
|
message_id
|
str | None
|
Narrow to the withdrawal started by this
|
None
|
send_child_order
async
¶
send_child_order(
product_code: str,
child_order_type: str,
side: str,
size: float,
price: float | None = None,
minute_to_expire: int | None = None,
time_in_force: str = TimeInForce.GTC,
) -> ChildOrderResponse
Place an order.
Wraps POST /v1/me/sendchildorder. A successful call means the order
was accepted, not filled; see
ChildOrderResponse.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to trade. |
required |
child_order_type
|
str
|
|
required |
side
|
str
|
|
required |
size
|
float
|
Order quantity in the base asset. |
required |
price
|
float | None
|
Limit price. Required for |
None
|
minute_to_expire
|
int | None
|
Minutes until the order expires. Defaults to bitFlyer's own default of 43200, i.e. 30 days. |
None
|
time_in_force
|
str
|
|
GTC
|
cancel_child_order
async
¶
cancel_child_order(
product_code: str = ProductCode.BTC_JPY,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
) -> None
Cancel one order.
Wraps POST /v1/me/cancelchildorder, which answers with an empty body
on success. Pass exactly one of the two identifiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market the order is on. |
BTC_JPY
|
child_order_id
|
str | None
|
Exchange-assigned order id. |
None
|
child_order_acceptance_id
|
str | None
|
Acceptance id returned by
|
None
|
send_parent_order
async
¶
send_parent_order(
parameters: Sequence[
ParentOrderParameter | dict[str, Any]
],
order_method: str = OrderMethod.SIMPLE,
minute_to_expire: int | None = None,
time_in_force: str = TimeInForce.GTC,
) -> ParentOrderResponse
Place a conditional or multi-leg order.
Wraps POST /v1/me/sendparentorder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
Sequence[ParentOrderParameter | dict[str, Any]]
|
The legs, as
|
required |
order_method
|
str
|
|
SIMPLE
|
minute_to_expire
|
int | None
|
Minutes until the order expires. Defaults to bitFlyer's own default of 43200, i.e. 30 days. |
None
|
time_in_force
|
str
|
|
GTC
|
cancel_parent_order
async
¶
cancel_parent_order(
product_code: str = ProductCode.BTC_JPY,
parent_order_id: str | None = None,
parent_order_acceptance_id: str | None = None,
) -> None
Cancel one parent order.
Wraps POST /v1/me/cancelparentorder, which answers with an empty body
on success. Pass exactly one of the two identifiers.
cancel_all_child_orders
async
¶
Cancel every open order on one market.
Wraps POST /v1/me/cancelallchildorders, which answers with an empty
body on success.
get_child_orders
async
¶
get_child_orders(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
child_order_state: str | None = None,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
parent_order_id: str | None = None,
) -> list[ChildOrder]
List your orders.
Wraps GET /v1/me/getchildorders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only orders with a lower |
None
|
after
|
int | None
|
Return only orders with a higher |
None
|
child_order_state
|
str | None
|
Filter by state, e.g. |
None
|
child_order_id
|
str | None
|
Narrow to one order by exchange id. |
None
|
child_order_acceptance_id
|
str | None
|
Narrow to one order by acceptance id. |
None
|
parent_order_id
|
str | None
|
Narrow to the children of one parent order. |
None
|
get_parent_orders
async
¶
get_parent_orders(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
parent_order_state: str | None = None,
) -> list[ParentOrder]
List your parent orders.
Wraps GET /v1/me/getparentorders. The rows summarise each parent
order; call get_parent_order() for its legs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only orders with a lower |
None
|
after
|
int | None
|
Return only orders with a higher |
None
|
parent_order_state
|
str | None
|
Filter by state. See
|
None
|
get_parent_order
async
¶
get_parent_order(
parent_order_id: str | None = None,
parent_order_acceptance_id: str | None = None,
) -> ParentOrderDetail
Fetch one parent order together with its legs.
Wraps GET /v1/me/getparentorder. Pass exactly one of the two
identifiers.
get_my_executions
async
¶
get_my_executions(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
child_order_id: str | None = None,
child_order_acceptance_id: str | None = None,
) -> list[MyExecution]
List your fills.
Wraps GET /v1/me/getexecutions. Named get_my_executions to keep
it distinct from the public get_executions().
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only fills with a lower |
None
|
after
|
int | None
|
Return only fills with a higher |
None
|
child_order_id
|
str | None
|
Narrow to the fills of one order. |
None
|
child_order_acceptance_id
|
str | None
|
Narrow to the fills of one order by acceptance id. |
None
|
get_balance_history
async
¶
get_balance_history(
currency_code: str = "JPY",
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[BalanceHistory]
List balance ledger entries for one currency.
Wraps GET /v1/me/getbalancehistory.
get_positions
async
¶
List open leveraged positions.
Wraps GET /v1/me/getpositions. Positions come back individually
rather than netted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Leveraged market to query. |
FX_BTC_JPY
|
get_collateral_history
async
¶
get_collateral_history(
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[CollateralHistory]
List changes to your collateral.
Wraps GET /v1/me/getcollateralhistory.
get_trading_commission
async
¶
Fetch your commission rate for one market.
Wraps GET /v1/me/gettradingcommission.
get_markets
async
¶
List the available markets.
Wraps GET /v1/getmarkets.
get_board
async
¶
Fetch the order book.
Wraps GET /v1/getboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_ticker
async
¶
Fetch the ticker.
Wraps GET /v1/getticker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_executions
async
¶
get_executions(
product_code: str = ProductCode.BTC_JPY,
count: int | None = None,
before: int | None = None,
after: int | None = None,
) -> list[Execution]
List recent public trades, newest first.
Wraps GET /v1/getexecutions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
before
|
int | None
|
Return only trades with a lower |
None
|
after
|
int | None
|
Return only trades with a higher |
None
|
get_board_state
async
¶
Fetch the order book state.
Wraps GET /v1/getboardstate. Use this rather than
get_health()
to decide whether orders are being accepted right now.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_health
async
¶
Fetch exchange health.
Wraps GET /v1/gethealth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Market to query. |
BTC_JPY
|
get_funding_rate
async
¶
Fetch the current funding rate.
Wraps GET /v1/getfundingrate. Only perpetual markets have one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Perpetual market to query. |
FX_BTC_JPY
|
get_funding_rate_history
async
¶
get_funding_rate_history(
product_code: str = ProductCode.FX_BTC_JPY,
count: int | None = None,
from_: str | None = None,
to: str | None = None,
) -> list[FundingRateHistory]
List settled funding rates.
Wraps GET /v1/getfundingratehistory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product_code
|
str
|
Perpetual market to query. |
FX_BTC_JPY
|
count
|
int | None
|
Maximum records to return. |
None
|
from_
|
str | None
|
Inclusive start date, |
None
|
to
|
str | None
|
Inclusive end date, |
None
|
get_corporate_leverage
async
¶
Fetch the maximum leverage available to corporate accounts.
Wraps GET /v1/getcorporateleverage.
get_chats
async
¶
List recent chat room messages.
Wraps GET /v1/getchats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_date
|
str | None
|
ISO 8601 timestamp; only messages after it are returned. Defaults to the last five days. |
None
|