Upstox Market Holidays and Timings API

The Market Holidays and Timings API from Upstox — 13 operation(s) for market holidays and timings.

Operations 13

GET /v2/market/timings/{date} Get Exchange Timings on particular date #
GET /v2/market/status/{exchange} Get Market status for particular exchange #
GET /v2/market/smartlist/options Get Smartlist Options #
GET /v2/market/smartlist/mtf Get Smartlist MTF #
GET /v2/market/smartlist/futures Get Smartlist Futures #
GET /v2/market/pcr Get PCR Data #
GET /v2/market/oi Get OI Data #
GET /v2/market/max-pain Get Max Pain Data #
GET /v2/market/holidays Get Holiday list of current year #
GET /v2/market/holidays/{date} Get Holiday on particular date #
GET /v2/market/fii Get FII Data #
GET /v2/market/dii Get DII Data #
GET /v2/market/change-oi Get Change in OI Data #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/upstox-market-holidays-and-timings-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

upstox-market-holidays-and-timings-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenAPI definition Market Holidays and Timings API
  version: v0
servers:
- url: https://api-v2.upstox.com
tags:
- name: Market Holidays and Timings
paths:
  /v2/market/timings/{date}:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Exchange Timings on particular date
      description: This API provides the functionality to retrieve the exchange timings on particular date
      operationId: getExchangeTimings
      parameters:
      - name: date
        in: path
        required: true
        schema:
          type: string
          pattern: ^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetExchangeTimingResponse'
  /v2/market/status/{exchange}:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Market status for particular exchange
      description: This API provides the functionality to retrieve the market status for particular exchange
      operationId: getMarketStatus
      parameters:
      - name: exchange
        in: path
        required: true
        schema:
          type: string
          pattern: ^(\s*|(?:NSE|NFO|CDS|BSE|BFO|BCD|MCX|NSCOM)+)$
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetMarketStatusResponse'
      security:
      - OAUTH2: []
  /v2/market/smartlist/options:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Smartlist Options
      description: Fetches the smartlist of options for the given asset type and category.
      operationId: getSmartlistOptions
      parameters:
      - name: asset_type
        in: query
        description: 'Asset type. Allowed values: INDEX, STOCK, COMMODITY'
        required: false
        schema:
          type: string
        example: INDEX
      - name: category
        in: query
        description: 'Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, IV_GAINERS, IV_LOSERS, UNDER_5000, UNDER_10000 (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS)'
        required: false
        schema:
          type: string
        example: TOP_TRADED
      - name: page_number
        in: query
        description: Page number (optional, 1-indexed)
        required: false
        schema:
          type: integer
          format: int32
        example: 1
      - name: page_size
        in: query
        description: Page size (optional, max 50)
        required: false
        schema:
          type: integer
          format: int32
        example: 20
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI1212 - Invalid asset_type.<br>UDAPI1213 - Invalid category for the given asset_type.<br>UDAPI1214 - Invalid page_size. Maximum allowed value is 50.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/smartlist/mtf:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Smartlist MTF
      description: Fetches the smartlist of MTF (Margin Trade Funding) stocks. Prices are enriched with live LTP data.
      operationId: getSmartlistMtf
      parameters:
      - name: page_number
        in: query
        description: Page number (optional, 1-indexed)
        required: false
        schema:
          type: integer
          format: int32
        example: 1
      - name: page_size
        in: query
        description: Page size (optional, max 50)
        required: false
        schema:
          type: integer
          format: int32
        example: 20
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI1214 - Invalid page_size. Maximum allowed value is 50.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/smartlist/futures:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Smartlist Futures
      description: Fetches the smartlist of futures for the given asset type and category.
      operationId: getSmartlistFutures
      parameters:
      - name: asset_type
        in: query
        description: 'Asset type. Allowed values: INDEX, STOCK, COMMODITY'
        required: false
        schema:
          type: string
        example: INDEX
      - name: category
        in: query
        description: 'Category. Allowed values: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS, PRICE_GAINERS, PRICE_LOSERS, PREMIUM, DISCOUNT (COMMODITY supports only: TOP_TRADED, MOST_ACTIVE, OI_GAINERS, OI_LOSERS)'
        required: false
        schema:
          type: string
        example: TOP_TRADED
      - name: page_number
        in: query
        description: Page number (optional, 1-indexed)
        required: false
        schema:
          type: integer
          format: int32
        example: 1
      - name: page_size
        in: query
        description: Page size (optional, max 50)
        required: false
        schema:
          type: integer
          format: int32
        example: 20
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI1212 - Invalid asset_type.<br>UDAPI1213 - Invalid category for the given asset_type.<br>UDAPI1214 - Invalid page_size. Maximum allowed value is 50.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/pcr:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get PCR Data
      description: Fetches PCR (Put-Call Ratio) data for the given instrument key, expiry, date and bucket interval.
      operationId: getPcrData
      parameters:
      - name: instrument_key
        in: query
        description: Underlying asset instrument key
        required: true
        schema:
          type: string
        example: NSE_INDEX|Nifty 50
      - name: expiry
        in: query
        description: Expiry date in YYYY-MM-DD format
        required: true
        schema:
          type: string
        example: '2026-05-19'
      - name: date
        in: query
        description: Date in YYYY-MM-DD format for which PCR data is required
        required: true
        schema:
          type: string
        example: '2026-05-06'
      - name: bucket_interval
        in: query
        description: Bucket interval in minutes for the insights list
        required: true
        schema:
          type: integer
          format: int32
        example: 15
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI100011 - Invalid instrument_key.<br>UDAPI1202 - Invalid expiry format.<br>UDAPI1203 - Invalid date format.<br>UDAPI1205 - Invalid bucket_interval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/oi:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get OI Data
      description: Fetches OI data for the given instrument key, expiry and date.
      operationId: getOiData
      parameters:
      - name: instrument_key
        in: query
        description: Underlying asset instrument key
        required: true
        schema:
          type: string
        example: NSE_INDEX|Nifty 50
      - name: expiry
        in: query
        description: Expiry date in YYYY-MM-DD format
        required: true
        schema:
          type: string
        example: '2026-05-19'
      - name: date
        in: query
        description: Date in YYYY-MM-DD format for which OI data is required
        required: true
        schema:
          type: string
        example: '2026-05-06'
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI100011 - Invalid instrument_key.<br>UDAPI1202 - Invalid expiry format.<br>UDAPI1203 - Invalid date format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/max-pain:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Max Pain Data
      description: Fetches Max Pain data for the given instrument key, expiry, date and bucket interval.
      operationId: getMaxPainData
      parameters:
      - name: instrument_key
        in: query
        description: Underlying asset instrument key
        required: true
        schema:
          type: string
        example: NSE_INDEX|Nifty 50
      - name: expiry
        in: query
        description: Expiry date in YYYY-MM-DD format
        required: true
        schema:
          type: string
        example: '2026-05-19'
      - name: date
        in: query
        description: Date in YYYY-MM-DD format for which Max Pain data is required
        required: true
        schema:
          type: string
        example: '2026-05-06'
      - name: bucket_interval
        in: query
        description: Bucket interval in minutes for the insights list
        required: true
        schema:
          type: integer
          format: int32
        example: 15
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI100011 - Invalid instrument_key.<br>UDAPI1202 - Invalid expiry format.<br>UDAPI1203 - Invalid date format.<br>UDAPI1205 - Invalid bucket_interval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/holidays:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Holiday list of current year
      description: This API provides the functionality to retrieve the holiday list of current year
      operationId: getHolidays
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetHolidayResponse'
  /v2/market/holidays/{date}:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Holiday on particular date
      description: This API provides the functionality to retrieve the holiday on particular date
      operationId: getHoliday
      parameters:
      - name: date
        in: path
        required: true
        schema:
          type: string
          pattern: ^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetHolidayResponse'
  /v2/market/fii:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get FII Data
      description: Fetches FII activity data for the given data type and interval.
      operationId: getFiiData
      parameters:
      - name: data_type
        in: query
        description: 'Data type. Allowed values: NSE_FO|INDEX_FUTURES, NSE_FO|STOCK_FUTURES, NSE_FO|INDEX_OPTIONS, NSE_FO|STOCK_OPTIONS, NSE_EQ|CASH'
        required: true
        schema:
          type: string
        example: NSE_FO|INDEX_FUTURES
      - name: interval
        in: query
        description: 'Interval. Allowed values: 1D, 1M'
        required: true
        schema:
          type: string
        example: 1D
      - name: from
        in: query
        description: Start date in YYYY-MM-DD format (optional)
        required: false
        schema:
          type: string
        example: '2024-01-01'
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI1198 - Invalid data_type.<br>UDAPI1199 - Invalid interval.<br>UDAPI1200 - Invalid from date format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/dii:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get DII Data
      description: Fetches DII activity data for the given interval.
      operationId: getDiiData
      parameters:
      - name: data_type
        in: query
        description: 'Data type. Allowed value: NSE_EQ|CASH'
        required: true
        schema:
          type: string
        example: NSE_EQ|CASH
      - name: interval
        in: query
        description: 'Interval. Allowed values: 1D, 1M'
        required: true
        schema:
          type: string
        example: 1D
      - name: from
        in: query
        description: Start date in YYYY-MM-DD format (optional)
        required: false
        schema:
          type: string
        example: '2024-01-01'
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: 'UDAPI1198 - Invalid data_type. Allowed value: NSE_EQ|CASH.<br>UDAPI1199 - Invalid interval.<br>UDAPI1200 - Invalid from date format.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
          description: Too Many Requests
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '200':
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsResponse'
        '401':
          description: Authorization Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
      security:
      - OAUTH2: []
  /v2/market/change-oi:
    get:
      tags:
      - Market Holidays and Timings
      summary: Get Change in OI Data
      description: Fetches change in OI data for the given instrument key, expiry, date and interval.
      operationId: getChangeOiData
      parameters:
      - name: instrument_key
        in: query
        description: Underlying asset instrument key
        required: true
        schema:
          type: string
        example: NSE_INDEX|Nifty 50
      - name: expiry
        in: query
        description: Expiry date in YYYY-MM-DD format
        required: true
        schema:
          type: string
        example: '2026-05-19'
      - name: date
        in: query
        description: Date in YYYY-MM-DD format for which change OI data is required
        required: true
        schema:
          type: string
        example: '2026-05-06'
      - name: interval
        in: query
        description: Number of days for which difference in OI is required
        required: true
        schema:
          type: integer
          format: int32
        example: 2
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: UDAPI100011 - Invalid instrument_key.<br>UDAPI1202 - Invalid expiry format.<br>UDAPI1203 - Invalid date format.<br>UDAPI1204 - Invalid interval.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '500':
          description: Internal Server Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '423':
          description: Locked
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '429':
        

# --- truncated at 32 KB (36 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/upstox/refs/heads/main/openapi/upstox-market-holidays-and-timings-api-openapi.yml