kabuステーションAPI

repository·master·Indexed 19 days ago

https://github.com/kabucom/kabusapi

A portal and API interface for kabuステーション used for interacting with financial trading services. Includes an Excel Add-in providing custom functions for retrieving real-time prices, market data, server status, and managing orders via RTD and WebSocket connections.

Tokens
885
Snippets
3
Records
5
Agent score
15%

What's inside kabusapi

  1. Submit requests, questions, or bug reports for kabuステーションAPI

    master

    If you need to interact with the kabuステーションAPI developers, you can submit issues via GitHub using specific templates for different purposes:

  2. Manage real-time data via WebSocket in Excel

    master

    To receive real-time data pushes in Excel, you must follow a two-step process:

    1. Start the WebSocket connection: Call test_StartWebSocket() to initiate the background connection to the server.
    2. Register symbols: Use test_RegistMarketData(symbol) to tell the server which symbols you want to receive updates for.
    3. Retrieve data: Use test_GetWebSocketData() in a cell to display the most recent message received from the WebSocket stream.

    Note: test_StartWebSocket is a macro-type function and should be triggered once to start the background process.

    // Step 1: Run this once (e.g., via a button or macro)
    =test_StartWebSocket()
    
    // Step 2: Register a symbol for updates
    =test_RegistMarketData("165060019@2")
    
    // Step 3: Use this in a cell to see the latest data
    =test_GetWebSocketData()
  3. Use Excel custom functions for Kabu API

    master

    The Excel Add-in provides several custom functions that can be used directly within Excel spreadsheet cells to interact with the Kabu API. These functions allow for retrieving real-time prices, market data, checking server status, and managing orders.

    Available Functions

    Function NameDescriptionArgument(s)
    test_GetRTDPriceGet real-time price of the symbol (via RTD)symbol (string)
    test_GetStatusGet Server StatusNone
    test_GetMarketDataGet Market Data (4-price values, etc.)symbol (string, format: 銘柄コード@市場コード)
    test_PutSendOrderExecute a Send Order requestNone
    test_RegistMarketDataRegister a symbol for PUSH (WebSocket) deliverysymbol (string, format: 銘柄コード@市場コード)
    test_StartWebSocketStart the WebSocket connection for real-time dataNone
    test_GetWebSocketDataRetrieve the latest message received via WebSocketNone

    Symbol Format

    For functions requiring a symbol (like test_GetMarketData or test_RegistMarketData), use the format 銘柄コード@市場コード (e.g., 8411@1 or 5401@1).