Dear Upstox Community,
We are in the process of developing an algorithmic trading system using Upstox APIs, and we are specifically targeting weekly options trading strategies.
As part of our requirement, we need to programmatically:
- Retrieve the entire option chain for a selected index (e.g., NIFTY or BANKNIFTY) for the current weekly expiry.
- Fetch all available strike prices along with their corresponding Call LTP (Last Traded Price) and Put LTP.
- Dynamically determine the current spot price of the underlying index in real time.
- Run a condition to identify the closest strike price within a ±200 range from the spot price, and filter only those contracts for further analysis.
Could you please guide us on:
- Which specific Upstox API endpoint(s) should be used to fetch the option chain data, including all strike prices and their respective Call/Put LTPs?
- What is the recommended way to obtain the live spot price of an index (NIFTY/BANKNIFTY) through your streaming or REST APIs?
- Any additional best practices or limitations we should be aware of while implementing this logic?
We would appreciate code examples or official documentation references, if available.
Thank you in advance for your support.
Best regards,