Problem with SCREEN function in web scripting API

I have screen that works in Excel API, but not in Web scripting API (Python). What do I need to change? "SCREEN(U(IN(Equity(active,public,primary,countryprimaryquote))), IN(TR.ExchangeCountryCode,""ZA"")),CFRJ.J"

Best Answer

  • You need to request at least one field (ex: TR.PriceClose).

    Following code is running well:

    >>> ek.get_data("SCREEN(U(IN(Equity(active,public,primary,countryprimaryquote))), IN(TR.ExchangeCountryCode,'ZA')),CFRJ.J","TR.PriceClose")
    ( Instrument Price Close
    0 CCOJ.J 4737.0
    1 RACPp.J 2150.0
    2 LHCJ.J 2562.0
    3 RSGJ.J 188.0
    .. ... ...
    409 NFTRCIJ.J 2286.0
    410 NFGOVIJ.J 5540.0
    411 PREFTXJ.J 844.0
    412 CFRJ.J 12115.0
    [413 rows x 2 columns], None)

Answers

  • @Johann-Lourens, a workaround if you just want to retrieve RIC list, you can also request a not existing field (much faster to execute):

    >>> data,err=ek.get_data("SCREEN(U(IN(Equity(active,public,primary,countryprimaryquote))), IN(TR.ExchangeCountryCode,'ZA')),CFRJ.J","Instrument")
    >>> data
    Instrument INSTRUMENT
    0 CCOJ.J NaN
    1 RACPp.J NaN
    2 LHCJ.J NaN
    3 RSGJ.J NaN
    .. ... ...
    409 NFTRCIJ.J NaN
    410 NFGOVIJ.J NaN
    411 PREFTXJ.J NaN
    412 CFRJ.J NaN
    [413 rows x 2 columns]