deivit24 / python-steam-api

MIT License
25 stars 11 forks source link

How to use the filters in get_app_details #12

Closed zheage closed 9 months ago

zheage commented 9 months ago

I'm having trouble when trying to use the function get_app_detailsto search for specific informations of games.

The code is:

`game_id = 1048250

user = steam.apps.get_app_details(game_id, country = "BR", filters = "name,platforms,price_overview")`

the response:

{'1048250': {'success': True, 'data': {'platforms': {'windows': True, 'mac': False, 'linux': False}}}}

I tryed to pass a list as input of filters parameter and isn't work too. Can someone help me?

image

UnreleasedDev commented 9 months ago

@zheage filters only accepts str or None convert list to str before passing

something like this should work

filters_list = ["name", "platforms", "price_overview"]
filters_str = ','.join(filters_list)
game_id = 1048250
user = steam.apps.get_app_details(game_id, country="BR", filters=filters_str)
print(user)