Inquiry about Python SDK API functionalities and response values

I am writing to inquire about a few aspects of the API functions, particularly regarding the “get_intra_day_candle_data” and “get_market_quote_ohlc” endpoints. I have noticed some differences and would appreciate some clarifications. Below are the specific questions I have:

  1. In the “get_intra_day_candle_data” and “get_market_quote_ohlc” API calls, we have observed that the intervals of 3 minutes, 5 minutes, 10 minutes, and 15 minutes for candle data are missing compared to the older version of the API. Could you please shed some light on why these intervals are not available in the current API version? Additionally, do you have any information on when these intervals will be made available again?

  2. I have noticed that the interval strings for the “get_intra_day_candle_data” and “get_market_quote_ohlc” endpoints differ. Specifically, for “get_intra_day_candle_data,” the interval string options are “1minute|30minute|day|week|month,” while for “get_market_quote_ohlc,” the options are “1d|I1|I30.” This discrepancy seems to be unnecessary, and it would be more convenient for developers if the interval strings were consistent across both endpoints. Can you explain the reason behind this difference and whether there are any plans to align them?

3.Another issue I encountered is the lack of detailed documentation regarding the candle data response values in the “intra_day_candle_data” API response. Specifically, the last two values in the response are unclear to me. I suggest that these values should be provided as key-value pairs, similar to how they appear in the “get_full_market_quote” API response, for better clarity. For example:

intra_day_candle_data: {‘data’: {‘candles’: [[‘2023-07-20T15:29:00+05:30’,
1800.05, – > Open
1804.8, —> high
1799.8, —> low
1800.8, —> close
1827, ----- What is this?
0], ------ What is this ?

it should be like below
{‘data’: {‘candles’: [[‘2023-07-20T15:29:00+05:30’,
‘ohlc’: { ‘open’: 1800.8,‘high’: 1804.8, ‘low’: 1799.8, ‘close’: 1799.8
‘some_key’: 1827, ‘another_key’: 0]]}

Thank you for the inquiry.

Question 1:

At the moment, we offer support for two intraday candle intervals: 1 minute and 30 minutes, specifically for v2 APIs. Please note that other intervals are currently not supported. However, if there are plans to prioritize additional intervals in the future, we will notify you from the product side.

Question 2:

Regarding intraday candle options, we currently have only two choices: 1 minute and 30 minutes. We acknowledge the name discrepancy, and we will address this with the relevant product team. We’ll get back to you with further information.

Question 3:

We have chosen the current format for performance reasons and appreciate your feedback. We recognize the need for an explanation in the documentation, and we will make sure to include that in our plans for future updates.

  "data": {
    "candles": [
      1800.05, -> open
      1804.8, -> high
      1799.8, -> low
      1800.8, -> close
      1827,   -> volume
      0       -> openInterest - For FNO

Thanks, Pradeep, for your answers. However, I urge you to prioritize providing additional intervals and notify me as soon as they are released. This is because I have a strategy that tracks the last 5, 10, and 15-minute candles to make decisions. Otherwise, I would need to modify my code to average the last 5, 10, and 15 of 1-minute candles accordingly.

Additionally, here is the new question:

Question 4 : I don’t want to mention the ‘api_version’ in the function call because I declared it globally.

api_instance = upstox_client.TradeProfitAndLossApi(upstox_client.ApiClient(configuration))
api_version = ‘2.0’
print(api_instance.get_profit_and_loss_charges(segment=‘EQ’, financial_year=‘2021’, api_version))

print(api_instance.get_profit_and_loss_charges(segment=‘EQ’, financial_year=‘2021’, api_version))
SyntaxError: positional argument follows keyword argument

Bellow code is working fine:
api_instance = upstox_client.TradeProfitAndLossApi(upstox_client.ApiClient(configuration))
print(api_instance.get_profit_and_loss_charges(segment=‘EQ’, financial_year=‘2021’, api_version = ‘2.0’))

Resolved: ‘api_version’ was used as the variable name, but it is also the name of the argument in the function

api_version = ‘2.0’
api_instance = upstox_client.TradeProfitAndLossApi(upstox_client.ApiClient(configuration))
print(api_instance.get_profit_and_loss_charges(segment=‘EQ’, financial_year=‘2021’, api_version=api_version))

Question 5: Date Format Discrepancy Found in get_trade_wise_profit_and_loss_meta_data. The Valid Format is “dd-mm-yyyy”; However, in HistoryApi, the Valid Format is “yyyy-mm-dd.”

please address this with the relevant product team as mentioned you in Question 2 answer.

Thank you for the feedback and suggestions.

We have taken note of your recommendations regarding the interval and date format. We will forward them to our product team for consideration, and we will keep you informed accordingly.

1 Like