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

# Get Open Interest History

> Get open interest over time



## OpenAPI

````yaml /api-specs/public-rest-unified.json get /stats/api/v1/open_interest_history
openapi: 3.1.0
info:
  title: DerivaDEX API Documentation
  version: '1.0'
  description: ''
servers:
  - url: https://testnet.derivadex.io
    description: DerivaDEX testnet
security: []
tags:
  - name: Venue-Wide Tables
    description: These APIs expose venue-wide public tables and reference data.
    x-source-api: Public REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public REST API
  - name: Trade
    description: These APIs provide data for a particular trader.
    x-source-api: Public Exchange REST API
  - name: Market
    description: These APIs return key high level metrics for markets.
    x-source-api: Public Exchange REST API
  - name: System
    description: These APIs return system info.
    x-source-api: Public Exchange REST API
paths:
  /stats/api/v1/open_interest_history:
    get:
      tags:
        - Market
      summary: Get Open Interest History
      description: Get open interest over time
      parameters:
        - in: query
          name: limit
          schema:
            type: integer
            default: 500
          description: The number of rows to return
        - in: query
          name: order
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
          description: The ordering of the results.
        - in: query
          name: symbol
          schema:
            type: string
          description: The symbol
          example: ETHP
        - in: query
          name: interval
          schema:
            type: string
            enum:
              - 5m
              - 1h
              - 1d
            default: 1d
          description: The interval for open interest history.
        - in: query
          name: since
          schema:
            type: integer
          description: >-
            The earliest time in seconds to fetch rows for. This param cannot be
            used together with param order = 'desc'
          example: 1678396827
      responses:
        '200':
          description: Open Interest History Data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenInterestHistoryAPISuccessResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
        '500':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsAPIErrorResponse'
components:
  schemas:
    OpenInterestHistoryAPISuccessResponse:
      type: object
      additionalProperties: false
      properties:
        value:
          type: array
          items:
            type: object
            properties:
              symbol:
                type: string
                description: The symbol of the market.
                examples:
                  - BTCP
              amount:
                type: string
                description: The amount of open interest for the given market.
                examples:
                  - '1000'
              createdAt:
                type: string
                format: date-time
                description: The time when this row was added to the database.
                examples:
                  - '2023-01-06T16:37:27.929Z'
            required:
              - symbol
              - amount
              - createdAt
            additionalProperties: false
            description: A entry representing open interest data in a market.
          description: The value of the response
        success:
          type: boolean
          const: true
          description: Whether the request was successful
        timestamp:
          type: number
          description: The timestamp of the response
          examples:
            - 1673031089
      required:
        - success
        - timestamp
        - value
      description: Successful response for the Open Interest History API
    StatsAPIErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          const: false
        errorMsg:
          anyOf:
            - type: string
            - type: array
              items:
                type: object
                additionalProperties: false
      required:
        - success
      additionalProperties: false

````