Buff2steam
Find item which cheaper than steamcommunity from buff
Install / Use
/learn @hldh214/Buff2steamREADME
Buff2steam
Welcome to buff2steam, a Python script for finding items on buff that are cheaper than on Steam Community Market. This readme provides an overview of the project and instructions on how to use it.
Disclaimer: Recently, some users have reported that their accounts were banned by Buff for using this project. Please be careful and use at your own risk.
Table of Contents
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
Introduction
buff2steam is a script, for crawling items from buff which cheaper than steamcommunity.
With buff2steam, you can crawl items on buff and compare their prices to those
on steamcommunity. After setting the threshold in the config.json file, the
script will automatically calculate the price difference and filter out matching items.

The output includes:
buff_id:goods_idin url: https://buff.163.com/market/goods?goods_id=2334price: item price on buffsell/want: item sell/buy order count on steamcommunity marketb_o_ratio: ratio obtained by selling this item to the highest buy order in the steamcommunity market immediately (transaction fee included)ratio: possible ratio obtained by selling this item with the lowest sell order price in the steamcommunity market (transaction fee included)
The last two ratios are the ratio of the price difference. The lower the value, the better, and it means that you have obtained the discounted steam wallet balance through this transaction.
Then you can buy items from buff manually and sell them to the steamcommunity.
Webgui
A small webgui is hosted on 127.0.0.1:1821 (more work needed)
Requirements
To use buff2steam, you need to have:
python >= 3.7pip install --user pipenvpipenv synccp config.sample.json config.json
Usage
# Use the UTF-8 mode on Windows
export PYTHONUTF8=1
# activate a new shell with pipenv
pipenv shell
python -m buff2steam
# or run directly inside pipenv
pipenv run python -m buff2steam
Run with Docker
# Build image yourself
docker buildx build -t buff2steam_local .
docker run -e buff2steam_local
# Or use prebuilt image
docker run -it --name buff2steam --rm -v $PWD/config.json:/app/config.json ghcr.io/hldh214/buff2steam
Configuration
config.json
{
"main": {
"debug": true, // false
"game": "csgo", // dota2
"game_appid": "730", // 570
"accept_buff_threshold": 0.65, // acceptable ratio
"accept_steam_threshold": 0.8, // acceptable maximum ratio before fetching prices (in case of Steam API ratelimit)
"min_volume": 0, // minimal number of sales in 24 hours for an item to be viable
"min_price": 500, // CNY, 500 == 5 yuan
"max_price": 30000, // CNY, 30000 == 300 yuan
"webgui_refresh_time": 1 // update time of webgui in seconds or false, for none
},
"buff": {
"sort_by": "sell_num.desc", // sort by Quantity (descending), Available options: null, "price.asc", "price.desc", "sell_num.desc"
"request_interval": 4, // buff api request interval (in seconds)
"requests_kwargs": {
"headers": {
"cookie": "session=1-GyCKVt_sSLoNtu2yeM9hY8FPeWTr8Q6ayOYIifqxKLM82044786689",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
"Referer": "https://buff.163.com/market/dota2",
"X-Requested-With": "XMLHttpRequest"
}
}
},
"steam": {
"request_interval": 4, // steam api request interval (in seconds)
"requests_kwargs": {
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
}
}
}
}
buff_session

To set the buff_session field in config.json, follow these steps:
- Open https://buff.163.com/market/ in Chrome
- Press
F12to open the developer console - Go to the
Networktab and refresh the webpage - Filter by
Docand findsessionin theSet-Cookiefield underResponse Headers - Copy the value of
sessionand paste it intoconfig.json->buff.requests_kwargs.headers.cookie
StarChart
License
buff2steam is open-source software licensed under the Unlicense License. See the LICENSE file for more information.
