Package: upstox-python-sdk
Upstox Python SDK for API v2IntroductionThe official Python client for communicating with theUpstox API.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: v2Package version: 2.3.0Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegenThis Python package is automatically generated by theSwagger Codegenproject.Documentation.Upstox API DocumentationRequirements.Python 2.7 and 3.4+Installation & Usagepip installIf the python package is hosted on Github, you can install directly from Githubpipinstallupstox-python-sdk(you may need to runpipwith root permission:sudo pip install upstox-python-sdk)Then import the package:importupstox_clientSetuptoolsInstall viaSetuptools.pythonsetup.pyinstall--user(orsudo python setup.py installto install the package for all users)Then import the package:importupstox_clientExamplesSample Implementationscan be found within/examplesfolder.Websocket Market dataWebsocket Order updatesGetting StartedPlease follow theinstallation procedureand then run the following:from__future__importprint_functionimporttimeimportupstox_clientfromupstox_client.restimportApiExceptionfrompprintimportpprint# Configure OAuth2 access token for authorization: OAUTH2configuration=upstox_client.Configuration()configuration.access_token='YOUR_ACCESS_TOKEN'# create an instance of the API classapi_instance=upstox_client.ChargeApi(upstox_client.ApiClient(configuration))instrument_token='instrument_token_example'# str | Key of the instrumentquantity=56# int | Quantity with which the order is to be placedproduct='product_example'# str | Product with which the order is to be placedtransaction_type='transaction_type_example'# str | Indicates whether its a BUY or SELL orderprice=3.4# float | Price with which the order is to be placedapi_version='api_version_example'# str | API Version Headertry:# Brokerage detailsapi_response=api_instance.get_brokerage(instrument_token,quantity,product,transaction_type,price,api_version)pprint(api_response)exceptApiExceptionase:print("Exception when calling ChargeApi->get_brokerage:%s\n"%e)Documentation for API EndpointsAll URIs are relative tohttps://api-v2.upstox.comClassMethodHTTP requestDescriptionChargeApiget_brokerageGET/charges/brokerageBrokerage detailsHistoryApiget_historical_candle_dataGET/historical-candle/{instrumentKey}/{interval}/{to_date}Historical candle dataHistoryApiget_historical_candle_data1GET/historical-candle/{instrumentKey}/{interval}/{to_date}/{from_date}Historical candle dataHistoryApiget_intra_day_candle_dataGET/historical-candle/intraday/{instrumentKey}/{interval}Intra day candle dataLoginApiauthorizeGET/login/authorization/dialogAuthorize APILoginApilogoutDELETE/logoutLogoutLoginApitokenPOST/login/authorization/tokenGet token APIMarketQuoteApiget_full_market_quoteGET/market-quote/quotesMarket quotes and instruments - Full market quotesMarketQuoteApiget_market_quote_ohlcGET/market-quote/ohlcMarket quotes and instruments - OHLC quotesMarketQuoteApiltpGET/market-quote/ltpMarket quotes and instruments - LTP quotes.OrderApicancel_orderDELETE/order/cancelCancel orderOrderApiget_order_bookGET/order/retrieve-allGet order bookOrderApiget_order_detailsGET/order/historyGet order detailsOrderApiget_trade_historyGET/order/trades/get-trades-for-dayGet tradesOrderApiget_trades_by_orderGET/order/tradesGet trades for orderOrderApimodify_orderPUT/order/modifyModify orderOrderApiplace_orderPOST/order/placePlace orderPortfolioApiconvert_positionsPUT/portfolio/convert-positionConvert PositionsPortfolioApiget_holdingsGET/portfolio/long-term-holdingsGet HoldingsPortfolioApiget_positionsGET/portfolio/short-term-positionsGet PositionsTradeProfitAndLossApiget_profit_and_loss_chargesGET/trade/profit-loss/chargesGet profit and loss on tradesTradeProfitAndLossApiget_trade_wise_profit_and_loss_dataGET/trade/profit-loss/dataGet Trade-wise Profit and Loss Report DataTradeProfitAndLossApiget_trade_wise_profit_and_loss_meta_dataGET/trade/profit-loss/metadataGet profit and loss meta data on tradesUserApiget_profileGET/user/profileGet profileUserApiget_user_fund_marginGET/user/get-funds-and-marginGet User Fund And MarginWebsocketApiget_market_data_feedGET/feed/market-data-feedMarket Data FeedWebsocketApiget_market_data_feed_authorizeGET/feed/market-data-feed/authorizeMarket Data Feed AuthorizeWebsocketApiget_portfolio_stream_feedGET/feed/portfolio-stream-feedPortfolio Stream FeedWebsocketApiget_portfolio_stream_feed_authorizeGET/feed/portfolio-stream-feed/authorizePortfolio Stream Feed AuthorizeDocumentation For ModelsApiGatewayErrorResponseBrokerageDataBrokerageTaxesBrokerageWrapperDataCancelOrderDataCancelOrderResponseConvertPositionDataConvertPositionRequestConvertPositionResponseDepthDepthMapDpPlanGetBrokerageResponseGetFullMarketQuoteResponseGetHistoricalCandleResponseGetHoldingsResponseGetIntraDayCandleResponseGetMarketQuoteLastTradedPriceResponseGetMarketQuoteOHLCResponseGetOrderBookResponseGetOrderResponseGetPositionResponseGetProfileResponseGetProfitAndLossChargesResponseGetTradeResponseGetTradeWiseProfitAndLossDataResponseGetTradeWiseProfitAndLossMetaDataResponseGetUserFundMarginResponseHistoricalCandleDataHoldingsDataIntraDayCandleDataLogoutResponseMarketQuoteOHLCMarketQuoteSymbolMarketQuoteSymbolLtpModifyOrderDataModifyOrderRequestModifyOrderResponseOAuthClientExceptionOAuthClientExceptionCauseOAuthClientExceptionCauseStackTraceOAuthClientExceptionCauseSuppressedOhlcOrderBookDataOrderDataOtherTaxesPlaceOrderDataPlaceOrderRequestPlaceOrderResponsePositionDataProblemProfileDataProfitAndLossChargesDataProfitAndLossChargesTaxesProfitAndLossChargesWrapperDataProfitAndLossMetaDataProfitAndLossMetaDataWrapperProfitAndLossOtherChargesTaxesTokenRequestTokenResponseTradeDataTradeWiseMetaDataTradeWiseProfitAndLossDataUserFundMarginDataWebsocketAuthRedirectResponseWebsocketAuthRedirectResponseData