From 952c6be4da53459b31c535cc93ef4161700e2529 Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 1/6] feat(models): add new model classes for v3-market-quote-quotes Adds GetFullMarketQuoteResponseV3 and MarketQuoteSymbolV3 for GET /v3/market-quote/quotes. swagger-codegen 3.0.82 only partially supports the OpenAPI 3.1 spec and emitted 'object' for every primitive property and dropped the map value type. The swagger_types and the :type:/:rtype: docstrings have been corrected by hand to the real spec types, mirroring the existing GetMarketQuoteLastTradedPriceResponseV3 / MarketQuoteSymbolLtpV3 pair, including the allowed_values check on the response status setter. Co-Authored-By: Claude Opus 5 (1M context) --- .../get_full_market_quote_response_v3.py | 142 +++ .../models/market_quote_symbol_v3.py | 836 ++++++++++++++++++ 2 files changed, 978 insertions(+) create mode 100644 upstox_client/models/get_full_market_quote_response_v3.py create mode 100644 upstox_client/models/market_quote_symbol_v3.py diff --git a/upstox_client/models/get_full_market_quote_response_v3.py b/upstox_client/models/get_full_market_quote_response_v3.py new file mode 100644 index 0000000..8e45a7a --- /dev/null +++ b/upstox_client/models/get_full_market_quote_response_v3.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class GetFullMarketQuoteResponseV3(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'status': 'str', + 'data': 'dict(str, MarketQuoteSymbolV3)' + } + + attribute_map = { + 'status': 'status', + 'data': 'data' + } + + def __init__(self, status=None, data=None): # noqa: E501 + """GetFullMarketQuoteResponseV3 - a model defined in Swagger""" # noqa: E501 + self._status = None + self._data = None + self.discriminator = None + if status is not None: + self.status = status + if data is not None: + self.data = data + + @property + def status(self): + """Gets the status of this GetFullMarketQuoteResponseV3. # noqa: E501 + + + :return: The status of this GetFullMarketQuoteResponseV3. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this GetFullMarketQuoteResponseV3. + + + :param status: The status of this GetFullMarketQuoteResponseV3. # noqa: E501 + :type: str + """ + allowed_values = ["success", "error", "partial_success"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 + .format(status, allowed_values) + ) + + self._status = status + + @property + def data(self): + """Gets the data of this GetFullMarketQuoteResponseV3. # noqa: E501 + + + :return: The data of this GetFullMarketQuoteResponseV3. # noqa: E501 + :rtype: dict(str, MarketQuoteSymbolV3) + """ + return self._data + + @data.setter + def data(self, data): + """Sets the data of this GetFullMarketQuoteResponseV3. + + + :param data: The data of this GetFullMarketQuoteResponseV3. # noqa: E501 + :type: dict(str, MarketQuoteSymbolV3) + """ + + self._data = data + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(GetFullMarketQuoteResponseV3, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, GetFullMarketQuoteResponseV3): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/upstox_client/models/market_quote_symbol_v3.py b/upstox_client/models/market_quote_symbol_v3.py new file mode 100644 index 0000000..3e417d3 --- /dev/null +++ b/upstox_client/models/market_quote_symbol_v3.py @@ -0,0 +1,836 @@ +# coding: utf-8 + +""" + OpenAPI definition + + No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 + + OpenAPI spec version: v0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MarketQuoteSymbolV3(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'ohlc': 'OhlcV3', + 'depth': 'DepthMap', + 'timestamp': 'str', + 'instrument_token': 'str', + 'symbol': 'str', + 'last_price': 'float', + 'volume': 'int', + 'average_price': 'float', + 'oi': 'float', + 'net_change': 'float', + 'total_buy_quantity': 'float', + 'total_sell_quantity': 'float', + 'lower_circuit_limit': 'float', + 'upper_circuit_limit': 'float', + 'last_trade_time': 'str', + 'oi_day_high': 'float', + 'oi_day_low': 'float', + 'prev_close_price': 'float', + 'year_high': 'float', + 'year_low': 'float', + 'previous_oi': 'float', + 'indicative_equilibrium_price': 'float', + 'reference_price': 'float', + 'indicative_equilibrium_quantity': 'int', + 'indicative_imbalance_quantity_total': 'int', + 'indicative_imbalance_quantity_market': 'int', + 'cas_eligible': 'bool' + } + + attribute_map = { + 'ohlc': 'ohlc', + 'depth': 'depth', + 'timestamp': 'timestamp', + 'instrument_token': 'instrument_token', + 'symbol': 'symbol', + 'last_price': 'last_price', + 'volume': 'volume', + 'average_price': 'average_price', + 'oi': 'oi', + 'net_change': 'net_change', + 'total_buy_quantity': 'total_buy_quantity', + 'total_sell_quantity': 'total_sell_quantity', + 'lower_circuit_limit': 'lower_circuit_limit', + 'upper_circuit_limit': 'upper_circuit_limit', + 'last_trade_time': 'last_trade_time', + 'oi_day_high': 'oi_day_high', + 'oi_day_low': 'oi_day_low', + 'prev_close_price': 'prev_close_price', + 'year_high': 'year_high', + 'year_low': 'year_low', + 'previous_oi': 'previous_oi', + 'indicative_equilibrium_price': 'indicative_equilibrium_price', + 'reference_price': 'reference_price', + 'indicative_equilibrium_quantity': 'indicative_equilibrium_quantity', + 'indicative_imbalance_quantity_total': 'indicative_imbalance_quantity_total', + 'indicative_imbalance_quantity_market': 'indicative_imbalance_quantity_market', + 'cas_eligible': 'cas_eligible' + } + + def __init__(self, ohlc=None, depth=None, timestamp=None, instrument_token=None, symbol=None, last_price=None, volume=None, average_price=None, oi=None, net_change=None, total_buy_quantity=None, total_sell_quantity=None, lower_circuit_limit=None, upper_circuit_limit=None, last_trade_time=None, oi_day_high=None, oi_day_low=None, prev_close_price=None, year_high=None, year_low=None, previous_oi=None, indicative_equilibrium_price=None, reference_price=None, indicative_equilibrium_quantity=None, indicative_imbalance_quantity_total=None, indicative_imbalance_quantity_market=None, cas_eligible=None): # noqa: E501 + """MarketQuoteSymbolV3 - a model defined in Swagger""" # noqa: E501 + self._ohlc = None + self._depth = None + self._timestamp = None + self._instrument_token = None + self._symbol = None + self._last_price = None + self._volume = None + self._average_price = None + self._oi = None + self._net_change = None + self._total_buy_quantity = None + self._total_sell_quantity = None + self._lower_circuit_limit = None + self._upper_circuit_limit = None + self._last_trade_time = None + self._oi_day_high = None + self._oi_day_low = None + self._prev_close_price = None + self._year_high = None + self._year_low = None + self._previous_oi = None + self._indicative_equilibrium_price = None + self._reference_price = None + self._indicative_equilibrium_quantity = None + self._indicative_imbalance_quantity_total = None + self._indicative_imbalance_quantity_market = None + self._cas_eligible = None + self.discriminator = None + if ohlc is not None: + self.ohlc = ohlc + if depth is not None: + self.depth = depth + if timestamp is not None: + self.timestamp = timestamp + if instrument_token is not None: + self.instrument_token = instrument_token + if symbol is not None: + self.symbol = symbol + if last_price is not None: + self.last_price = last_price + if volume is not None: + self.volume = volume + if average_price is not None: + self.average_price = average_price + if oi is not None: + self.oi = oi + if net_change is not None: + self.net_change = net_change + if total_buy_quantity is not None: + self.total_buy_quantity = total_buy_quantity + if total_sell_quantity is not None: + self.total_sell_quantity = total_sell_quantity + if lower_circuit_limit is not None: + self.lower_circuit_limit = lower_circuit_limit + if upper_circuit_limit is not None: + self.upper_circuit_limit = upper_circuit_limit + if last_trade_time is not None: + self.last_trade_time = last_trade_time + if oi_day_high is not None: + self.oi_day_high = oi_day_high + if oi_day_low is not None: + self.oi_day_low = oi_day_low + if prev_close_price is not None: + self.prev_close_price = prev_close_price + if year_high is not None: + self.year_high = year_high + if year_low is not None: + self.year_low = year_low + if previous_oi is not None: + self.previous_oi = previous_oi + if indicative_equilibrium_price is not None: + self.indicative_equilibrium_price = indicative_equilibrium_price + if reference_price is not None: + self.reference_price = reference_price + if indicative_equilibrium_quantity is not None: + self.indicative_equilibrium_quantity = indicative_equilibrium_quantity + if indicative_imbalance_quantity_total is not None: + self.indicative_imbalance_quantity_total = indicative_imbalance_quantity_total + if indicative_imbalance_quantity_market is not None: + self.indicative_imbalance_quantity_market = indicative_imbalance_quantity_market + if cas_eligible is not None: + self.cas_eligible = cas_eligible + + @property + def ohlc(self): + """Gets the ohlc of this MarketQuoteSymbolV3. # noqa: E501 + + + :return: The ohlc of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: OhlcV3 + """ + return self._ohlc + + @ohlc.setter + def ohlc(self, ohlc): + """Sets the ohlc of this MarketQuoteSymbolV3. + + + :param ohlc: The ohlc of this MarketQuoteSymbolV3. # noqa: E501 + :type: OhlcV3 + """ + + self._ohlc = ohlc + + @property + def depth(self): + """Gets the depth of this MarketQuoteSymbolV3. # noqa: E501 + + + :return: The depth of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: DepthMap + """ + return self._depth + + @depth.setter + def depth(self, depth): + """Sets the depth of this MarketQuoteSymbolV3. + + + :param depth: The depth of this MarketQuoteSymbolV3. # noqa: E501 + :type: DepthMap + """ + + self._depth = depth + + @property + def timestamp(self): + """Gets the timestamp of this MarketQuoteSymbolV3. # noqa: E501 + + Time in milliseconds at which the feeds was updated # noqa: E501 + + :return: The timestamp of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this MarketQuoteSymbolV3. + + Time in milliseconds at which the feeds was updated # noqa: E501 + + :param timestamp: The timestamp of this MarketQuoteSymbolV3. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + @property + def instrument_token(self): + """Gets the instrument_token of this MarketQuoteSymbolV3. # noqa: E501 + + Key issued by Upstox for the instrument # noqa: E501 + + :return: The instrument_token of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: str + """ + return self._instrument_token + + @instrument_token.setter + def instrument_token(self, instrument_token): + """Sets the instrument_token of this MarketQuoteSymbolV3. + + Key issued by Upstox for the instrument # noqa: E501 + + :param instrument_token: The instrument_token of this MarketQuoteSymbolV3. # noqa: E501 + :type: str + """ + + self._instrument_token = instrument_token + + @property + def symbol(self): + """Gets the symbol of this MarketQuoteSymbolV3. # noqa: E501 + + Shows the trading symbol of the instrument # noqa: E501 + + :return: The symbol of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: str + """ + return self._symbol + + @symbol.setter + def symbol(self, symbol): + """Sets the symbol of this MarketQuoteSymbolV3. + + Shows the trading symbol of the instrument # noqa: E501 + + :param symbol: The symbol of this MarketQuoteSymbolV3. # noqa: E501 + :type: str + """ + + self._symbol = symbol + + @property + def last_price(self): + """Gets the last_price of this MarketQuoteSymbolV3. # noqa: E501 + + The last traded price of symbol # noqa: E501 + + :return: The last_price of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._last_price + + @last_price.setter + def last_price(self, last_price): + """Sets the last_price of this MarketQuoteSymbolV3. + + The last traded price of symbol # noqa: E501 + + :param last_price: The last_price of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._last_price = last_price + + @property + def volume(self): + """Gets the volume of this MarketQuoteSymbolV3. # noqa: E501 + + The volume traded today on symbol # noqa: E501 + + :return: The volume of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: int + """ + return self._volume + + @volume.setter + def volume(self, volume): + """Sets the volume of this MarketQuoteSymbolV3. + + The volume traded today on symbol # noqa: E501 + + :param volume: The volume of this MarketQuoteSymbolV3. # noqa: E501 + :type: int + """ + + self._volume = volume + + @property + def average_price(self): + """Gets the average_price of this MarketQuoteSymbolV3. # noqa: E501 + + Average price # noqa: E501 + + :return: The average_price of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._average_price + + @average_price.setter + def average_price(self, average_price): + """Sets the average_price of this MarketQuoteSymbolV3. + + Average price # noqa: E501 + + :param average_price: The average_price of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._average_price = average_price + + @property + def oi(self): + """Gets the oi of this MarketQuoteSymbolV3. # noqa: E501 + + Total number of outstanding contracts held by market participants exchange-wide (only F&O) # noqa: E501 + + :return: The oi of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._oi + + @oi.setter + def oi(self, oi): + """Sets the oi of this MarketQuoteSymbolV3. + + Total number of outstanding contracts held by market participants exchange-wide (only F&O) # noqa: E501 + + :param oi: The oi of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._oi = oi + + @property + def net_change(self): + """Gets the net_change of this MarketQuoteSymbolV3. # noqa: E501 + + The absolute change from yesterday's close to last traded price # noqa: E501 + + :return: The net_change of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._net_change + + @net_change.setter + def net_change(self, net_change): + """Sets the net_change of this MarketQuoteSymbolV3. + + The absolute change from yesterday's close to last traded price # noqa: E501 + + :param net_change: The net_change of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._net_change = net_change + + @property + def total_buy_quantity(self): + """Gets the total_buy_quantity of this MarketQuoteSymbolV3. # noqa: E501 + + The total number of bid quantity available for trading # noqa: E501 + + :return: The total_buy_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._total_buy_quantity + + @total_buy_quantity.setter + def total_buy_quantity(self, total_buy_quantity): + """Sets the total_buy_quantity of this MarketQuoteSymbolV3. + + The total number of bid quantity available for trading # noqa: E501 + + :param total_buy_quantity: The total_buy_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._total_buy_quantity = total_buy_quantity + + @property + def total_sell_quantity(self): + """Gets the total_sell_quantity of this MarketQuoteSymbolV3. # noqa: E501 + + The total number of ask quantity available for trading # noqa: E501 + + :return: The total_sell_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._total_sell_quantity + + @total_sell_quantity.setter + def total_sell_quantity(self, total_sell_quantity): + """Sets the total_sell_quantity of this MarketQuoteSymbolV3. + + The total number of ask quantity available for trading # noqa: E501 + + :param total_sell_quantity: The total_sell_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._total_sell_quantity = total_sell_quantity + + @property + def lower_circuit_limit(self): + """Gets the lower_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + + The lower circuit of symbol # noqa: E501 + + :return: The lower_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._lower_circuit_limit + + @lower_circuit_limit.setter + def lower_circuit_limit(self, lower_circuit_limit): + """Sets the lower_circuit_limit of this MarketQuoteSymbolV3. + + The lower circuit of symbol # noqa: E501 + + :param lower_circuit_limit: The lower_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._lower_circuit_limit = lower_circuit_limit + + @property + def upper_circuit_limit(self): + """Gets the upper_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + + The upper circuit of symbol # noqa: E501 + + :return: The upper_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._upper_circuit_limit + + @upper_circuit_limit.setter + def upper_circuit_limit(self, upper_circuit_limit): + """Sets the upper_circuit_limit of this MarketQuoteSymbolV3. + + The upper circuit of symbol # noqa: E501 + + :param upper_circuit_limit: The upper_circuit_limit of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._upper_circuit_limit = upper_circuit_limit + + @property + def last_trade_time(self): + """Gets the last_trade_time of this MarketQuoteSymbolV3. # noqa: E501 + + Time in milliseconds at which last trade happened # noqa: E501 + + :return: The last_trade_time of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: str + """ + return self._last_trade_time + + @last_trade_time.setter + def last_trade_time(self, last_trade_time): + """Sets the last_trade_time of this MarketQuoteSymbolV3. + + Time in milliseconds at which last trade happened # noqa: E501 + + :param last_trade_time: The last_trade_time of this MarketQuoteSymbolV3. # noqa: E501 + :type: str + """ + + self._last_trade_time = last_trade_time + + @property + def oi_day_high(self): + """Gets the oi_day_high of this MarketQuoteSymbolV3. # noqa: E501 + + The highest open interest recorded on symbol during the day # noqa: E501 + + :return: The oi_day_high of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._oi_day_high + + @oi_day_high.setter + def oi_day_high(self, oi_day_high): + """Sets the oi_day_high of this MarketQuoteSymbolV3. + + The highest open interest recorded on symbol during the day # noqa: E501 + + :param oi_day_high: The oi_day_high of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._oi_day_high = oi_day_high + + @property + def oi_day_low(self): + """Gets the oi_day_low of this MarketQuoteSymbolV3. # noqa: E501 + + The lowest open interest recorded on symbol during the day # noqa: E501 + + :return: The oi_day_low of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._oi_day_low + + @oi_day_low.setter + def oi_day_low(self, oi_day_low): + """Sets the oi_day_low of this MarketQuoteSymbolV3. + + The lowest open interest recorded on symbol during the day # noqa: E501 + + :param oi_day_low: The oi_day_low of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._oi_day_low = oi_day_low + + @property + def prev_close_price(self): + """Gets the prev_close_price of this MarketQuoteSymbolV3. # noqa: E501 + + The close price of the symbol from the previous session of trading # noqa: E501 + + :return: The prev_close_price of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._prev_close_price + + @prev_close_price.setter + def prev_close_price(self, prev_close_price): + """Sets the prev_close_price of this MarketQuoteSymbolV3. + + The close price of the symbol from the previous session of trading # noqa: E501 + + :param prev_close_price: The prev_close_price of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._prev_close_price = prev_close_price + + @property + def year_high(self): + """Gets the year_high of this MarketQuoteSymbolV3. # noqa: E501 + + The highest price of the symbol over the trailing year # noqa: E501 + + :return: The year_high of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._year_high + + @year_high.setter + def year_high(self, year_high): + """Sets the year_high of this MarketQuoteSymbolV3. + + The highest price of the symbol over the trailing year # noqa: E501 + + :param year_high: The year_high of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._year_high = year_high + + @property + def year_low(self): + """Gets the year_low of this MarketQuoteSymbolV3. # noqa: E501 + + The lowest price of the symbol over the trailing year # noqa: E501 + + :return: The year_low of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._year_low + + @year_low.setter + def year_low(self, year_low): + """Sets the year_low of this MarketQuoteSymbolV3. + + The lowest price of the symbol over the trailing year # noqa: E501 + + :param year_low: The year_low of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._year_low = year_low + + @property + def previous_oi(self): + """Gets the previous_oi of this MarketQuoteSymbolV3. # noqa: E501 + + The open interest of the symbol from the previous session (only F&O) # noqa: E501 + + :return: The previous_oi of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._previous_oi + + @previous_oi.setter + def previous_oi(self, previous_oi): + """Sets the previous_oi of this MarketQuoteSymbolV3. + + The open interest of the symbol from the previous session (only F&O) # noqa: E501 + + :param previous_oi: The previous_oi of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._previous_oi = previous_oi + + @property + def indicative_equilibrium_price(self): + """Gets the indicative_equilibrium_price of this MarketQuoteSymbolV3. # noqa: E501 + + The indicative equilibrium price discovered during the call auction session # noqa: E501 + + :return: The indicative_equilibrium_price of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._indicative_equilibrium_price + + @indicative_equilibrium_price.setter + def indicative_equilibrium_price(self, indicative_equilibrium_price): + """Sets the indicative_equilibrium_price of this MarketQuoteSymbolV3. + + The indicative equilibrium price discovered during the call auction session # noqa: E501 + + :param indicative_equilibrium_price: The indicative_equilibrium_price of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._indicative_equilibrium_price = indicative_equilibrium_price + + @property + def reference_price(self): + """Gets the reference_price of this MarketQuoteSymbolV3. # noqa: E501 + + The reference price against which the call auction price band is applied # noqa: E501 + + :return: The reference_price of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: float + """ + return self._reference_price + + @reference_price.setter + def reference_price(self, reference_price): + """Sets the reference_price of this MarketQuoteSymbolV3. + + The reference price against which the call auction price band is applied # noqa: E501 + + :param reference_price: The reference_price of this MarketQuoteSymbolV3. # noqa: E501 + :type: float + """ + + self._reference_price = reference_price + + @property + def indicative_equilibrium_quantity(self): + """Gets the indicative_equilibrium_quantity of this MarketQuoteSymbolV3. # noqa: E501 + + The indicative equilibrium quantity matched at the indicative equilibrium price # noqa: E501 + + :return: The indicative_equilibrium_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: int + """ + return self._indicative_equilibrium_quantity + + @indicative_equilibrium_quantity.setter + def indicative_equilibrium_quantity(self, indicative_equilibrium_quantity): + """Sets the indicative_equilibrium_quantity of this MarketQuoteSymbolV3. + + The indicative equilibrium quantity matched at the indicative equilibrium price # noqa: E501 + + :param indicative_equilibrium_quantity: The indicative_equilibrium_quantity of this MarketQuoteSymbolV3. # noqa: E501 + :type: int + """ + + self._indicative_equilibrium_quantity = indicative_equilibrium_quantity + + @property + def indicative_imbalance_quantity_total(self): + """Gets the indicative_imbalance_quantity_total of this MarketQuoteSymbolV3. # noqa: E501 + + The total indicative imbalance quantity in the call auction order book # noqa: E501 + + :return: The indicative_imbalance_quantity_total of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: int + """ + return self._indicative_imbalance_quantity_total + + @indicative_imbalance_quantity_total.setter + def indicative_imbalance_quantity_total(self, indicative_imbalance_quantity_total): + """Sets the indicative_imbalance_quantity_total of this MarketQuoteSymbolV3. + + The total indicative imbalance quantity in the call auction order book # noqa: E501 + + :param indicative_imbalance_quantity_total: The indicative_imbalance_quantity_total of this MarketQuoteSymbolV3. # noqa: E501 + :type: int + """ + + self._indicative_imbalance_quantity_total = indicative_imbalance_quantity_total + + @property + def indicative_imbalance_quantity_market(self): + """Gets the indicative_imbalance_quantity_market of this MarketQuoteSymbolV3. # noqa: E501 + + The market-order component of the indicative imbalance quantity in the call auction order book # noqa: E501 + + :return: The indicative_imbalance_quantity_market of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: int + """ + return self._indicative_imbalance_quantity_market + + @indicative_imbalance_quantity_market.setter + def indicative_imbalance_quantity_market(self, indicative_imbalance_quantity_market): + """Sets the indicative_imbalance_quantity_market of this MarketQuoteSymbolV3. + + The market-order component of the indicative imbalance quantity in the call auction order book # noqa: E501 + + :param indicative_imbalance_quantity_market: The indicative_imbalance_quantity_market of this MarketQuoteSymbolV3. # noqa: E501 + :type: int + """ + + self._indicative_imbalance_quantity_market = indicative_imbalance_quantity_market + + @property + def cas_eligible(self): + """Gets the cas_eligible of this MarketQuoteSymbolV3. # noqa: E501 + + Whether the symbol is eligible for the call auction session # noqa: E501 + + :return: The cas_eligible of this MarketQuoteSymbolV3. # noqa: E501 + :rtype: bool + """ + return self._cas_eligible + + @cas_eligible.setter + def cas_eligible(self, cas_eligible): + """Sets the cas_eligible of this MarketQuoteSymbolV3. + + Whether the symbol is eligible for the call auction session # noqa: E501 + + :param cas_eligible: The cas_eligible of this MarketQuoteSymbolV3. # noqa: E501 + :type: bool + """ + + self._cas_eligible = cas_eligible + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(MarketQuoteSymbolV3, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, MarketQuoteSymbolV3): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other From 6b60055d2366633cdfb5593eb69ac8c564b5a0e6 Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 2/6] feat(api): add v3-market-quote-quotes endpoint to MarketQuoteV3Api Adds get_full_market_quote_v3 / get_full_market_quote_v3_with_http_info for GET /v3/market-quote/quotes. Applied as an additive insert rather than an overwrite of the generated file: the generated output renamed the existing public method get_market_quote_ohlc to get_market_quote_ohlcv3 and downgraded ":param str" docstrings to ":param object" on existing methods, both of which are unrelated codegen regressions. Co-Authored-By: Claude Opus 5 (1M context) --- upstox_client/api/market_quote_v3_api.py | 91 ++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/upstox_client/api/market_quote_v3_api.py b/upstox_client/api/market_quote_v3_api.py index 0e0baff..c527285 100644 --- a/upstox_client/api/market_quote_v3_api.py +++ b/upstox_client/api/market_quote_v3_api.py @@ -32,6 +32,97 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client + def get_full_market_quote_v3(self, **kwargs): # noqa: E501 + """Market quotes and instruments - Full market quotes # noqa: E501 + + This API provides the functionality to retrieve the full market quotes for one or more instruments.This API returns the complete market data snapshot of up to 500 instruments in one go, widened to carry every field published on the upstream extended feed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_full_market_quote_v3(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str instrument_key: Comma separated list of instrument keys + :return: GetFullMarketQuoteResponseV3 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_full_market_quote_v3_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_full_market_quote_v3_with_http_info(**kwargs) # noqa: E501 + return data + + def get_full_market_quote_v3_with_http_info(self, **kwargs): # noqa: E501 + """Market quotes and instruments - Full market quotes # noqa: E501 + + This API provides the functionality to retrieve the full market quotes for one or more instruments.This API returns the complete market data snapshot of up to 500 instruments in one go, widened to carry every field published on the upstream extended feed. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_full_market_quote_v3_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str instrument_key: Comma separated list of instrument keys + :return: GetFullMarketQuoteResponseV3 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['instrument_key'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_full_market_quote_v3" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'instrument_key' in params: + query_params.append(('instrument_key', params['instrument_key'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json', '*/*']) # noqa: E501 + + # Authentication setting + auth_settings = ['OAUTH2'] # noqa: E501 + + return self.api_client.call_api( + '/v3/market-quote/quotes', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='GetFullMarketQuoteResponseV3', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def get_ltp(self, **kwargs): # noqa: E501 """Market quotes and instruments - LTP quotes. # noqa: E501 From 02efae2ac14be70932ea0a9b893a90737c5b4297 Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 3/6] chore(exports): update __init__ for v3-market-quote-quotes Co-Authored-By: Claude Opus 5 (1M context) --- upstox_client/__init__.py | 2 ++ upstox_client/models/__init__.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/upstox_client/__init__.py b/upstox_client/__init__.py index 958ed18..20c8fbf 100644 --- a/upstox_client/__init__.py +++ b/upstox_client/__init__.py @@ -91,6 +91,7 @@ from upstox_client.models.get_expired_futures_contract_response import GetExpiredFuturesContractResponse from upstox_client.models.get_expiries import GetExpiriesResponse from upstox_client.models.get_full_market_quote_response import GetFullMarketQuoteResponse +from upstox_client.models.get_full_market_quote_response_v3 import GetFullMarketQuoteResponseV3 from upstox_client.models.get_gtt_order_response import GetGttOrderResponse from upstox_client.models.get_historical_candle_response import GetHistoricalCandleResponse from upstox_client.models.get_holdings_response import GetHoldingsResponse @@ -180,6 +181,7 @@ from upstox_client.models.market_quote_symbol import MarketQuoteSymbol from upstox_client.models.market_quote_symbol_ltp import MarketQuoteSymbolLtp from upstox_client.models.market_quote_symbol_ltp_v3 import MarketQuoteSymbolLtpV3 +from upstox_client.models.market_quote_symbol_v3 import MarketQuoteSymbolV3 from upstox_client.models.market_status_data import MarketStatusData from upstox_client.models.modify_order_data import ModifyOrderData from upstox_client.models.modify_order_request import ModifyOrderRequest diff --git a/upstox_client/models/__init__.py b/upstox_client/models/__init__.py index 4bef9bf..0ef7e75 100644 --- a/upstox_client/models/__init__.py +++ b/upstox_client/models/__init__.py @@ -61,6 +61,7 @@ from upstox_client.models.get_expired_futures_contract_response import GetExpiredFuturesContractResponse from upstox_client.models.get_expiries import GetExpiriesResponse from upstox_client.models.get_full_market_quote_response import GetFullMarketQuoteResponse +from upstox_client.models.get_full_market_quote_response_v3 import GetFullMarketQuoteResponseV3 from upstox_client.models.get_gtt_order_response import GetGttOrderResponse from upstox_client.models.get_historical_candle_response import GetHistoricalCandleResponse from upstox_client.models.get_holdings_response import GetHoldingsResponse @@ -147,6 +148,7 @@ from upstox_client.models.market_quote_symbol import MarketQuoteSymbol from upstox_client.models.market_quote_symbol_ltp import MarketQuoteSymbolLtp from upstox_client.models.market_quote_symbol_ltp_v3 import MarketQuoteSymbolLtpV3 +from upstox_client.models.market_quote_symbol_v3 import MarketQuoteSymbolV3 from upstox_client.models.market_status_data import MarketStatusData from upstox_client.models.modify_order_data import ModifyOrderData from upstox_client.models.modify_order_request import ModifyOrderRequest From fb6f7afd09f3ac9c87a5116ccbba7bb695a2d45e Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 4/6] test(v3-market-quote-quotes): add SDK tests for new feature Co-Authored-By: Claude Opus 5 (1M context) --- test/sdk_tests/test_market_quote_v3_api.py | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 test/sdk_tests/test_market_quote_v3_api.py diff --git a/test/sdk_tests/test_market_quote_v3_api.py b/test/sdk_tests/test_market_quote_v3_api.py new file mode 100644 index 0000000..69986c0 --- /dev/null +++ b/test/sdk_tests/test_market_quote_v3_api.py @@ -0,0 +1,140 @@ +import upstox_client +import data_token +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = data_token.access_token + +api_instance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration)) + +# Full market quotes for a single instrument +try: + api_response = api_instance.get_full_market_quote_v3(instrument_key="NSE_EQ|INE669E01016") + if api_response.status != "success": + print("error in get_full_market_quote_v3 with a single instrument_key") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3 single: %s\n" % e) + +# Full market quotes for multiple instruments +try: + api_response = api_instance.get_full_market_quote_v3( + instrument_key="NSE_EQ|INE669E01016,NSE_INDEX|Nifty 50") + if api_response.status != "success": + print("error in get_full_market_quote_v3 with multiple instrument_keys") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3 multiple: %s\n" % e) + +# Full market quotes without any filter +try: + api_response = api_instance.get_full_market_quote_v3() + if api_response.status != "success": + print("error in get_full_market_quote_v3 without instrument_key") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3 no filter: %s\n" % e) + +# LTP quotes +try: + api_response = api_instance.get_ltp(instrument_key="NSE_EQ|INE669E01016") + if api_response.status != "success": + print("error in get_ltp") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_ltp: %s\n" % e) + +# OHLC quotes +try: + api_response = api_instance.get_market_quote_ohlc("I1", instrument_key="NSE_EQ|INE669E01016") + if api_response.status != "success": + print("error in get_market_quote_ohlc") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_market_quote_ohlc: %s\n" % e) + +# Option greeks +try: + api_response = api_instance.get_market_quote_option_greek(instrument_key="NSE_FO|38516") + if api_response.status != "success": + print("error in get_market_quote_option_greek") +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_market_quote_option_greek: %s\n" % e) + +# Model instantiation tests +ohlc = upstox_client.OhlcV3( + open=100.5, + high=110.25, + low=99.75, + close=105.0, + volume=125000, + ts=1788590331000 +) +if ohlc.open != 100.5: + print("error: OhlcV3 open field not set correctly") +if ohlc.volume != 125000: + print("error: OhlcV3 volume field not set correctly") + +buy_depth = upstox_client.Depth(quantity=50, price=104.95, orders=3) +sell_depth = upstox_client.Depth(quantity=75, price=105.05, orders=4) +depth = upstox_client.DepthMap(buy=[buy_depth], sell=[sell_depth]) +if depth.buy[0].quantity != 50: + print("error: DepthMap buy field not set correctly") +if depth.sell[0].price != 105.05: + print("error: DepthMap sell field not set correctly") + +symbol = upstox_client.MarketQuoteSymbolV3( + ohlc=ohlc, + depth=depth, + timestamp="2026-09-05T09:15:00+05:30", + instrument_token="NSE_EQ|INE669E01016", + symbol="IDEA", + last_price=105.0, + volume=125000, + average_price=104.5, + oi=8500.0, + net_change=4.5, + total_buy_quantity=12000.0, + total_sell_quantity=11500.0, + lower_circuit_limit=94.5, + upper_circuit_limit=115.5, + last_trade_time="2026-09-05T09:14:59+05:30", + oi_day_high=9100.0, + oi_day_low=8100.0, + prev_close_price=100.5, + year_high=140.0, + year_low=80.0, + previous_oi=8300.0, + indicative_equilibrium_price=105.25, + reference_price=100.5, + indicative_equilibrium_quantity=4500, + indicative_imbalance_quantity_total=1200, + indicative_imbalance_quantity_market=300, + cas_eligible=True +) +if symbol.symbol != "IDEA": + print("error: MarketQuoteSymbolV3 symbol field not set correctly") +if symbol.last_price != 105.0: + print("error: MarketQuoteSymbolV3 last_price field not set correctly") +if symbol.volume != 125000: + print("error: MarketQuoteSymbolV3 volume field not set correctly") +if symbol.cas_eligible is not True: + print("error: MarketQuoteSymbolV3 cas_eligible field not set correctly") +if symbol.indicative_equilibrium_quantity != 4500: + print("error: MarketQuoteSymbolV3 indicative_equilibrium_quantity field not set correctly") +if symbol.ohlc.close != 105.0: + print("error: MarketQuoteSymbolV3 nested ohlc field not set correctly") +if symbol.depth.buy[0].orders != 3: + print("error: MarketQuoteSymbolV3 nested depth field not set correctly") + +full_quote_response = upstox_client.GetFullMarketQuoteResponseV3( + status="success", + data={"NSE_EQ:IDEA": symbol} +) +if full_quote_response.status != "success": + print("error: GetFullMarketQuoteResponseV3 status field not set correctly") +if full_quote_response.data["NSE_EQ:IDEA"].symbol != "IDEA": + print("error: GetFullMarketQuoteResponseV3 data field not set correctly") +if full_quote_response.to_dict()["data"]["NSE_EQ:IDEA"]["last_price"] != 105.0: + print("error: GetFullMarketQuoteResponseV3 to_dict did not serialise nested data") + +try: + upstox_client.GetFullMarketQuoteResponseV3(status="not_a_valid_status") + print("error: GetFullMarketQuoteResponseV3 accepted an invalid status value") +except ValueError: + pass From a2f5979a5a256981ae70878a51288ee199dde8fb Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 5/6] docs(v3-market-quote-quotes): add usage examples for new feature Co-Authored-By: Claude Opus 5 (1M context) --- examples/README.md | 2 +- examples/market-quote/README.md | 36 +++++---- .../code/full-market-quotes-v3.md | 78 +++++++++++++++++++ 3 files changed, 100 insertions(+), 16 deletions(-) create mode 100644 examples/market-quote/code/full-market-quotes-v3.md diff --git a/examples/README.md b/examples/README.md index a7c92e1..deaef34 100644 --- a/examples/README.md +++ b/examples/README.md @@ -29,7 +29,7 @@ Samples are grouped by API area. Each `.md` file contains one or more Python sni | [**user/**](user/) | User profile, fund and margin details, IP management, kill switch. | | [**orders/**](orders/) | Order lifecycle: place (single/multi, v2 & v3), modify, cancel, order book, order details, order history, trades, historical trades, exit all positions. | | [**portfolio/**](portfolio/) | Positions, holdings, MTF positions, convert positions. | -| [**market-quote/**](market-quote/) | LTP, full market quotes, OHLC (v2 & v3), option Greeks. | +| [**market-quote/**](market-quote/) | LTP, full market quotes (v2 & v3), OHLC (v2 & v3), option Greeks. | | [**historical-data/**](historical-data/) | Historical and intraday candle data (v2 & v3). | | [**option-chain/**](option-chain/) | Option contracts, put-call option chain. | | [**expired-instruments/**](expired-instruments/) | Expiries, expired future/option contracts, expired historical candle data. | diff --git a/examples/market-quote/README.md b/examples/market-quote/README.md index b4039c1..af3bc37 100644 --- a/examples/market-quote/README.md +++ b/examples/market-quote/README.md @@ -7,27 +7,33 @@ Links to all market-quote-related examples in the `code/` folder. - 1.1 [Get full market quote](code/full-market-quotes.md#get-full-market-quote) - 1.2 [Get full market quote for multiple instrument keys](code/full-market-quotes.md#get-full-market-quote-for-multiple-instrument-keys) -## 2. OHLC Quotes V3 +## 2. Full Market Quotes V3 -- 2.1 [Get ohlc (open, high, low, close) market quotes](code/ohlc-quotes-v3.md#get-ohlc-open-high-low-close-market-quotes) -- 2.2 [Get ohlc (open, high, low, close) market quotes for multiple instrument keys](code/ohlc-quotes-v3.md#get-ohlc-open-high-low-close-market-quotes-for-multiple-instrument-keys) +- 2.1 [Get full market quote](code/full-market-quotes-v3.md#get-full-market-quote) +- 2.2 [Get full market quote for multiple instrument keys](code/full-market-quotes-v3.md#get-full-market-quote-for-multiple-instrument-keys) +- 2.3 [Read fields from the full market quote response](code/full-market-quotes-v3.md#read-fields-from-the-full-market-quote-response) -## 3. LTP Quotes V3 +## 3. OHLC Quotes V3 -- 3.1 [Get ltp (last traded price) market quotes](code/ltp-quotes-v3.md#get-ltp-last-traded-price-market-quotes) -- 3.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes-v3.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys) +- 3.1 [Get ohlc (open, high, low, close) market quotes](code/ohlc-quotes-v3.md#get-ohlc-open-high-low-close-market-quotes) +- 3.2 [Get ohlc (open, high, low, close) market quotes for multiple instrument keys](code/ohlc-quotes-v3.md#get-ohlc-open-high-low-close-market-quotes-for-multiple-instrument-keys) -## 4. Option Greek +## 4. LTP Quotes V3 -- 4.1 [Get Option Greek fields](code/option-greek.md#get-option-greek-fields) -- 4.2 [Get Option Greek fields for multiple instruments keys](code/option-greek.md#get-option-greek-fields-for-multiple-instruments-keys) +- 4.1 [Get ltp (last traded price) market quotes](code/ltp-quotes-v3.md#get-ltp-last-traded-price-market-quotes) +- 4.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes-v3.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys) -## 5. OHLC Quotes +## 5. Option Greek -- 5.1 [Get ohlc (open, high, low, close) market quotes](code/ohlc-quotes.md#get-ohlc-open-high-low-close-market-quotes) -- 5.2 [Get ohlc (open, high, low, close) market quotes for multiple instrument keys](code/ohlc-quotes.md#get-ohlc-open-high-low-close-market-quotes-for-multiple-instrument-keys) +- 5.1 [Get Option Greek fields](code/option-greek.md#get-option-greek-fields) +- 5.2 [Get Option Greek fields for multiple instruments keys](code/option-greek.md#get-option-greek-fields-for-multiple-instruments-keys) -## 6. LTP Quotes +## 6. OHLC Quotes -- 6.1 [Get ltp (last traded price) market quotes](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes) -- 6.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys) +- 6.1 [Get ohlc (open, high, low, close) market quotes](code/ohlc-quotes.md#get-ohlc-open-high-low-close-market-quotes) +- 6.2 [Get ohlc (open, high, low, close) market quotes for multiple instrument keys](code/ohlc-quotes.md#get-ohlc-open-high-low-close-market-quotes-for-multiple-instrument-keys) + +## 7. LTP Quotes + +- 7.1 [Get ltp (last traded price) market quotes](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes) +- 7.2 [Get ltp (last traded price) market quotes for multiple instruments keys](code/ltp-quotes.md#get-ltp-last-traded-price-market-quotes-for-multiple-instruments-keys) diff --git a/examples/market-quote/code/full-market-quotes-v3.md b/examples/market-quote/code/full-market-quotes-v3.md new file mode 100644 index 0000000..2c74aeb --- /dev/null +++ b/examples/market-quote/code/full-market-quotes-v3.md @@ -0,0 +1,78 @@ +## Get full market quote + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +apiInstance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration)) +try: + # For a single instrument + response = apiInstance.get_full_market_quote_v3(instrument_key="NSE_EQ|INE848E01016") + print(response) +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3: %s\n" % e) +``` + +## Get full market quote for multiple instrument keys + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +apiInstance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration)) +try: + # For multiple instruments (up to 500 in one call) + response = apiInstance.get_full_market_quote_v3( + instrument_key="NSE_EQ|INE848E01016,NSE_EQ|INE669E01016") + print(response) +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3: %s\n" % e) +``` + +## Read fields from the full market quote response + +```python +import upstox_client +from upstox_client.rest import ApiException + +configuration = upstox_client.Configuration() +configuration.access_token = '{your_access_token}' + +apiInstance = upstox_client.MarketQuoteV3Api(upstox_client.ApiClient(configuration)) +try: + response = apiInstance.get_full_market_quote_v3(instrument_key="NSE_EQ|INE848E01016") + + # response.data is a dict keyed by ":" + for key, quote in response.data.items(): + print(key) + print(" symbol :", quote.symbol) + print(" instrument_token :", quote.instrument_token) + print(" last_price :", quote.last_price) + print(" volume :", quote.volume) + print(" average_price :", quote.average_price) + print(" net_change :", quote.net_change) + print(" prev_close_price :", quote.prev_close_price) + print(" lower_circuit_limit :", quote.lower_circuit_limit) + print(" upper_circuit_limit :", quote.upper_circuit_limit) + print(" year_high / year_low :", quote.year_high, "/", quote.year_low) + print(" oi / previous_oi :", quote.oi, "/", quote.previous_oi) + print(" cas_eligible :", quote.cas_eligible) + + # Nested OHLC snapshot + print(" ohlc :", quote.ohlc.open, quote.ohlc.high, + quote.ohlc.low, quote.ohlc.close) + + # Nested market depth (top 5 bids and asks) + for level in quote.depth.buy: + print(" bid:", level.price, level.quantity, level.orders) + for level in quote.depth.sell: + print(" ask:", level.price, level.quantity, level.orders) +except ApiException as e: + print("Exception when calling MarketQuoteV3Api->get_full_market_quote_v3: %s\n" % e) +``` From e894750dc18c628279780f03a521ff9d2491d245 Mon Sep 17 00:00:00 2001 From: Ketan Gupta Date: Sat, 5 Sep 2026 12:11:13 +0530 Subject: [PATCH 6/6] chore(release): bump version to 2.30.0 Co-Authored-By: Claude Opus 5 (1M context) --- setup.py | 2 +- upstox_client/api_client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a816610..c4a229c 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ long_description = (this_directory / "README.md").read_text() NAME = "upstox-python-sdk" -VERSION = "2.29.0" +VERSION = "2.30.0" # To install the library, run the following # # python setup.py install diff --git a/upstox_client/api_client.py b/upstox_client/api_client.py index 414a45c..bb46556 100644 --- a/upstox_client/api_client.py +++ b/upstox_client/api_client.py @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' self.default_headers["X-Upstox-SDK-Language"] = "python" - self.default_headers["X-Upstox-SDK-Version"] = "2.29.0" + self.default_headers["X-Upstox-SDK-Version"] = "2.30.0" def __del__(self): try: