#Import the icepython library
#Make sure to read our quick start guide! Additional support can be reached by contacting [email protected]
import icepython as ice
#Option Autolisting
#Returns all expirations for a given product/security
symbols = ice.get_autolist('***BRN-ICE')
print(symbols)
#Option Autolisting
#All Expirations Futures - when exchange suffix is not present add 'fut'
symbols = ice.get_autolist('***sb fut')
print(symbols)
#Option Autolisting
#All Expirations Stocks - when exchange suffix is not present add 'stk'
symbols = ice.get_autolist('***sb stk')
print(symbols)
#All Options for a given expiration
symbols = ice.get_autolist('***brn-ice z24')
print(symbols)
#At the Money Options for a given expiration
symbols = ice.get_autolist('***brn-ice m22 ATM:10')
print(symbols)
#Out of the Money Options for a given expiration
symbols = ice.get_autolist('***brn-ice m22 OTM:10')
print(symbols)
#In of the Money Options for a given expiration
symbols = ice.get_autolist('***brn-ice m22 ITM:10')
print(symbols)
#Only Calls for a given expiration
symbols = ice.get_autolist('***brn-ice m24 C')
#Only Puts for a given expiration
#symbols = ice.get_autolist('***brn-ice m24 P')
print(symbols)
#Quote - Volume, Trade and Block Prices, Open Interest, and Vol for all strikes on a given expiration
import pandas as pd
symbols = ice.get_autolist('***brn-ice z21')
fields = ['Last','Block Price','Volume','OpenInt','ImpVol']
data = ice.get_quotes(symbols,fields,True)
df = pd.DataFrame(list(data))
print(df)