whatisgithub

What is upstox-python-data?

barathgb007/upstox-python-data — explained in plain English

Analysis updated 2026-05-18

18PythonAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Python toolkit for pulling live and historical Indian stock market data from Upstox, including options data and a simulated paper trading broker.

Mindmap

mindmap
  root((Upstox Python Data))
    What it does
      NSE market data wrapper
      REST and WebSocket access
      Options and index data
    Tech stack
      Python
      Upstox API
      WebSocket protobuf
    Use cases
      Live tick streaming
      Option chain analysis
      Paper trading simulation
    Audience
      Algo traders
      Python developers
      Finance hobbyists
    Modules
      REST data layer
      WebSocket streamer
      Paper broker
      Cost calculator

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Fetch live spot prices, option chains, and historical candles for NIFTY, BANKNIFTY, and other NSE instruments.

USE CASE 2

Stream real time price ticks and option Greeks over WebSocket for a trading strategy.

USE CASE 3

Test a trading strategy with a simulated paper broker that models realistic slippage and Indian market fees.

USE CASE 4

Build sentiment based filters using India VIX, put call ratio, and foreign investor activity data.

What is it built with?

PythonUpstox APIWebSocketprotobuf

How does it compare?

barathgb007/upstox-python-data1038lab/comfyui-agnes-aiandyuneducated/resolve-ai
Stars181818
LanguagePythonPythonPython
Setup difficultymoderateeasyhard
Complexity3/52/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires an Upstox developer account and a long-lived analytics access token for market data.

So what is it?

This project is a Python toolkit for pulling stock market data from Upstox, an Indian brokerage, specifically for NSE indices like NIFTY and BANKNIFTY and their futures and options contracts. The author built it for their own algorithmic trading project and shared it after noticing many people in an online community struggling just to get clean price data working. The toolkit is organized into several files, each handling a different job. One file wraps Upstox's REST API to fetch spot prices, option chains, historical candles, India VIX values, and figures like foreign and domestic investor activity. Another file handles a live WebSocket connection for real time price ticks, order book depth, and option Greeks such as delta and theta. A background poller keeps a constantly updated cache of prices and can detect sudden price spikes. There is also a simulated paper trading broker that models realistic costs, including brokerage, taxes, and slippage from bid ask spreads, so a strategy can be tested without risking real money. Setup requires creating a developer account with Upstox, generating an access token for market data, and installing the Python dependencies listed in the project. The README includes runnable example scripts for each major feature, such as fetching an option chain, streaming live ticks, or running a simulated trade. It also shows how to extend the toolkit to individual stocks beyond the built in indices by adding their instrument codes. This project is aimed at developers and traders building their own trading strategies in Python who need a working data layer for the Indian stock market, and it assumes basic familiarity with financial terms like options, open interest, and put call ratios.

Copy-paste prompts

Prompt 1
Help me set up an Upstox developer account and access token so I can use this Python market data toolkit.
Prompt 2
Show me how to fetch a NIFTY option chain and print the at the money strike using this project's functions.
Prompt 3
Walk me through subscribing to live WebSocket ticks for BANKNIFTY using MarketStreamer.
Prompt 4
Help me add a new stock like RELIANCE to the INSTRUMENT_KEYS dictionary so I can pull its data too.

Frequently asked questions

What is upstox-python-data?

A Python toolkit for pulling live and historical Indian stock market data from Upstox, including options data and a simulated paper trading broker.

What language is upstox-python-data written in?

Mainly Python. The stack also includes Python, Upstox API, WebSocket.

How hard is upstox-python-data to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is upstox-python-data for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.