I'm trying to get buy and sell orders in JSON format like with the price history, but couldn't find any info. Is there a method to do so?
Buy and Sell orders screenshot
I tried:
https://steamcommunity.com/market/pricehistory/?country=ru¤cy=3&appid=730&market_hash_name=Operation%20Riptide%20Case
And:
https://steamcommunity.com/market/listings/730/AWP%20%7C%20Asiimov%20%28Field-Tested%29/render?start=0&count=1¤cy=3&language=english&format=json
But they don't display buy and sell orders. Thanks
Try this endpoint:
https://steamcommunity.com/market/itemordershistogramIt's the orderbook chart at the bottom of the market pages of popular items, but you can fetch it for any item. Parameters are:
country,currency,language,item_nameid, andtwo_factor.Just for example parameters, my
country,currency, andlanguageareUS,1(USD), andenglish.two_factorcan always be set to0, anditem_nameidis what defines which item you're looking up. There's not an easy way to find it, but you can scrape it from herehttps://steamcommunity.com/market/listings/<appid>/<market_hash_name>for each item you need. You can find it passed as an argument to theMarket_LoadOrderSpreadfunction in the page source. Scraping the ids from this page though is rate limited to ~5 requests per minute.Best of luck!
Edit: As Illia mentions in more detail below, setting the
Refererheader seems to significantly increase the rate at which you can send requests to this endpoint without hitting a rate limit.