Skip to content

Plus apis #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The official Python client for communicating with the <a href="https://upstox.co
Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection.

- API version: v2
- Package version: 2.14.0
- Package version: 2.15.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project.
Expand Down Expand Up @@ -90,9 +90,16 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ChargeApi* | [**get_brokerage**](docs/ChargeApi.md#get_brokerage) | **GET** /v2/charges/brokerage | Brokerage details
*ChargeApi* | [**post_margin**](docs/ChargeApi.md#post_margin) | **POST** /v2/charges/margin | Calculate Margin
*HistoryApi* | [**get_historical_candle_data**](docs/HistoryApi.md#get_historical_candle_data) | **GET** /v2/historical-candle/{instrumentKey}/{interval}/{to_date} | Historical candle data
*HistoryApi* | [**get_historical_candle_data1**](docs/HistoryApi.md#get_historical_candle_data1) | **GET** /v2/historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date} | Historical candle data
*HistoryApi* | [**get_intra_day_candle_data**](docs/HistoryApi.md#get_intra_day_candle_data) | **GET** /v2/historical-candle/intraday/{instrumentKey}/{interval} | Intra day candle data
*ExpiredInstrumentApi* | [**get_expired_future_contracts**](docs/ExpiredInstrumentApi.md#get_expired_future_contracts) | **GET** /v2/expired-instruments/future/contract | Expired instruments - Get future contracts
*ExpiredInstrumentApi* | [**get_expired_historical_candle_data**](docs/ExpiredInstrumentApi.md#get_expired_historical_candle_data) | **GET** /v2/expired-instruments/historical-candle/{expired_instrument_key}/{interval}/{to_date}/{from_date} | Expired Historical candle data
*ExpiredInstrumentApi* | [**get_expired_option_contracts**](docs/ExpiredInstrumentApi.md#get_expired_option_contracts) | **GET** /v2/expired-instruments/option/contract | Get expired option contracts
*ExpiredInstrumentApi* | [**get_expiries**](docs/ExpiredInstrumentApi.md#get_expiries) | **GET** /v2/expired-instruments/expiries | Expired instruments - Get expiries
*HistoryApi* | [**get_historical_candle_data2**](docs/HistoryApi.md#get_historical_candle_data2) | **GET** /v2/historical-candle/{instrumentKey}/{interval}/{to_date} | Historical candle data
*HistoryApi* | [**get_historical_candle_data3**](docs/HistoryApi.md#get_historical_candle_data3) | **GET** /v2/historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date} | Historical candle data
*HistoryApi* | [**get_intra_day_candle_data1**](docs/HistoryApi.md#get_intra_day_candle_data1) | **GET** /v2/historical-candle/intraday/{instrumentKey}/{interval} | Intra day candle data
*HistoryV3Api* | [**get_historical_candle_data**](docs/HistoryV3Api.md#get_historical_candle_data) | **GET** /v3/historical-candle/{instrumentKey}/{unit}/{interval}/{to_date} | Historical candle data
*HistoryV3Api* | [**get_historical_candle_data1**](docs/HistoryV3Api.md#get_historical_candle_data1) | **GET** /v3/historical-candle/{instrumentKey}/{unit}/{interval}/{to_date}/{from_date} | Historical candle data
*HistoryV3Api* | [**get_intra_day_candle_data**](docs/HistoryV3Api.md#get_intra_day_candle_data) | **GET** /v3/historical-candle/intraday/{instrumentKey}/{unit}/{interval} | Intra day candle data
*LoginApi* | [**authorize**](docs/LoginApi.md#authorize) | **GET** /v2/login/authorization/dialog | Authorize API
*LoginApi* | [**init_token_request_for_indie_user**](docs/LoginApi.md#init_token_request_for_indie_user) | **POST** /v3/login/auth/token/request/{client_id} | Init token API
*LoginApi* | [**logout**](docs/LoginApi.md#logout) | **DELETE** /v2/logout | Logout
Expand All @@ -104,6 +111,9 @@ Class | Method | HTTP request | Description
*MarketQuoteApi* | [**get_full_market_quote**](docs/MarketQuoteApi.md#get_full_market_quote) | **GET** /v2/market-quote/quotes | Market quotes and instruments - Full market quotes
*MarketQuoteApi* | [**get_market_quote_ohlc**](docs/MarketQuoteApi.md#get_market_quote_ohlc) | **GET** /v2/market-quote/ohlc | Market quotes and instruments - OHLC quotes
*MarketQuoteApi* | [**ltp**](docs/MarketQuoteApi.md#ltp) | **GET** /v2/market-quote/ltp | Market quotes and instruments - LTP quotes.
*MarketQuoteV3Api* | [**get_ltp**](docs/MarketQuoteV3Api.md#get_ltp) | **GET** /v3/market-quote/ltp | Market quotes and instruments - LTP quotes.
*MarketQuoteV3Api* | [**get_market_quote_ohlc**](docs/MarketQuoteV3Api.md#get_market_quote_ohlc) | **GET** /v3/market-quote/ohlc | Market quotes and instruments - OHLC quotes
*MarketQuoteV3Api* | [**get_market_quote_option_greek**](docs/MarketQuoteV3Api.md#get_market_quote_option_greek) | **GET** /v3/market-quote/option-greek | Market quotes and instruments - Option Greek
*OptionsApi* | [**get_option_contracts**](docs/OptionsApi.md#get_option_contracts) | **GET** /v2/option/contract | Get option contracts
*OptionsApi* | [**get_put_call_option_chain**](docs/OptionsApi.md#get_put_call_option_chain) | **GET** /v2/option/chain | Get option chain
*OrderApi* | [**cancel_multi_order**](docs/OrderApi.md#cancel_multi_order) | **DELETE** /v2/order/multi/cancel | Cancel multi order
Expand All @@ -119,6 +129,7 @@ Class | Method | HTTP request | Description
*OrderApi* | [**place_order**](docs/OrderApi.md#place_order) | **POST** /v2/order/place | Place order
*PortfolioApi* | [**convert_positions**](docs/PortfolioApi.md#convert_positions) | **PUT** /v2/portfolio/convert-position | Convert Positions
*PortfolioApi* | [**get_holdings**](docs/PortfolioApi.md#get_holdings) | **GET** /v2/portfolio/long-term-holdings | Get Holdings
*PortfolioApi* | [**get_mtf_positions**](docs/PortfolioApi.md#get_mtf_positions) | **GET** /v3/portfolio/mtf-positions | Get MTF positions
*PortfolioApi* | [**get_positions**](docs/PortfolioApi.md#get_positions) | **GET** /v2/portfolio/short-term-positions | Get Positions
*PostTradeApi* | [**get_trades_by_date_range**](docs/PostTradeApi.md#get_trades_by_date_range) | **GET** /v2/charges/historical-trades | Get historical trades
*TradeProfitAndLossApi* | [**get_profit_and_loss_charges**](docs/TradeProfitAndLossApi.md#get_profit_and_loss_charges) | **GET** /v2/trade/profit-loss/charges | Get profit and loss on trades
Expand Down Expand Up @@ -186,9 +197,10 @@ Feel free to adjust the access token placeholder and any other specifics to bett
- **ltpc**: ltpc provides information solely about the most recent trade, encompassing details such as the last trade price, time of the last trade, quantity traded, and the closing price from the previous day.
- **full**: The full option offers comprehensive information, including the latest trade prices, D5 depth, 1-minute, 30-minute, and daily candlestick data, along with some additional details.
- **option_greeks**: Contains only option greeks.
- **full_d30**: full_d30 includes Full mode data plus 30 market level quotes.

#### Functions
1. **constructor MarketDataStreamerV3(apiClient, instrumentKeys, mode)**: Initializes the streamer with optional instrument keys and mode (`full`, `ltpc` or `option_greeks`).
1. **constructor MarketDataStreamerV3(apiClient, instrumentKeys, mode)**: Initializes the streamer with optional instrument keys and mode (`full`, `ltpc`, `option_greeks` or `full_d30`).
2. **connect()**: Establishes the WebSocket connection.
3. **subscribe(instrumentKeys, mode)**: Subscribes to updates for given instrument keys in the specified mode. Both parameters are mandatory.
4. **unsubscribe(instrumentKeys)**: Stops updates for the specified instrument keys.
Expand Down Expand Up @@ -809,15 +821,22 @@ if __name__ == "__main__":
- [DepthMap](docs/DepthMap.md)
- [DpPlan](docs/DpPlan.md)
- [ExchangeTimingData](docs/ExchangeTimingData.md)
- [ExpiredFutureData](docs/ExpiredFutureData.md)
- [GetBrokerageResponse](docs/GetBrokerageResponse.md)
- [GetExchangeTimingResponse](docs/GetExchangeTimingResponse.md)
- [GetExpiredFuturesContractResponse](docs/GetExpiredFuturesContractResponse.md)
- [GetExpiriesResponse](docs/GetExpiriesResponse.md)
- [GetFullMarketQuoteResponse](docs/GetFullMarketQuoteResponse.md)
- [GetGttOrderResponse](docs/GetGttOrderResponse.md)
- [GetHistoricalCandleResponse](docs/GetHistoricalCandleResponse.md)
- [GetHoldingsResponse](docs/GetHoldingsResponse.md)
- [GetHolidayResponse](docs/GetHolidayResponse.md)
- [GetIntraDayCandleResponse](docs/GetIntraDayCandleResponse.md)
- [GetMarketQuoteLastTradedPriceResponse](docs/GetMarketQuoteLastTradedPriceResponse.md)
- [GetMarketQuoteLastTradedPriceResponseV3](docs/GetMarketQuoteLastTradedPriceResponseV3.md)
- [GetMarketQuoteOHLCResponse](docs/GetMarketQuoteOHLCResponse.md)
- [GetMarketQuoteOHLCResponseV3](docs/GetMarketQuoteOHLCResponseV3.md)
- [GetMarketQuoteOptionGreekResponseV3](docs/GetMarketQuoteOptionGreekResponseV3.md)
- [GetMarketStatusResponse](docs/GetMarketStatusResponse.md)
- [GetOptionChainResponse](docs/GetOptionChainResponse.md)
- [GetOptionContractResponse](docs/GetOptionContractResponse.md)
Expand All @@ -831,6 +850,13 @@ if __name__ == "__main__":
- [GetTradeWiseProfitAndLossDataResponse](docs/GetTradeWiseProfitAndLossDataResponse.md)
- [GetTradeWiseProfitAndLossMetaDataResponse](docs/GetTradeWiseProfitAndLossMetaDataResponse.md)
- [GetUserFundMarginResponse](docs/GetUserFundMarginResponse.md)
- [GttCancelOrderRequest](docs/GttCancelOrderRequest.md)
- [GttModifyOrderRequest](docs/GttModifyOrderRequest.md)
- [GttOrderData](docs/GttOrderData.md)
- [GttOrderDetails](docs/GttOrderDetails.md)
- [GttPlaceOrderRequest](docs/GttPlaceOrderRequest.md)
- [GttRule](docs/GttRule.md)
- [GttTriggerOrderResponse](docs/GttTriggerOrderResponse.md)
- [HistoricalCandleData](docs/HistoricalCandleData.md)
- [HoldingsData](docs/HoldingsData.md)
- [HolidayData](docs/HolidayData.md)
Expand All @@ -846,8 +872,11 @@ if __name__ == "__main__":
- [MarginRequest](docs/MarginRequest.md)
- [MarketData](docs/MarketData.md)
- [MarketQuoteOHLC](docs/MarketQuoteOHLC.md)
- [MarketQuoteOHLCV3](docs/MarketQuoteOHLCV3.md)
- [MarketQuoteOptionGreekV3](docs/MarketQuoteOptionGreekV3.md)
- [MarketQuoteSymbol](docs/MarketQuoteSymbol.md)
- [MarketQuoteSymbolLtp](docs/MarketQuoteSymbolLtp.md)
- [MarketQuoteSymbolLtpV3](docs/MarketQuoteSymbolLtpV3.md)
- [MarketStatusData](docs/MarketStatusData.md)
- [ModifyOrderData](docs/ModifyOrderData.md)
- [ModifyOrderRequest](docs/ModifyOrderRequest.md)
Expand All @@ -864,6 +893,7 @@ if __name__ == "__main__":
- [OAuthClientExceptionCauseStackTrace](docs/OAuthClientExceptionCauseStackTrace.md)
- [OAuthClientExceptionCauseSuppressed](docs/OAuthClientExceptionCauseSuppressed.md)
- [Ohlc](docs/Ohlc.md)
- [OhlcV3](docs/OhlcV3.md)
- [OptionStrikeData](docs/OptionStrikeData.md)
- [OrderBookData](docs/OrderBookData.md)
- [OrderData](docs/OrderData.md)
Expand All @@ -885,6 +915,7 @@ if __name__ == "__main__":
- [ProfitAndLossMetaDataWrapper](docs/ProfitAndLossMetaDataWrapper.md)
- [ProfitAndLossOtherChargesTaxes](docs/ProfitAndLossOtherChargesTaxes.md)
- [PutCallOptionChainData](docs/PutCallOptionChainData.md)
- [Rule](docs/Rule.md)
- [TokenRequest](docs/TokenRequest.md)
- [TokenResponse](docs/TokenResponse.md)
- [TradeData](docs/TradeData.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/ChargeApi.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# upstox_client.ChargeApi

All URIs are relative to *https://api-v2.upstox.com*
All URIs are relative to *https://api.upstox.com*

Method | HTTP request | Description
------------- | ------------- | -------------
Expand Down
23 changes: 23 additions & 0 deletions docs/ExpiredFutureData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ExpiredFutureData

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Name of the instrument | [optional]
**segment** | **str** | Segment of the instrument | [optional]
**exchange** | **str** | Exchange of the instrument | [optional]
**expiry** | **str** | Expiry date of the instrument | [optional]
**instrument_key** | **str** | Unique key identifying the instrument | [optional]
**exchange_token** | **str** | Token assigned by the exchange | [optional]
**trading_symbol** | **str** | Symbol used for trading | [optional]
**tick_size** | **float** | Minimum price movement | [optional]
**lot_size** | **int** | Number of units per lot | [optional]
**instrument_type** | **str** | Type of the instrument | [optional]
**freeze_quantity** | **float** | Maximum allowed quantity | [optional]
**underlying_key** | **str** | Key of the underlying asset | [optional]
**underlying_type** | **str** | Type of the underlying asset | [optional]
**underlying_symbol** | **str** | Symbol of the underlying asset | [optional]
**minimum_lot** | **int** | Minimum lot size | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Loading
Loading