We can create a basket of multiple F&O contracts on the portal and check the exact margin requirements. How to do the same margin requirement requests through Kiteconnect python API. We tried using the margins() function but it doesn't seem to work similarly to the basket.
Following is the code snippet for the margins API call we used-