Special thanks to the generous sponsorship by:
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
Table of contents generated with markdown-toc
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_id
in 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.
Requirements
To use buff2steam, you need to have:
python >= 3.7
pip install --user pipenv
pipenv sync
cp 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": {
"game": "csgo", // dota2
"game_appid": "730", // 570
"accept_buff_threshold": 0.65, // acceptable ratio
"min_price": 500, // CNY, 500 == 5 yuan
"max_price": 30000 // CNY, 30000 == 300 yuan
},
"buff": {
"request_interval": 4, // buff api request interval (in seconds)
"requests_kwargs": {
"headers": {
"cookie": "session=1-GyCKVt_sSLoNtu2yeM9hY8FPeWTr8Q6ayOYIifqxKLM82044786689"
}
}
},
"steam": {
"request_interval": 20, // steam api request interval (in seconds)
}
}
buff_session
To set the buff_session
field in config.json
, follow these steps:
- Open https://buff.163.com/market/ in Chrome
- Press
F12
to open the developer console - Go to the
Network
tab and refresh the webpage - Filter by
Doc
and findsession
in theSet-Cookie
field underResponse Headers
- Copy the value of
session
and 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.