hldh214 / buff2steam

Find item which cheaper than steamcommunity from buff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Steam Api Limit

volodymyrzuyev opened this issue · comments

Due to recent changes to the steam api limitations, you are able to look up 1-2 items before your hit the request limit.
You seem to be using /market/listings/{game_appid}/{market_hash_name} in order to get the price of the items, which in my experience has a really small request limit, while https://steamcommunity.com/market/priceoverview/?currency={currency}&appid={app_ip}&market_hash_name={name} has a much larger request limit. Info gathered from here https://github.com/Revadike/InternalSteamWebAPI

I am not good enough with python to modify someone else's code yet, but I'm pretty sure the bot would work a lot better if you change the API end point.

Thanks

I was confused while looking at the wiki: https://github.com/Revadike/InternalSteamWebAPI/wiki/Get-Market-Price-Overview ↗
I'm particularly interested in understanding the meaning of the volume field. It seems to be different from the total_count field in the /market/listings/ API, as they have different values.

Additionally, if we switch to using this API, we will lose the converted_fee field, which provides the actual price without the Steam fee.

What are your thoughts on this?

Based on my quick search, it appears that the Steam fee is fixed at 1.15. Therefore, the calculation for what you will receive after market fees is:

Price/1.15

I found this information on the following page: https://www.tobyscs.com/calculate-steam-market-fees ↗

Considering this, it seems that the converted_fee may not be an issue after all.

The volume field is the approximate number of said item that was sold in the last 24 hours. If it does not exist, that means the item was not sold in the last 24 hours.

And what about /market/itemordershistogram.

Currently we're using it to fetch the highest_buy_order and buy_order_count. I guess this API also have some restricted rate limit so we need to abandon it too(with not replacement, the b_o_ratio and the sell/want will be unavailable)?

There is probably no alternative for /market/itemordershistogram, but I am not sure if the rate limit on it is as harsh as on /market/listings/.

The /market/listings/ endpoint blocks you after 10-15 attempts if your rate is anything close to reasonable.

Also, you don't really have to check "every" item. It won't be that big of a deal if you miss some items since there are so many of them. /market/priceoverview besides the lowest_price, has volume and median_price (the average price in some period of time). Using these values it is possible to limit the number of items that you need to check with /market/itemordershistogram since if the median_price is a lot lower than the current lowest_price, or there has been no volume in the last 24 hours you are able to pretty safely ignore that item, and move on to the next one.

2023-08-25 16:02:26.779 | INFO     | __main__:main_loop:64 - buff_id/price: 830699/12.5; sell/want: 41/2967; volume: 19; b_o_ratio: 0.99; ratio: 0.92
2023-08-25 16:02:30.004 | INFO     | __main__:main_loop:64 - buff_id/price: 16233/34.6; volume: 0; ratio: 0.51
2023-08-25 16:02:33.933 | INFO     | __main__:main_loop:64 - buff_id/price: 490/186.8; volume: 0; ratio: 0.79
2023-08-25 16:02:38.846 | INFO     | __main__:main_loop:64 - buff_id/price: 7443/144.9; sell/want: 114/1091; volume: 10; b_o_ratio: 0.98; ratio: 0.89
2023-08-25 16:02:42.850 | INFO     | __main__:main_loop:64 - buff_id/price: 24157/14.77; sell/want: 538/51098; volume: 247; b_o_ratio: 0.99; ratio: 0.86
2023-08-25 16:02:46.820 | INFO     | __main__:main_loop:64 - buff_id/price: 14581/161.49; sell/want: 72/2186; volume: 21; b_o_ratio: 0.99; ratio: 0.91
2023-08-25 16:02:51.163 | INFO     | __main__:main_loop:64 - buff_id/price: 892152/63.8; sell/want: 89/970; volume: 6; b_o_ratio: 1.09; ratio: 0.91
2023-08-25 16:02:55.362 | INFO     | __main__:main_loop:64 - buff_id/price: 1084/26.68; sell/want: 28/1505; volume: 9; b_o_ratio: 1.10; ratio: 0.92
2023-08-25 16:03:02.148 | INFO     | __main__:main_loop:64 - buff_id/price: 9914/12.23; volume: 0; ratio: 0.65
2023-08-25 16:03:08.795 | INFO     | __main__:main_loop:64 - buff_id/price: 22134/6.44; sell/want: 128/1434; volume: 7; b_o_ratio: 0.94; ratio: 0.79
2023-08-25 16:03:12.824 | INFO     | __main__:main_loop:64 - buff_id/price: 4122/21.88; sell/want: 148/6436; volume: 21; b_o_ratio: 0.98; ratio: 0.81
2023-08-25 16:03:16.966 | INFO     | __main__:main_loop:64 - buff_id/price: 772581/11.9; sell/want: 155/35813; volume: 208; b_o_ratio: 1.03; ratio: 0.88
2023-08-25 16:03:17.968 | INFO     | __main__:main_loop:64 - buff_id/price: 9804/11.94; volume: 0; ratio: 0.63
2023-08-25 16:03:22.799 | INFO     | __main__:main_loop:64 - buff_id/price: 23608/6.44; sell/want: 54/1779; volume: 20; b_o_ratio: 1.04; ratio: 0.79
2023-08-25 16:03:28.318 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Crimson First of the Flood): Could not get orders data, skipping...
2023-08-25 16:03:28.318 | INFO     | __main__:main_loop:64 - buff_id/price: 772679/490.98; volume: 1; ratio: 0.89
2023-08-25 16:03:32.364 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Bracers of the Cavern Luminar): Could not get orders data, skipping...
2023-08-25 16:03:32.365 | INFO     | __main__:main_loop:64 - buff_id/price: 22889/11.33; volume: 479; ratio: 0.80
2023-08-25 16:03:36.389 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Dark Artistry Belt): Could not get orders data, skipping...
2023-08-25 16:03:36.389 | INFO     | __main__:main_loop:64 - buff_id/price: 15164/55.1; volume: 21; ratio: 0.83
2023-08-25 16:03:40.354 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Exalted Demon Eater): Could not get orders data, skipping...
2023-08-25 16:03:40.355 | INFO     | __main__:main_loop:64 - buff_id/price: 14578/112.5; volume: 20; ratio: 0.88
2023-08-25 16:03:44.533 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Dipper the Destroyer): Could not get orders data, skipping...
2023-08-25 16:03:44.533 | INFO     | __main__:main_loop:64 - buff_id/price: 781389/16.44; volume: 193; ratio: 0.82
2023-08-25 16:03:50.920 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Taunt: Bathed in the Glow): Could not get orders data, skipping...
2023-08-25 16:03:50.920 | INFO     | __main__:main_loop:64 - buff_id/price: 756665/5.79; volume: 76; ratio: 0.84
2023-08-25 16:03:55.006 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Inscribed Bloodstained Britches): Could not get orders data, skipping...
2023-08-25 16:03:55.007 | INFO     | __main__:main_loop:64 - buff_id/price: 8659/6.39; volume: 3; ratio: 0.88
2023-08-25 16:03:59.124 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Taunt: Totem Roller): Could not get orders data, skipping...
2023-08-25 16:03:59.125 | INFO     | __main__:main_loop:64 - buff_id/price: 780052/6.88; volume: 455; ratio: 0.84
2023-08-25 16:04:03.127 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Taunt: Deadly Grace): Could not get orders data, skipping...
2023-08-25 16:04:03.127 | INFO     | __main__:main_loop:64 - buff_id/price: 756659/6.96; volume: 260; ratio: 0.89
2023-08-25 16:04:07.119 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Shadow Masquerade): Could not get orders data, skipping...
2023-08-25 16:04:07.119 | INFO     | __main__:main_loop:64 - buff_id/price: 2186/7.36; volume: 400; ratio: 0.85
2023-08-25 16:04:09.178 | INFO     | __main__:main_loop:64 - buff_id/price: 7709/14.7; volume: 0; ratio: 0.85
2023-08-25 16:04:15.683 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Inscribed Magus Apex): Could not get orders data, skipping...
2023-08-25 16:04:15.683 | INFO     | __main__:main_loop:64 - buff_id/price: 6504/15.5; volume: 146; ratio: 0.94
2023-08-25 16:04:19.846 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Hydrakan Latch): Could not get orders data, skipping...
2023-08-25 16:04:19.847 | INFO     | __main__:main_loop:64 - buff_id/price: 9415/20.5; volume: 392; ratio: 0.89
2023-08-25 16:04:23.706 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Wavecutter): Could not get orders data, skipping...
2023-08-25 16:04:23.707 | INFO     | __main__:main_loop:64 - buff_id/price: 272/16.9; volume: 18; ratio: 0.81
2023-08-25 16:04:27.718 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Inscribed Arms of Desolation): Could not get orders data, skipping...
2023-08-25 16:04:27.718 | INFO     | __main__:main_loop:64 - buff_id/price: 9022/34.56; volume: 112; ratio: 0.88
2023-08-25 16:04:31.712 | INFO     | buff2steam.provider.steam:orders_data:114 - SteamAPI429Error(Magus Accord): Could not get orders data, skipping...
2023-08-25 16:04:31.712 | INFO     | __main__:main_loop:64 - buff_id/price: 3630/72.41; volume: 113; ratio: 0.85

Seems /market/itemordershistogram also blocking me after ~15 times call, so I have added a condition here, if we can access it we display it, otherwise we just display what we have.

That seems like a much better solution than the one I purposed. Great work!