Selling from a program
On the site the extension does this in a browser. A program does the same with its own access to Steam.
- Read your inventory from
https://steamcommunity.com/inventory/<steam_id>/730/2?l=english&count=2000and upload all its pages. - List items with your prices.
- List your sales. When a sale has
sendinactions, make the offer on Steam to the buyer's trade link. It gives this one item and asks for nothing. - Record the offer right after making it, and only then confirm it in Steam Guard.
- Send a report every three minutes while you have sales to follow, even an empty one. A deal moves only on these reports.
import os
import time
import requests
API = "https://api.rockvel.store/v1"
KEY = {"Authorization": f"Bearer {os.environ['ROCKVEL_KEY']}"}
def follow_sales():
sales = requests.get(f"{API}/trades/open", headers=KEY).json()
for sale in sales:
if "send" in sale["actions"]:
# Your own code: make the offer on Steam.
offer_id = make_offer(sale["trade_url"], sale["asset_id"])
requests.post(f"{API}/orders/{sale['id']}/offer", headers=KEY, json={"offer_id": offer_id})
confirm_in_steam_guard(offer_id)
# Your own code: read IEconService and keep what concerns these sales.
requests.post(f"{API}/trades/reports", headers=KEY, json=read_steam(sales))
while True:
follow_sales()
time.sleep(180)What a report counts
Take offers from IEconService/GetTradeOffers and trades from IEconService/GetTradeHistory. An offer counts for a sale only if it gives this item to this buyer, asks for nothing back and was made after the sale. A trade has to give this item to this buyer after the sale. If you can't read Steam, say so in problem, as silence stops the deals.
Offer states
9 | Waiting for Steam Guard: the offer is on record. |
|---|---|
2 | Active: the buyer can accept, and the deal goes to sent. |
3 | Accepted: the deal goes to protected. |
7 | Declined: the buyer gets the money back. |
6, 10 | Cancelled, by you or by Steam Guard: the buyer gets the money back. |
5 | Expired: the buyer gets the money back. |
1, 4 | Invalid or countered: the buyer gets the money back. |
8 | The item is gone: the buyer gets the money back. |
Trade statuses
0, 1 | Under way: nothing changes yet. |
|---|---|
2, 3 | Complete: the deal goes to protected. |
4 | Failed: the buyer gets the money back. |
12 | Reversed: the buyer gets the money back and the seller is banned for good. |
Any other number sends the deal to a person, and no money moves until they have looked.