I’m trying to fetch historical OHLC data for the stock MOTHERSON (NSE_EQ|INE775A08105) using the Upstox v3 Historical Candles API, but I’m getting an empty candles array despite a successful response.
Details:
-
Symbol: MOTHERSON
-
Instrument Key:
NSE_EQ|INE775A08105 -
Date Range: Last 7 days.
-
API Endpoint
GET https://api.upstox.com/v3/historical-candle/{instrument_key}/days/1/{to_date}/{from_date}
Success Case:
Other symbols (e.g., NSE_EQ|INE262H01021for PERSISTENT) return candle data correctly with the same logic and date range.
Problem:
For MOTHERSON, the response status is 200 OK, but the candles array is empty:
{
"status": "success",
"data": {
"candles": []
}
}
Sample Code Used:
import requests
from datetime import date, timedelta
# Instrument key for MOTHERSON
instrument_key = "NSE_EQ|INE775A08105"
# Date range: last 30 days (excluding today)
to_date = date.today() - timedelta(days=1)
from_date = to_date - timedelta(days=7)
# Construct URL
unit = 'days'
interval = '1'
url = f'https://api.upstox.com/v3/historical-candle/{instrument_key}/{unit}/{interval}/{to_date.strftime("%Y-%m-%d")}/{from_date.strftime("%Y-%m-%d")}'
headers = {'Accept': 'application/json'}
print(f"Fetching from URL: {url}")
response = requests.get(url, headers=headers)
print(f"Status Code: {response.status_code}")
print(f"Response: {response.json()}")
Observations:
-
The instrument key appears correct — it matches the one returned by Upstox search instruments endpoint.
-
No error in API syntax; other stocks work fine.
-
Tried multiple date ranges (including known trading periods), still no candles.
-
Symbol wasn’t renamed recently — MOTHERSON has been active.
-
Same problem for this instrument in V2 API as well.
Questions:
-
Is there a known issue with certain NSE symbols like MOTHERSON in the Upstox historical data feed?
-
Should I use a different instrument key format or endpoint?
Any guidance from Upstox support or community would be greatly appreciated!