MultiMarkets API Docs en
HomeGitHubReferenceLanguage
  • Overview
  • Quick Start
    • Status
  • CLIENT API
    • Overview
    • Access
      • Sign
      • Request
      • Limit
      • Error Code
      • API Address
      • API Code
    • Login
      • Captcha
    • Customer
      • Customer registration
      • Replacement Token
      • API Management
        • Apply API
        • Set permissions
        • Delete API
    • Market Data
      • Introduction
      • Limit
      • Error Code
      • Subscribe
        • Ticker
        • Market
        • Cancel
      • Query
        • Heartbeat
        • Historical K-line
    • Open API
      • Readme
        • Sign
        • Request
        • Error Code
        • API Address
      • Order Process
      • Base
        • Symbol Base Info
      • Customer
        • Customer Info
      • Trade
        • Contract order
      • Message
        • Get Msg Token
        • Msg Subscribe
        • Get Msg Token
        • Msg Subscribe
      • More...
    • Auth2 API
      • Readme
      • Auth Code
      • Access Token
      • User Info
      • Refresh Token
    • More...
  • Manager API
    • Overview
    • Access
      • Sign
      • Request
      • Limit
      • Error Code
      • API Address
      • API Code
    • Authorize
    • Basic data
      • Universal dictionaries
      • Company currency
    • Product
      • Product List
    • Customer
      • Customer List
      • Customer registration
      • Customer info
      • Customer Group
      • Account Info
    • Funds
      • Balance Update
      • Get Balance
    • Data Push
    • More...
  • Bridge API
    • Overview
    • Access Instructions
      • Illustrate
      • Sign
      • Request
      • Speed ​​Limit
      • Error Code
      • Product List
    • Basic data
      • Get a list of universal dictionaries
      • Obtain company currency permissions
    • Product Data
      • Product information list
      • Product rule list
    • Customer Management
      • Customer registration
      • Customer list
      • Customer details
      • Customer account cancellation
    • Account Management
      • Add account
      • Update account
      • Check account
      • Delete account
    • Trading interface
      • Check balance
      • Check deposit records
      • Check withdrawal records
      • Query transfer records
      • Place an order
      • Query order
      • Order list
      • Transaction record
      • Current pending order
      • Cancel order
    • News Subscription
      • Notification message description
      • Webhook subscription
      • Information callback notification
  • Webhook API
    • Overview
    • Account balance
    • Execute adjustment balance
    • Cancel adjustment balance
  • Message API
    • Overview
    • Custom message API
  • WEB IFRAME
    • Introduction
    • Process description
  • FAQ
    • How to apply for apikey for an interface?
    • What is the purpose of the public key?
    • What is the interface request timeout?
    • Supported development languages?
    • What are the API call restrictions?
    • How to use APIs more safely?
  • API Reference
    • Manager API
    • Client API
  • CHANGELOGS
    • API
Powered by GitBook
On this page
  • Interface Description
  • Request-Protocol Number: 14012
  • Response-Protocol Number: 14013
  1. CLIENT API
  2. Market Data
  3. Query

Historical K-line

Interface Description

Note: The server performs libz compression on the entire packet.

Request-Protocol Number: 14012

Data format:json

Data Structure

data definition

Fields

name

type

Required fields

illustrate

symbol_id

Product ID

uint64

yes

trade_type

Transaction Type

uint32

yes

1: Full position contract, 2: Isolated position contract, 3: Leverage, 5: Spot, 6: Stock

trade_mode

Trading Model

uint32

yes

1:MM, 2:ButterflyMM, 3:Matchmaking, 4:Aggregation

kline_type

K-line type

uint32

yes

1 minute K, 2 is 5 minute K, 3 is 15 minute K, 4 is 30 minute K, 5 is hour K, 6 is 2 hour K, 7 is 4 hour K, 8 is daily K, 9 is weekly K, 10 is monthly K

kline_timestamp_end

Line end timestamp

uint64

no

Unit: Seconds

query_kline_num

Query the number of K lines

uint32

yes

kline_timestamp_end is 0, query_kline_num is not 0, query the latest query_kline_num K-lines (including the current K-line) kline_timestamp_end is not 0, query_kline_num is not 0, query the query_kline_num K-lines from kline_timestamp_end to the previous query_kline_num K-lines In other cases, the interface directly returns an error, indicating that the query service is not supported

Request Example

Copy

{
    "cmd_id":14012,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "symbol_id": 1,
        "trade_type": 1,
        "trade_mode": 0,
        "kline_type": 1,
        "kline_timestamp_end": 1605509068,
        "query_kline_num": 100,
    }
}

Response-Protocol Number: 14013

Data format:json

Data Structure

data definition

Fields

name

type

illustrate

symbol_id

Product ID

uint64

trade_type

Transaction Type

uint32

1: Full position contract, 2: Isolated position contract, 3: Leverage, 5: Spot, 6: Stock

trade_mode

Trading Model

uint32

1:MM, 2:ButterflyMM, 3:Matchmaking, 4:Aggregation

kline_type

K-line type

uint32

1 minute K, 2 is 5 minute K, 3 is 15 minute K, 4 is 30 minute K, 5 is hour K, 6 is 2 hour K, 7 is 4 hour K, 8 is daily K, 9 is weekly K, 10 is monthly K

price_digits

Price decimal places

uint32

kline_list

K-line list

array

See the kline_list definition below for the specific format.

kline_list definition

Fields

name

type

illustrate

timestamp

The timestamp of the K line

uint64

Unit: Seconds

open_price

The opening price of the K-line

string

close_price

The closing price of the K-line

string

high_price

The highest price of the K line

string

low_price

The lowest price of the K line

string

last_tick_time

The last tick time of the K line

uint64

Unit: milliseconds

last_tick_seq

The last tick number of the K-line

uint64

transactions_number

The number of transactions of this K line

string

Example Response

Copy

{
    "ret":200,
    "msg":"ok",
    "cmd_id":14013,
    "seq_id":123,
    "ext":"3baaa938-f92c-4a74-a228-fd49d5e2f8bc-1678419657806",
    "data":{
        "symbol_id": 1123,
        "trade_type": 1,
        "trade_mode": 0,
        "kline_type": 1,
        "price_digits": 2,
        "kline_list":[
            {
                "timestamp": 1605509068,
                "open_price": "651.12",
                "close_price": "623.12",
                "high_price": "674.12",
                "low_price": "619.12",
                "last_tick_time": 1605509068000001,
                "last_tick_seq": 1605509068000001,
                "transactions_number": "12345.6",
            },
        ]
    }    
}
PreviousHeartbeatNextOpen API

Last updated 9 months ago