Api data could not found

<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.upstox.com/v2/option/contract?instrument_key=NSE_FO%7C37590&expiry_date=2025-02-03', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJrZXlfaWQiOiJza192MS4wIiwiYWxnIjoiSFMyNTYifQ.eyJzdWIiOiIzQUNXTDYiLCJqdGkiOiI2N2ExYjZmZTQ5MTFkMDE4NTIwMGNiMDkiLCJpc011bHRpQ2xpZW50IjpmYWxzZSwiaWF0IjoxNzM4NjUxMzkwLCJpc3MiOiJ1ZGFwaS1nYXRld2F5LXNlcnZpY2UiLCJleHAiOjE3Mzg3MDY0MDB9.y3W1Xbzs5cgImOUaLupFcB5fAS3kMKQtDqa0n881gHk', 'Cookie: __cf_bm=iOdPS.455EWsFD7ViG2jxzyBHK4ZHlMM4GtE9KvnZ6Q-1738651175-1.0.1.1-0d92exjxAYuHq4iB_MkXNB4DgEz2VI6u7IZR7bJ6c10P7f7zWW2VSaiTMjqZx3NB; _cfuvid=UPzUJafI0BPzCk0dddiHu.E6Nmx.aKQMChoNSOr0YwE-1738651175296-0.0.1.1-604800000' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; This is the response I am generating Please solve the issue

I noticed that you’re using an option contract in the option chain URL, which won’t work because contracts don’t have option chains. Please provide an index instrument key to retrieve option chain data.

You can refer to these sample codes for implementation:
Option Chain Example Code

Thank you!

Can you please explain me how to get index instrument key ?
Coz I don’t know about that.

For example, the instrument key for Nifty 50 is NSE_INDEX|Nifty 50, and similarly, the instrument key for Nifty Bank is NSE_INDEX|Nifty Bank.

You can find a complete list of instrument keys in this JSON file: Instruments JSON.

Thanks.