---
agentTools:
  projectIndex: https://itick.readme.io/llms.txt
---

# Candlestick Query

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "REST API",
    "description": "Stock API, Foreign Exchange API, Index API. \nSupport real-time and historical data for stocks in major markets (such as the United States, Hong Kong, China, Singapore, Japan, etc.), global foreign exchange, indices, and cryptocurrencies. The interface style is standard and easy to use, with concise documentation and a rich variety of examples to help developers quickly integrate. Provide long-term free real-time quote data and historical candlestick charts and other financial data for Stock API, Foreign Exchange API, Index API, and Cryptocurrency API.",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "Crypto"
    }
  ],
  "paths": {
    "/crypto/kline": {
      "get": {
        "summary": "Candlestick Query",
        "deprecated": false,
        "description": "",
        "tags": [
          "Crypto",
          "Crypto"
        ],
        "parameters": [
          {
            "name": "region",
            "in": "query",
            "description": "Market Code",
            "required": true,
            "schema": {
              "type": "string",
              "default": "ba"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "Product Code",
            "required": true,
            "schema": {
              "type": "string",
              "default": "BTCUSDT"
            }
          },
          {
            "name": "kType",
            "in": "query",
            "description": "Cycle 1 minute, 2 five minutes, 3 ten minutes, 4 thirty minutes, 5 one hour, 6 two hours, 7 four hours, 8 one day, 9 one week, 10 one month",
            "required": true,
            "schema": {
              "type": "string",
              "default": "1"
            }
          },
          {
            "name": "et",
            "in": "query",
            "description": "Query deadline",
            "required": false,
            "schema": {
              "type": "string",
              "default": "1741239240000"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Query number",
            "required": false,
            "schema": {
              "type": "string",
              "default": "100"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "integer",
                      "description": "Response Code 0: Success"
                    },
                    "msg": {
                      "type": "string",
                      "description": "Exception Information exists when not equal to 0"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tu": {
                            "type": "number",
                            "description": "Transaction Amount"
                          },
                          "c": {
                            "type": "number",
                            "description": "Closing Price of the Candlestick"
                          },
                          "t": {
                            "type": "integer",
                            "description": "Timestamp"
                          },
                          "v": {
                            "type": "integer",
                            "description": "Transaction Volume"
                          },
                          "h": {
                            "type": "number",
                            "description": "Highest Price of the Candlestick"
                          },
                          "l": {
                            "type": "number",
                            "description": "Lowest Price of the Candlestick"
                          },
                          "o": {
                            "type": "number",
                            "description": "Opening Price of the Candlestick"
                          }
                        }
                      },
                      "description": "Response Data"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ],
                  "description": "Return Result"
                },
                "examples": {
                  "1": {
                    "summary": "Successful Example",
                    "description": "",
                    "value": {
                      "code": 0,
                      "msg": null,
                      "data": [
                        {
                          "tu": 7,
                          "c": 1.568,
                          "t": 1729090560000,
                          "v": 4,
                          "h": 1.568,
                          "l": 1.568,
                          "o": 1.568
                        }
                      ]
                    }
                  }
                }
              }
            },
            "headers": {}
          }
        },
        "security": []
      }
    }
  },
  "servers": [
    {
      "url": "https://api.itick.org",
      "description": "正式环境"
    }
  ],
  "security": [],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 37,
      "2": 4,
      "3": 141,
      "4": 49,
      "5": 151,
      "6": 116,
      "7": 0,
      "8": 31,
      "9": 215,
      "10": 251,
      "11": 8
    }
  }
}
```