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

# Perpetual Contract Snapshot



## OpenAPI

````yaml openapi.json GET /gateway/v1/exchange/perp
openapi: 3.1.0
info:
  title: Hermod
  version: 0.0.1
servers:
  - url: https://api.asksurf.ai
security: []
paths:
  /gateway/v1/exchange/perp:
    get:
      tags:
        - Exchange
      summary: Exchange Perpetual Contract Snapshot
      description: >-
        Returns a combined snapshot of perpetual contract data for a pair.


        **Available fields** (via `fields`):

        - `funding` — current funding rate, next settlement, mark/index price

        - `oi` — open interest in contracts and USD


        Just pass the base pair (e.g. `pair=BTC/USDT`). The `:USDT` swap suffix
        is added automatically.
      operationId: exchange-perp
      parameters:
        - description: >-
            Trading pair (e.g. BTC/USDT). The swap suffix ':USDT' is added
            automatically.
          explode: false
          in: query
          name: pair
          required: true
          schema:
            description: >-
              Trading pair (e.g. BTC/USDT). The swap suffix ':USDT' is added
              automatically.
            examples:
              - BTC/USDT
            type: string
        - description: >-
            Comma-separated fields to include: 'funding' (current funding rate),
            'oi' (open interest). Defaults to all fields.
          explode: false
          in: query
          name: fields
          schema:
            default: funding,oi
            description: >-
              Comma-separated fields to include: 'funding' (current funding
              rate), 'oi' (open interest). Defaults to all fields.
            examples:
              - funding,oi
            type: string
        - description: Exchange identifier
          explode: false
          in: query
          name: exchange
          schema:
            default: binance
            description: Exchange identifier
            enum:
              - binance
              - okx
              - bybit
              - bitget
              - htx
              - bitfinex
              - bitmex
            examples:
              - binance
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataObjectResponseExchangePerpResponse'
          description: OK
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataAPIError'
          description: Error
      security:
        - AccessToken: []
components:
  schemas:
    DataObjectResponseExchangePerpResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - >-
              https://example.com/schemas/DataObjectResponseExchangePerpResponse.json
          format: uri
          readOnly: true
          type: string
        data:
          $ref: '#/components/schemas/ExchangePerpResponse'
        meta:
          $ref: '#/components/schemas/ObjectResponseMeta'
      required:
        - data
        - meta
      type: object
    DataAPIError:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - https://example.com/schemas/DataAPIError.json
          format: uri
          readOnly: true
          type: string
        error:
          $ref: '#/components/schemas/DataAPIErrorDetail'
      required:
        - error
      type: object
    ExchangePerpResponse:
      additionalProperties: false
      properties:
        exchange:
          description: Exchange identifier
          type: string
        funding:
          $ref: '#/components/schemas/ExchangeFundingItem'
          description: Current funding rate data; null when not requested
        open_interest:
          $ref: '#/components/schemas/ExchangeOpenInterestItem'
          description: Current open interest data; null when not requested
        pair:
          description: Perpetual contract pair like BTC/USDT
          type: string
      required:
        - exchange
        - pair
        - funding
        - open_interest
      type: object
    ObjectResponseMeta:
      additionalProperties: false
      properties:
        cached:
          description: Whether this response was served from cache
          type: boolean
        credits_used:
          description: Credits deducted for this request
          format: int64
          type: integer
      required:
        - credits_used
        - cached
      type: object
    DataAPIErrorDetail:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    ExchangeFundingItem:
      additionalProperties: false
      properties:
        exchange:
          description: Exchange identifier
          type: string
        funding_rate:
          description: Current funding rate (0.0001 = 0.01%)
          format: double
          type:
            - number
            - 'null'
        index_price:
          description: >-
            Index price derived from the weighted average of spot prices across
            multiple exchanges
          format: double
          type:
            - number
            - 'null'
        interval:
          description: Funding interval like 8h
          type:
            - string
            - 'null'
        mark_price:
          description: >-
            Mark price calculated by the exchange from the index price and
            funding rate, used as the reference for liquidations
          format: double
          type:
            - number
            - 'null'
        next_funding:
          description: Next settlement time ISO8601
          type:
            - string
            - 'null'
        pair:
          description: Perpetual contract pair like BTC/USDT
          type: string
      required:
        - exchange
        - pair
        - funding_rate
        - next_funding
        - mark_price
        - index_price
        - interval
      type: object
    ExchangeOpenInterestItem:
      additionalProperties: false
      properties:
        exchange:
          description: Exchange identifier
          type: string
        open_interest_amount:
          description: Open interest in contracts
          format: double
          type:
            - number
            - 'null'
        open_interest_usd:
          description: Open interest in USD
          format: double
          type:
            - number
            - 'null'
        pair:
          description: Trading pair like BTC/USDT
          type: string
        timestamp:
          description: Unix timestamp in seconds
          format: int64
          type:
            - integer
            - 'null'
      required:
        - exchange
        - pair
        - open_interest_amount
        - open_interest_usd
        - timestamp
      type: object

````