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/itemordershistogram
It'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
, and two_factor
.
Just for example parameters, my country
, currency
, and language
are US
, 1
(USD), and english
. two_factor
can always be set to 0
, and item_nameid
is what defines which item you're looking up. There's not an easy way to find it, but you can scrape it from here https://steamcommunity.com/market/listings/<appid>/<market_hash_name>
for each item you need. You can find it passed as an argument to the Market_LoadOrderSpread
function 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 Referer
header seems to significantly increase the rate at which you can send requests to this endpoint without hitting a rate limit.