import pandas as pd
import requests
url = 'https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json'
print(url)
d = requests.get(url).json()
tokendf =pd.DataFrame.from_dict(d)
temp1=tokendf[tokendf['exch_seg'].str.contains('NSE') == True]
token=temp1[temp1['symbol'].str.contains('-EQ') == True]
print(token)
#to convert in CSV format
#token.to_csv("D:/test.csv")