User is using API Python to retrieve EOD data but received an error

ek.set_app_key('4e49391e9c524b9081b97cdbc046113aa317f957')
screener_exp ='SCREEN(U(IN(Equity(active,public,primary))), IN(TR.ExchangeCountryCode,TH))'

field2 = ['TR.TickerSymbol','TR.PriceCloseDate','TR.PriceOpen','TR.PriceHigh','TR.PriceLow','TR.CLOSEPRICE','TR.Volume','TR.TSVWAP','TR.CompanyMarketCap']

parameter={'SDate':0, 'EDate':0, 'Frq' : 'D' }

df = pd.DataFrame()
df, e = ek.get_data(screener_exp,fields=field2, parameters=parameter)


The error that client received

Instrument HTECH.BK
Ticker Symbol HTECH
Date 2022-12-21T00:00:00Z
Price Open 3.94
Price High 3.98
Price Low 3.92
Close Price NaN
Volume 124100
VWAP NaN
Company Market Cap 1.188e+09
----------------------------------------------------------------------------------

no vwap and close_price , and retrieve only 8-10 stocks .

Best Answer

  • Try '0' as string value of 'SDate' and 'EDate' in parameter instead of numeric 0.

    api.png

Answers