Upstox Websocket API

The Websocket API from Upstox — 4 operation(s) for websocket.

Operations 4

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v2/feed/portfolio-stream-feed Connect to the portfolio updates stream · Portfolio Stream Feed #
Ask an LLM
“How do I get real-time order and position updates pushed to my app?”
“Can I be redirected straight to the portfolio WebSocket?”
Tell an agent
Connect me to the portfolio update stream.
Open the portfolio WebSocket for update types {update_types}.
GET /v2/feed/portfolio-stream-feed/authorize Get the authorized portfolio stream URL · Portfolio Stream Feed Authorize #
Ask an LLM
“Where do I get the authorized socket URI for portfolio updates?”
“Can I fetch the portfolio feed URL for my own WebSocket client instead of following a redirect?”
Tell an agent
Get the authorized portfolio feed URI.
Return the portfolio socket URL for {update_types} updates.
GET /v2/feed/market-data-feed Connect to the live market data stream · Market Data Feed #
Ask an LLM
“How do I stream live ticks for stocks over a WebSocket?”
“Which endpoint redirects me to the market data socket?”
Tell an agent
Connect me to the live market data feed.
Redirect to the market data WebSocket so I can stream prices.
GET /v2/feed/market-data-feed/authorize Get the authorized market data stream URL · Market Data Feed Authorize #
Ask an LLM
“Where do I get the authorized socket URI for market data?”
“Can I obtain the market feed URL to connect my own WebSocket client?”
Tell an agent
Get the authorized market data feed URI.
Return the socket URL I should use for live market 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:upstox-websocket-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-websocket-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenAPI definition WebSocket API
  version: v0
servers:
- url: https://api-v2.upstox.com
tags:
- name: Websocket
paths:
  /v2/feed/portfolio-stream-feed:
    get:
      tags:
      - Websocket
      summary: Portfolio Stream Feed
      description: This API redirects the client to the respective socket endpoint to receive Portfolio updates.
      operationId: getPortfolioStreamFeed
      parameters:
      - name: update_types
        in: query
        description: Identifiers separated by commas denote the types of updates to receive.
        required: false
        schema:
          type: string
          pattern: ^(order|gtt_order|position|holding)(,(order|gtt_order|position|holding))*$
        example: order,gtt_order,position,holding
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              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'
        '302':
          description: Location for authorized access of portfolio stream feed
      security:
      - OAUTH2: []
  /v2/feed/portfolio-stream-feed/authorize:
    get:
      tags:
      - Websocket
      summary: Portfolio Stream Feed Authorize
      description: This API provides the functionality to retrieve the socket endpoint URI for Portfolio updates.
      operationId: getPortfolioStreamFeedAuthorize
      parameters:
      - name: update_types
        in: query
        description: Identifiers separated by commas denote the types of updates to receive.
        required: false
        schema:
          type: string
          pattern: ^(order|gtt_order|position|holding)(,(order|gtt_order|position|holding))*$
        example: order,gtt_order,position,holding
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              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/WebsocketAuthRedirectResponse'
      security:
      - OAUTH2: []
  /v2/feed/market-data-feed:
    get:
      tags:
      - Websocket
      summary: Market Data Feed
      description: This API redirects the client to the respective socket endpoint to receive Market updates.
      operationId: getMarketDataFeed
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              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'
        '302':
          description: Location for authorized access of market data feed
      security:
      - OAUTH2: []
  /v2/feed/market-data-feed/authorize:
    get:
      tags:
      - Websocket
      summary: Market Data Feed Authorize
      description: This API provides the functionality to retrieve the socket endpoint URI for Market updates.
      operationId: getMarketDataFeedAuthorize
      responses:
        '405':
          description: Method Not Allowed
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ApiGatewayErrorResponse'
        '400':
          description: Bad Request
          content:
            '*/*':
              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/WebsocketAuthRedirectResponse'
      security:
      - OAUTH2: []
components:
  schemas:
    Problem:
      type: object
      properties:
        errorCode:
          type: string
          deprecated: true
          description: Unique code for the error state
        message:
          type: string
          description: Verbose message for the error state
        propertyPath:
          type: string
          deprecated: true
          description: Path to property failing validation
        invalidValue:
          deprecated: true
          description: Invalid value for the property failing validation
        error_code:
          type: string
        property_path:
          type: string
        invalid_value: {}
    WebsocketAuthRedirectResponse:
      type: object
      properties:
        status:
          type: string
          enum:
          - success
          - error
          - partial_success
        data:
          $ref: '#/components/schemas/WebsocketAuthRedirectResponseData'
          description: Response data for WebsocketAuthRedirectResponse
    WebsocketAuthRedirectResponseData:
      type: object
      properties:
        authorizedRedirectUri:
          type: string
          deprecated: true
        authorized_redirect_uri:
          type: string
    ApiGatewayErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
          - success
          - error
          - partial_success
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    OAUTH2:
      type: oauth2
      scheme: BEARER
      flows:
        authorizationCode:
          authorizationUrl: https://api-v2.upstox.com/v2/login/authorization/dialog
          tokenUrl: https://api-v2.upstox.com/v2/login/authorization/token
          scopes:
            read: Read access
            write: Write access
x-provenance:
  method: harvested
  publisher: Upstox
  source: https://api-v2.upstox.com/api-docs
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)