wss://api.kiyotaka.ai/v2/
- WebSocket API
Provides a WebSocket JSON-RPC interface. Uses JSON-RPC streaming and requires periodic ping messages to maintain the connection.
https://api.kiyotaka.ai/v1/
- REST API
Offers a RESTful API interface. For detailed API specifications, refer to the Swagger documentation.
grpc.api.kiyotaka.ai:443
- gRPC API
Offers a gRPC API interface. Includes streaming methods.
/docs/
- Methods and Type Documentation
Provides comprehensive documentation for all API methods and data types.
/swagger/
- Swagger UI
Interactive interface to explore and test the REST API endpoints.
/proto/
- .proto files
List of gRPC protobuf files used by the current server.
Useful for generating client code.
github.com/kiyotaka-ai/kiyotaka-api-py
- Python SDK
Python SDK based on .proto files.
github.com/kiyotaka-ai/kiyotaka-api-js
- JavaScript/TypeScript SDK
JavaScript/TypeScript SDK based on .proto files.
PointType.TRADE
is available only for the last 24 hours
x-kiyotaka-key
header with the API key is required
no rate limiting
Get candlesticks for BTCUSDT on COINBASE
Get all coins on all exchanges
python: StreamPoints
This snippet demonstrates how to use the Kiyotaka API to stream trade aggregation data for Bitcoin from Binance.
It connects to the API via gRPC, requests data for the last hour, and
prints the JSON responses as they are received.
import asyncio import kiyotaka import kiyotaka.api import time from grpclib.client import Channel async def main(): metadata = { 'x-kiyotaka-key': 'YOUR_API_KEY_HERE' } channel = Channel( host="grpc.api.kiyotaka.ai", port=443, ssl=True, ) service = kiyotaka.api.ApiStub(channel) from_ = int(time.time()) - 60*60 data_request = kiyotaka.api.PointRequest( type=[kiyotaka.api.PointType.TRADE_AGG], exchange=[kiyotaka.api.PointExchange.BINANCE], coin=["BTC"], interval=kiyotaka.api.PointAggregationInterval.MINUTE, from_=from_, ) stream = service.stream_points(data_request, timeout=3600, metadata=metadata) async for response in stream: print(response.to_json()) channel.close() if __name__ == "__main__": asyncio.run(main())
typescript: StreamPoints
import { api } from "../kiyotaka/api/api"; import * as grpc from "@grpc/grpc-js"; async function main() { const metadata = new grpc.Metadata(); metadata.set("x-kiyotaka-key", "YOUR_API_KEY_HERE"); const client = new api.APIClient( "grpc.api.kiyotaka.ai:443", grpc.credentials.createSsl() ); const from = Math.floor(Date.now() / 1000) - 60 * 60; const request = new api.PointRequest({ type: [api.PointType.TRADE_AGG], exchange: [api.PointExchange.BINANCE], coin: ["BTC"], interval: api.PointAggregationInterval.MINUTE, from: from, }); const stream = client.StreamPoints(request, metadata); stream.on("data", (response: api.PointSeries) => { console.log(JSON.stringify(response.toObject())); }); stream.on("error", (error: Error) => { console.error("Stream error:", error); }); stream.on("end", () => { console.log("Stream ended"); client.close(); }); } main().catch(console.error);
API service for querying and streaming financial data points
Method Name | Request Type | Response Type | Description |
GetPoints | PointRequest | PointResponse | Retrieves a set of data points based on the provided criteria |
StreamPoints | PointRequest | PointSeries stream | Streams data points in real-time based on the provided criteria |
GetTypes | PointMetaRequest | PointMetaResponse | Retrieves available data types |
GetExchanges | PointMetaRequest | PointMetaResponse | Retrieves available exchanges |
GetCategories | PointMetaRequest | PointMetaResponse | Retrieves available categories |
GetCoins | PointMetaRequest | PointMetaResponse | Retrieves available coins |
GetRawSymbols | PointMetaRequest | PointMetaResponse | Retrieves available raw symbols |
GetNormalizedSymbols | PointMetaRequest | PointMetaResponse | Retrieves available normalized symbols |
Method Name | Method | Pattern | Body |
GetPoints | GET | /v1/points | |
GetTypes | GET | /v1/types | |
GetExchanges | GET | /v1/exchanges | |
GetCategories | GET | /v1/categories | |
GetCoins | GET | /v1/coins | |
GetRawSymbols | GET | /v1/symbols | |
GetNormalizedSymbols | GET | /v1/normalized-symbols |
Represents a single data point
Field | Type | Label | Description |
id | PointSeriesIdentifier | optional | Identifier for the point series |
trade | Trade | Raw trade data |
|
fundingRateAggregation | FundingRateAggregation | Aggregated funding rate data |
|
liquidationAggregation | LiquidationAggregation | Aggregated liquidation data |
|
openInterestAggregation | OpenInterestAggregation | Aggregated open interest data |
|
tradeAggregation | TradeAggregation | Aggregated trade data |
|
cmeOpenInterestAggregation | CmeOpenInterestAggregation | Aggregated cme open interest data |
|
optionOpenInterestAggregation | OptionOpenInterestAggregation | Aggregated option open interest data |
|
tradeSideAgnosticAggregation | TradeSideAgnosticAggregation | Aggregated trade data, but without grouping by side |
|
hyperliquidLiquidationAggregation | HyperliquidLiquidationAggregation | Aggregated hyperliquid liquidation data |
Field | Type | Label | Description |
type | PointType | repeated | List of data types to filter by |
exchange | PointExchange | repeated | List of exchanges to filter by |
category | PointCategory | repeated | List of categories to filter by (not applicable to all data types) |
coin | string | repeated | List of coins to filter by |
rawSymbol | string | repeated | List of raw symbols to filter by |
normalizedSymbol | string | repeated | List of normalized symbols to filter by |
from | int64 | Start timestamp for data retrieval |
|
to | int64 | End timestamp for data retrieval |
Field | Type | Label | Description |
types | PointType | repeated | List of available data types |
exchanges | PointExchange | repeated | List of available exchanges |
categories | PointCategory | repeated | List of available categories |
coins | string | repeated | List of available coins |
rawSymbols | string | repeated | List of available raw symbols |
normalizedSymbols | string | repeated | List of available normalized symbols |
Field | Type | Label | Description |
type | PointType | repeated | List of data types to retrieve |
exchange | PointExchange | repeated | List of exchanges to retrieve data from |
normalizedSymbol | string | repeated | List of normalized symbols to retrieve |
coin | string | repeated | List of coins to retrieve data for |
category | PointCategory | repeated | List of categories to retrieve |
rawSymbol | string | repeated | List of raw symbols to retrieve |
side | PointSide | Trade side to filter by |
|
interval | PointAggregationInterval | Aggregation interval for the data points |
|
from | int64 | Start timestamp for data retrieval |
|
period | int64 | Duration in seconds for data retrieval |
Response containing series of data points
Field | Type | Label | Description |
series | PointSeries | repeated | List of point series matching the request criteria |
Represents a series of data points
Field | Type | Label | Description |
id | PointSeriesIdentifier | Identifier for the point series |
|
points | Point | repeated | List of data points in the series |
Field | Type | Label | Description |
type | PointType | Type of data point |
|
rawSymbol | string | Raw symbol identifier |
|
exchange | PointExchange | Exchange where the data originates |
|
normalizedSymbol | string | Normalized symbol identifier |
|
category | PointCategory | Category of the data point |
|
interval | PointAggregationInterval | Aggregation interval of the data series |
|
side | PointSide | Trade side (buy/sell) |
|
coin | string | Coin identifier |
Name | Number | Description |
UNKNOWN_AGGREGATION_INTERVAL | 0 | Default unknown interval |
MINUTE | 2 | One-minute interval |
FIVE_MINUTES | 3 | Five-minute interval |
FIFTEEN_MINUTES | 4 | Fifteen-minute interval |
HOUR | 5 | One-hour interval |
FOUR_HOURS | 6 | Four-hour interval |
DAY | 7 | One-day interval |
WEEK | 8 | One-week interval |
Enum representing different categories of financial instruments
Name | Number | Description |
UNKNOWN_CATEGORY | 0 | Default unknown category |
SPOT | 1 | Spot trading |
PERPETUAL | 2 | Perpetual contracts |
FUTURE | 3 | Future contracts |
OPTION | 4 | Option contracts |
COMBO | 5 | Combination of multiple instrument types |
Enum representing different exchanges
Name | Number | Description |
UNKNOWN_EXCHANGE | 0 | |
BITMEX | 1 | |
DERIBIT | 2 | |
BINANCE_FUTURES | 3 | |
BINANCE_DELIVERY | 4 | |
BINANCE_OPTIONS | 5 | |
BINANCE | 6 | |
FTX | 7 | |
OKEX_FUTURES | 8 | |
OKEX_OPTIONS | 9 | |
OKEX_SWAP | 10 | |
OKEX | 11 | |
HUOBI_DM | 12 | |
HUOBI_DM_SWAP | 13 | |
HUOBI_DM_LINEAR_SWAP | 14 | |
HUOBI | 15 | |
BITFINEX_DERIVATIVES | 16 | |
BITFINEX | 17 | |
COINBASE | 18 | |
CRYPTOFACILITIES | 19 | |
KRAKEN | 20 | |
BITSTAMP | 21 | |
GEMINI | 22 | |
POLONIEX | 23 | |
BYBIT | 24 | |
PHEMEX | 25 | |
DELTA | 26 | |
FTX_US | 27 | |
BINANCE_US | 28 | |
GATE_IO_FUTURES | 29 | |
GATE_IO | 30 | |
OKCOIN | 31 | |
BITFLYER | 32 | |
HITBTC | 33 | |
COINFLEX | 34 | |
BINANCE_JERSEY | 35 | |
BINANCE_DEX | 36 | |
UPBIT | 37 | |
ASCENDEX | 38 | |
DYDX | 39 | |
SERUM | 40 | |
HUOBI_DM_OPTIONS | 41 | |
CME | 42 | |
COMMON_BINANCE | 43 | |
BITBANK | 44 | |
COMMON_BITFINEX | 45 | |
BITHUMB | 46 | |
BITTREX | 47 | |
COINCHECK | 48 | |
COMMON_GATE_IO | 49 | |
COINBASE_PRO | 50 | |
COMMON_HUOBI | 51 | |
KUCOIN | 52 | |
LMAX | 53 | |
COMMON_OKEX | 54 | |
LIQUID | 55 | |
ZAIF | 56 | |
RIBBON | 57 | |
EMULATOR | 58 | |
GRAYSCALE | 59 | |
BYBIT_SPOT | 60 | |
NYSE_AMERICAN | 61 | |
NASDAQ_BX | 62 | |
NYSE_NATIONAL | 63 | |
FINRA | 64 | |
UNLISTED_TRADING_PRIVILEGES | 65 | |
NASDAQ_ISE | 66 | |
CBOE_EDGA | 67 | |
CBOE_EDGX | 68 | |
NYSE_CHICAGO | 69 | |
NYSE | 70 | |
NYSE_ARCA | 71 | |
NASDAQ | 72 | |
CONSOLIDATED_TAPE_ASSOCIATION | 73 | |
LTSE | 74 | |
IEX | 75 | |
CBOE | 76 | |
NASDAQ_PHILADELPHIA | 77 | |
CBOE_BYX | 78 | |
CBOE_BZX | 79 | |
MIAX_PEARL | 80 | |
MEMBERS_EXCHANGE | 81 | |
OTC_EQUITY_SECURITY | 82 | |
BITGET | 83 | |
HYPERLIQUID | 84 | |
HYPERLIQUID_FUTURES | 85 | |
MARKET_INDEPENDENT | 86 | |
NASDAQ_SMALL_CAP | 87 | |
NASDAQ_INT | 88 | |
NASDAQ_PSX | 89 | |
PYTH_NETWORK | 90 | |
COINBASE_INTERNATIONAL | 91 | |
POLYGON | 92 | |
POLYGON_FX | 93 | |
UNISWAP_V2 | 150 | |
SUSHISWAP_V2 | 151 | |
PANCAKESWAP_V2 | 152 | |
SHIBASWAP | 153 | |
FRAXSWAP | 154 | |
SOLIDLY | 155 | |
UNISWAP_V3 | 156 | |
SUSHISWAP_V3 | 157 | |
PANCAKESWAP_V3 | 158 | |
SOLIDLY_V3 | 159 | |
RAYDIUM_V4 | 160 | |
RAYDIUM_CLMM | 161 | |
ORCA_WHIRLPOOL | 162 | |
ORCA_V2 | 163 | |
METEORA_POOL | 164 | |
METEORA_DLMM | 165 | |
UNISWAP_V4 | 166 |
Enum representing trade sides
Name | Number | Description |
UNKNOWN_SIDE | 0 | Default unknown side |
SELL | 1 | Sell side |
BUY | 2 | Buy side |
Enum representing different types of data points
Name | Number | Description |
UNKNOWN_TYPE | 0 | Default unknown type |
TRADE | 1 | Raw trade data |
TRADE_AGG | 9 | Aggregated trade data |
OPEN_INTEREST_AGG | 10 | Aggregated open interest data |
FUNDING_RATE_AGG | 11 | Aggregated funding rate data |
LIQUIDATION_AGG | 12 | Aggregated liquidation data |
CME_OPEN_INTEREST_AGG | 19 | Aggregated cme open interest data |
OPTION_OPEN_INTEREST_AGG | 59 | Aggregated option open interest data |
TRADE_SIDE_AGNOSTIC_AGG | 107 | Aggregated trade data, but without grouping by side |
HYPERLIQUID_LIQUIDATION_AGG | 147 | Aggregated hyperliquid liquidation data |
Represents aggregated trade data for a specific time period
Field | Type | Label | Description |
open | double | Opening price for the aggregation period |
|
high | double | Highest price reached during the aggregation period |
|
low | double | Lowest price reached during the aggregation period |
|
close | double | Closing price for the aggregation period |
|
volume | double | Total trading volume during the aggregation period |
|
timestamp | Timestamp | Timestamp representing the start of the aggregation period |
|
firstTimestamp | Timestamp | Timestamp of the first trade in the aggregation period |
|
lastTimestamp | Timestamp | Timestamp of the last trade in the aggregation period |
Represents aggregated trade data for a specific time period, but without Side
grouping
Field | Type | Label | Description |
open | double | Opening price for the aggregation period |
|
high | double | Highest price reached during the aggregation period |
|
low | double | Lowest price reached during the aggregation period |
|
close | double | Closing price for the aggregation period |
|
volume | double | Total trading volume during the aggregation period |
|
timestamp | Timestamp | Timestamp representing the start of the aggregation period |
|
firstTimestamp | Timestamp | Timestamp of the first trade in the aggregation period |
|
lastTimestamp | Timestamp | Timestamp of the last trade in the aggregation period |
Field | Type | Label | Description |
open | double | optional |
|
high | double | optional |
|
low | double | optional |
|
close | double | optional |
|
timestamp | Timestamp |
|
Field | Type | Label | Description |
rateOpen | double | optional |
|
rateHigh | double | optional |
|
rateLow | double | optional |
|
rateClose | double | optional |
|
predictedOpen | double | optional |
|
predictedHigh | double | optional |
|
predictedLow | double | optional |
|
predictedClose | double | optional |
|
timestamp | Timestamp |
|
Field | Type | Label | Description |
liquidations | double |
|
|
timestamp | Timestamp |
|
Field | Type | Label | Description |
open | double | optional |
|
high | double | optional |
|
low | double | optional |
|
close | double | optional |
|
valueOpen | double | optional |
|
valueHigh | double | optional |
|
valueLow | double | optional |
|
valueClose | double | optional |
|
priceOpen | double | optional |
|
priceHigh | double | optional |
|
priceLow | double | optional |
|
priceClose | double | optional |
|
timestamp | Timestamp |
|
Field | Type | Label | Description |
underlyingPriceClose | double | optional |
|
oiClose | double | optional |
|
timestamp | Timestamp |
|
Field | Type | Label | Description |
timestamp | Timestamp |
|
|
coin | string |
|
|
levels | double | repeated |
|
Timestamp is a point in time represented as seconds and fractions of seconds at nanosecond resolution in UTC since Unix epoch.
Field | Type | Label | Description |
seconds | fixed32 | Seconds of UTC time since Unix epoch. |
|
nanoseconds | fixed32 | Fractions of a second at nanosecond resolution. |
Represents a single trade transaction
Field | Type | Label | Description |
id | string | Unique exchange-native identifier of the trade |
|
price | double | Price at which the trade was executed |
|
amount | double | Quantity of the asset traded |
|
timestamp | Timestamp | Timestamp when the trade occurred |