---
updatedAt: 2025-04-24T10:26:53.000Z
agentTools:
  projectIndex: https://docs.coinglass.com/v4.0-zh/llms.txt
---

# 交易对主动买卖历史

该接口提供现货市场中交易对的主动买入与卖出成交量的历史数据

***该接口以下API等级可用：*** [API 等级](https://www.coinglass.com/zh/pricing)：

| API 等级 | 爱好版    | 创业版      | 标准版 | 专业版 | 企业版 |
| :----- | :----- | :------- | :-- | :-- | :-- |
| 可用性    | ✅      | ✅        | ✅   | ✅   | ✅   |
| 颗粒度    | `>=4h` | ​`>=30m` | 无限制 | 无限制 | 无限制 |

### 响应数据

```json
{
  "code": "0",
  "msg": "success",
  "data": [
    {
      "time": 1741622400000, // 时间戳（毫秒）
      "taker_buy_volume_usd": "10551.033", // 主动买入成交量（美元）
      "taker_sell_volume_usd": "11308" // 主动卖出成交量（美元）
    },
    {
      "time": 1741626000000,
      "taker_buy_volume_usd": "15484.245",
      "taker_sell_volume_usd": "16316.118"
    },
    {
      "time": 1741629600000,
      "taker_buy_volume_usd": "20340.501",
      "taker_sell_volume_usd": "18977.660"
    }
  ]
}

```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "coinglass",
    "version": "3.0"
  },
  "servers": [
    {
      "url": "https://open-api-v4.coinglass.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "CG-API-KEY"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/spot/taker-buy-sell-volume/history": {
      "get": {
        "summary": "Taker Buy/Sell History",
        "description": "This API retrieves historical data for the long/short ratio of taker buy/sell volumes.",
        "operationId": "spot-taker-buysell-ratio-history",
        "parameters": [
          {
            "name": "exchange",
            "in": "query",
            "required": true,
            "description": "交易所名称（例如：Binance、OKX）。可通过 support-exchange-pair 接口获取支持的交易所列表。",
            "schema": {
              "type": "string",
              "default": "Binance"
            }
          },
          {
            "name": "symbol",
            "in": "query",
            "required": true,
            "description": "交易对（例如：BTCUSDT）。可通过 support-exchange-pair 接口获取支持的交易对列表。",
            "schema": {
              "type": "string",
              "default": "BTCUSDT"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": true,
            "description": "数据的时间间隔。支持的取值包括：1m、3m、5m、15m、30m、1h、4h、6h、8h、12h、1d、1w。",
            "schema": {
              "type": "string",
              "default": "4h"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "每次请求返回的数据条数。默认值为 1000，最大值为 1000。",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": "10"
            }
          },
          {
            "name": "start_time",
            "in": "query",
            "required": false,
            "description": "开始时间戳（毫秒）（例如：1641522717000）。",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          },
          {
            "name": "end_time",
            "in": "query",
            "required": false,
            "description": "结束时间戳（毫秒）（例如：1641522717000）。",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": ""
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"code\": \"0\",\n  \"msg\": \"success\",\n  \"data\": [\n    {\n      \"time\": 1741622400000, // 时间戳（毫秒）\n      \"taker_buy_volume_usd\": \"10551.033\", // 主动买入成交量（美元）\n      \"taker_sell_volume_usd\": \"11308\" // 主动卖出成交量（美元）\n    },\n    {\n      \"time\": 1741626000000,\n      \"taker_buy_volume_usd\": \"15484.245\",\n      \"taker_sell_volume_usd\": \"16316.118\"\n    },\n    {\n      \"time\": 1741629600000,\n      \"taker_buy_volume_usd\": \"20340.501\",\n      \"taker_sell_volume_usd\": \"18977.660\"\n    }\n  ]\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```