{
  "id": "surf.exchange.long-short-ratio",
  "object": "tool",
  "name": "Exchange Long/Short Ratio History",
  "summary": "Returns historical long/short ratio for a perpetual contract.",
  "description": "Returns historical long/short ratio for a perpetual contract. Included fields: ratio value, long account percentage, short account percentage. Granularity: interval supports 1h, 4h, 1d. Pagination: use from for start time and limit for result count. For longer history, pass the last returned timestamp as the next from value. Note: not all exchanges support historical queries via from; some only return recent data regardless. Just pass the base pair (e.g. pair=BTC/USDT). For aggregated cross-exchange long/short ratio, see /market/futures.\n\nRaw surf#exchange/long-short-ratio endpoint: input is { body, queryParams, pathParams } as the provider documents them (https://docs.asksurf.ai/data-api/exchange/long-short-ratio).",
  "category": "lookup",
  "hosted_by": "Surf",
  "runtime": "partner",
  "side_effects": false,
  "status": "live",
  "credits": 0,
  "price": null,
  "providers": [
    {
      "id": "surf",
      "name": "Surf",
      "price": null,
      "own_key_only": true
    }
  ],
  "mcp_name": "surf_exchange_long-short-ratio",
  "input_schema": {
    "type": "object",
    "properties": {
      "queryParams": {
        "type": "object",
        "properties": {
          "pair": {
            "type": "string",
            "minLength": 1,
            "description": "Trading pair (e.g. BTC/USDT). Example: BTC/USDT."
          },
          "interval": {
            "default": "1h",
            "type": "string",
            "enum": [
              "1h",
              "4h",
              "1d"
            ],
            "description": "Bucket size for each point in the series: 1h, 4h, or 1d. This endpoint uses interval only; it does NOT accept time_range. Use from + limit to control the window. Example: 1h. Defaults to \"1h\"."
          },
          "from": {
            "type": "string",
            "minLength": 1,
            "description": "Start of time range. Accepts Unix seconds or date string (YYYY-MM-DD, ISO8601). Binance only retains the last 30 days of data; other exchanges may have different limits. Example: 2026-03-01."
          },
          "limit": {
            "default": 50,
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "Max number of records. For longer history, paginate using the last returned timestamp as the next from value. Example: 50. Defaults to 50."
          },
          "exchange": {
            "default": "binance",
            "type": "string",
            "enum": [
              "binance",
              "okx",
              "bybit",
              "bitget"
            ],
            "description": "Exchange identifier. Example: binance. Defaults to \"binance\"."
          }
        },
        "required": [
          "pair"
        ],
        "additionalProperties": false
      }
    },
    "required": [
      "queryParams"
    ],
    "additionalProperties": false
  },
  "kind": "endpoint"
}