Stock Screener Python Library: Industry not working?

Hi there…

I’m trying to screen for stocks in a specific industry but I always get back an empty data frame.

I’ve tried “=” and “match”. I’ve also tried url encoding the industry… trying all upper case… all lower case… using a regex… and different escaping parameters.

I’m at a loss. Here’s the code that “should” work…

from eodhd import APIClient
import pandas as pd
import config as cfg
client = APIClient(cfg.API_KEY)
screener_extended = client.stock_market_screener (filters = [["industry","match","Semiconductor Memory"],["exchange","=","us"]], limit = "10", offset = "0")
screener_m = pd.DataFrame(screener_extended)
print(screener_m)

Here’s the output…

Empty DataFrame
Columns: [data]
Index: []

Process finished with exit code 0

Thank you in advance for any help…

I think the problem arises because the sector/industry classifications are more generalized. For instance, if you specify “Semiconductors” as the Industry parameter in your script, it will provide you with a list of companies that operate within that specific industry:

from eodhd import APIClient
API_KEY = ‘PLACE_YOUR_API_KEY_HERE’
import pandas as pd
client = APIClient(API_KEY)
screener_extended = client.stock_market_screener (filters = [[“industry”,“=”,“Semiconductors”],[“exchange”,“=”,“us”]], limit = “100”, offset = “0”)
screener_m = pd.DataFrame(screener_extended)
print(screener_m)

Thank you, Alex! That makes sense. “Memory” is a sub-industry.

Thank you again for helping so quickly today.