Why do minutes candle have 15:31 candle and why is trading view and firstock data not exactly equal?

There are 2 questions.

  1. Why do I get a 15:31 candle in minute data?
  2. Minute candles start at 09:00 AM and not at 09:15?
  3. Why do minute data prices for trading view and Firstock differ?

This is the request that can be checked for both the questions

timePriceSeries = firstock_TimePriceSeries(
            exchange="NSE",
            token="REFEX-EQ",
            startTime="07/06/2023 00:00:00",
            endTime="07/06/2023 16:00:00",
            interval="1"
        )
timePriceSeries

{'status': 'Success', 'data': [{'stat': 'Ok', 'time': '07-06-2023 15:31:00', 'ssboe': '1686132060', 'into': '525.55', 'inth': '525.55', 'intl': '525.55', 'intc': '525.55', 'intvwap': '0.00', 'intv': '0', 'intoi': '0', 'v': '160550', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:30:18', 'ssboe': '1686132018', 'into': '522.00', 'inth': '522.00', 'intl': '522.00', 'intc': '522.00', 'intvwap': '0.00', 'intv': '0', 'intoi': '0', 'v': '160550', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:29:00', 'ssboe': '1686131940', 'into': '525.40', 'inth': '525.95', 'intl': '522.00', 'intc': '522.00', 'intvwap': '523.40', 'intv': '3457', 'intoi': '0', 'v': '160550', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:28:00', 'ssboe': '1686131880', 'into': '526.90', 'inth': '526.90', 'intl': '525.05', 'intc': '526.45', 'intvwap': '526.08', 'intv': '1091', 'intoi': '0', 'v': '157093', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:27:00', 'ssboe': '1686131820', 'into': '523.80', 'inth': '526.95', 'intl': '523.80', 'intc': '524.20', 'intvwap': '524.21', 'intv': '1002', 'intoi': '0', 'v': '156002', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:26:00', 'ssboe': '1686131760', 'into': '523.85', 'inth': '524.00', 'intl': '523.00', 'intc': '523.00', 'intvwap': '523.66', 'intv': '1810', 'intoi': '0', 'v': '155000', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:25:00', 'ssboe': '1686131700', 'into': '526.70', 'inth': '526.70', 'intl': '523.00', 'intc': '525.70', 'intvwap': '524.83', 'intv': '6944', 'intoi': '0', 'v': '153190', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:24:00', 'ssboe': '1686131640', 'into': '525.20', 'inth': '526.10', 'intl': '525.10', 'intc': '526.10', 'intvwap': '523.76', 'intv': '415', 'intoi': '0', 'v': '146246', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:23:00', 'ssboe': '1686131580', 'into': '525.10', 'inth': '526.85', 'intl': '525.10', 'intc': '525.10', 'intvwap': '527.35', 'intv': '421', 'intoi': '0', 'v': '145831', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:22:00', 'ssboe': '1686131520', 'into': '525.50', 'inth': '526.20', 'intl': '525.00', 'intc': '525.05', 'intvwap': '524.36', 'intv': '895', 'intoi': '0', 'v': '145410', 'oi': '0'},'}]}

Cutting the request short because the website doesn’t allow me to add a complete response.

Suggestions

I believe the first 2 can be added to API docs as these are not assumed by the developers.
The docs should also have a complete request and response example like a file request.json and response.json to make it easy to visualize the exact response.
Docs should never have a dummy response unless the response data is sensitive.

This is another issue that occurs with Hour Candle.
The hour candle close in Trading view is at 08-06-2023 09:15:00 585.00 whereas the same candle in Firstock shows an hour close at 588.85. I’ve added data below to compare.

TradingView Screen shot

Firstock API data

timePriceSeries = broker.get_historical_candle().firstock_TimePriceSeries(
            exchange="NSE",
            token="SHAKTIPUMP-EQ",
            startTime="07/05/2023 00:00:00",
            endTime="08/06/2023 09:31:00",
            interval="60"
        )
timePriceSeries
{'status': 'Success', 'data': [{'stat': 'Ok', 'time': '08-06-2023 09:15:00', 'ssboe': '1686195900', 'into': '601.90', 'inth': '603.00', 'intl': '586.70', 'intc': '588.85', 'intvwap': '593.76', 'intv': '35276', 'intoi': '0', 'v': '35604', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 15:15:00', 'ssboe': '1686131100', 'into': '602.95', 'inth': '605.70', 'intl': '0.00', 'intc': '603.55', 'intvwap': '591.37', 'intv': '16420', 'intoi': '0', 'v': '328', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 14:15:00', 'ssboe': '1686127500', 'into': '606.70', 'inth': '608.00', 'intl': '599.00', 'intc': '602.80', 'intvwap': '603.63', 'intv': '32168', 'intoi': '0', 'v': '357603', 'oi': '0'}, {'stat': 'Ok', 'time': '07-06-2023 13:15:00', 'ssboe': '1686123900', 'into': '604.50', 'inth': '607.90', 'intl': '604.00', 'intc': '606.00', 'intvwap': '606.43', 'intv': '14208', 'intoi': '0', 'v': '325435', 'oi': '0'}, ...]}  # Request cut short 

When I look at Firstock’s other Historical candle data the ongoing candle is not included. Looking at this logic at 09:30 there should not be any 09:15 candle as ideally, the first-hour candle closes at 10:15 and only after this time it should be available in historical candle data.