Hi @_serotonin,
Historical data for expired contracts is not available.
Additionally, you may refer to this post for guidance on generating instrument keys. A complete list of all instrument keys is also available in our JSON files here: Upstox Instruments JSON.
Thank you!