> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cryptoquant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Exchange Swap Funding Rate

> Perpetual-swap funding rate — the periodic payment between long and short positions that anchors the perpetual price to the spot index. Positive = longs pay shorts (bullish leverage); negative = shorts pay longs.

## What it measures

Perpetual-swap funding rate — the periodic payment between long and short positions that anchors the perpetual price to the spot index. Positive = longs pay shorts (bullish leverage); negative = shorts pay longs.

This endpoint serves **exchange swap** data — per-exchange, per-quote pairs (e.g. `btc_usdt`).

Use `inverse=true` for coin-margined contracts; the default `false` returns linear (USDⓈ-margined) contracts.

<Note>This endpoint is dual-class: pass a per-quote symbol like `btc_usdt` for a single pair, or an aggregated `btc_all` symbol to get that exchange's all-quote aggregate (still that one exchange — not the cross-exchange `cq` aggregate).</Note>


## OpenAPI

````yaml openapi/v2-market.json GET /market/exchange/swap/funding-rate
openapi: 3.0.0
info:
  version: 2.0.0-beta
  title: CryptoQuant Data API v2 — Market
  description: >-
    Market data endpoints of the CryptoQuant Data API v2 — exchange-level and
    CryptoQuant-aggregated spot & derivatives data (OHLCV, trade, funding rate,
    open interest, liquidation). Built on the v1 conventions: the
    `status`/`result` envelope, Bearer token authentication, and the
    `window`/`from`/`to` time parameters.
  termsOfService: https://cryptoquant.com/terms-of-service
  contact:
    name: API Support
    email: contact@cryptoquant.com
servers:
  - url: https://api.cryptoquant.com/v2
    description: Default server
security: []
tags:
  - name: Market Data
  - name: Market Discovery
paths:
  /market/exchange/swap/funding-rate:
    get:
      tags:
        - Market Data
      summary: Exchange Swap Funding Rate
      description: >-
        Perpetual-swap funding rate — the periodic payment between long and
        short positions that anchors the perpetual price to the spot index.
        Positive = longs pay shorts (bullish leverage); negative = shorts pay
        longs.
      operationId: V2marketExchangeSwapFundingRate
      parameters:
        - name: exchange
          in: query
          required: true
          description: >-
            Exchange name, e.g. `binance`. List active exchanges via
            `/market/info/exchanges`.
          schema:
            type: string
          example: binance
        - name: symbol
          in: query
          required: true
          description: >-
            Trading pair. Per-quote (`btc_usdt`) and aggregated all-quote
            (`btc_all`) symbols are both accepted — `btc_all` returns the
            exchange-level all-quote aggregate.
          schema:
            type: string
          example: btc_usdt
        - name: inverse
          in: query
          required: false
          description: >-
            Return inverse (coin-margined) contracts. `true` or `false`;
            defaults to `false` (linear). Swap only.
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
        - name: window
          in: query
          required: false
          description: 'Aggregation window: `day` (default), `hour`, `10min`, or `min`.'
          schema:
            type: string
            enum:
              - day
              - hour
              - 10min
              - min
            default: day
          example: day
        - name: from
          in: query
          required: false
          description: >-
            Inclusive start time, `YYYYMMDDTHHMMSS` (UTC). If `window=day`,
            `YYYYMMDD` is also accepted.
          schema:
            type: string
        - name: to
          in: query
          required: false
          description: >-
            Inclusive end time, `YYYYMMDDTHHMMSS` (UTC). If `window=day`,
            `YYYYMMDD` is also accepted.
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: Maximum rows returned (default 100, max 10000).
          schema:
            type: integer
            default: 100
            maximum: 10000
        - name: format
          in: query
          required: false
          description: 'Response format: `json` (default) or `csv`.'
          schema:
            type: string
            enum:
              - json
              - csv
            default: json
      responses:
        '200':
          description: Exchange Swap Funding Rate time-series.
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - result
                properties:
                  status:
                    $ref: '#/components/schemas/Status'
                  result:
                    type: object
                    properties:
                      window:
                        type: string
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            datetime:
                              type: string
                              description: >-
                                Interval start timestamp, `YYYY-MM-DD HH:MM:SS`
                                (UTC).
                            symbol:
                              type: string
                              description: >-
                                Trading pair. Exchange origin uses per-quote
                                pairs (e.g. `btc_usdt`); cq origin uses
                                aggregated symbols (e.g. `btc_all`).
                            inverse:
                              type: boolean
                              description: >-
                                Whether the contract is inverse (coin-margined).
                                `false` = linear (default).
                            base:
                              type: string
                              description: Base asset, e.g. `btc`.
                            quote:
                              type: string
                              description: >-
                                Quote asset, e.g. `usdt`. `all` for aggregated
                                (all-quote) symbols.
                            funding_rate:
                              type: number
                              description: Perpetual funding rate for the interval.
      security:
        - AccessToken: []
      x-codeSamples:
        - lang: Shell
          source: >-
            curl -X GET
            "https://api.cryptoquant.com/v2/market/exchange/swap/funding-rate?exchange=binance&symbol=btc_usdt&window=day"
            \

            -H "Authorization: Bearer <YOUR_API_KEY>"
        - lang: JavaScript
          source: >-
            fetch("https://api.cryptoquant.com/v2/market/exchange/swap/funding-rate?exchange=binance&symbol=btc_usdt&window=day",
            { headers: { "Authorization": "Bearer <YOUR_API_KEY>"} })
              .then(response => response.json())
              .then(data => console.log(data))
        - lang: NodeJS
          source: |-
            require('axios')
              .get("https://api.cryptoquant.com/v2/market/exchange/swap/funding-rate?exchange=binance&symbol=btc_usdt&window=day", { headers: { Authorization: 'Bearer <YOUR_API_KEY>' } })
              .then(response => console.log(response))
        - lang: Ruby
          source: >-
            require 'net/http'

            uri =
            URI("https://api.cryptoquant.com/v2/market/exchange/swap/funding-rate?exchange=binance&symbol=btc_usdt&window=day")

            req = Net::HTTP::Get.new(uri)

            req["Authorization"] = "Bearer <YOUR_API_KEY>"

            res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) {
            |http| http.request(req) }

            puts res.body
        - lang: Python
          source: >-
            import requests

            headers = {'Authorization': 'Bearer <YOUR_API_KEY>'}

            url =
            "https://api.cryptoquant.com/v2/market/exchange/swap/funding-rate?exchange=binance&symbol=btc_usdt&window=day"

            print(requests.get(url, headers=headers).json())
components:
  schemas:
    Status:
      type: object
      description: >-
        Returned with every response; indicates whether the request was
        successful.
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: HTTP status code.
        message:
          type: string
          description: Text description of the error or success.
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        For each API request, include the `Authorization` HTTP header with
        `Bearer {access_token}`.

````