deivit24 / python-steam-api

MIT License
25 stars 11 forks source link

Get discount end date #31

Open wokcito opened 1 month ago

wokcito commented 1 month ago

Hi, I was trying to use /appdetails endpoint, but I need know when a game's discount finish.

I tried to figure out how steamdb gets this information but I wasn't able to find the endpoint or the filter that gives this information.

deivit24 commented 1 month ago

Hmm I will take a look Sunday! Vacation at the moment

deivit24 commented 1 month ago

@wokcito Hey! sorry for just getting back to you. I just took a look and I think you can do something like this:

steam.apps.get_app_details(<app_id>, filters='price_overview,basic')

and you will get all the basic information plus the discount information. At least what I think will be something like discount information:

{'price_overview': {'currency': 'USD', 'initial': 999, 'final': 999, 'discount_percent': 0, 'initial_formatted': '', 'final_formatted': '$9.99'}

does this help?

wokcito commented 1 month ago

@deivit24 Thanks! But I was needing when a discount finish. I asked in other repos and the solution is doing web scraping, to my knowledge. This information can't be obtained from the Steam API.

deivit24 commented 1 month ago

@wokcito ohhh I see... I never read anything properly. You don't mind if you can paste an example url? I do have an api where I do web scraping so I'm wondering if it's something I can implement or create an additional API for that use case. Sounds interesting

wokcito commented 1 month ago

@deivit24 here is the response I got, if it is useful for you, there is a repo with code that gets information about a game using scraping.

What's your web?

deivit24 commented 1 month ago

I use this url "https://store.steampowered.com/search/suggest" when I scrape

And sorry I meant what is an example url where you find discount end date I formation

wokcito commented 1 month ago

I'm planning to do a page where users search games with the endpoint that filters by name, detect if it has a discount with /appdetails, and then get somehow when the discount finish. It's not like a SteamDB, this would have other purposes.

That url can help me filtering the game directly