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.

  1. Read your inventory from https://steamcommunity.com/inventory/<steam_id>/730/2?l=english&count=2000 and upload all its pages.
  2. List items with your prices.
  3. List your sales. When a sale has send in actions, make the offer on Steam to the buyer's trade link. It gives this one item and asks for nothing.
  4. Record the offer right after making it, and only then confirm it in Steam Guard.
  5. 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

9Waiting for Steam Guard: the offer is on record.
2Active: the buyer can accept, and the deal goes to sent.
3Accepted: the deal goes to protected.
7Declined: the buyer gets the money back.
6, 10Cancelled, by you or by Steam Guard: the buyer gets the money back.
5Expired: the buyer gets the money back.
1, 4Invalid or countered: the buyer gets the money back.
8The item is gone: the buyer gets the money back.

Trade statuses

0, 1Under way: nothing changes yet.
2, 3Complete: the deal goes to protected.
4Failed: the buyer gets the money back.
12Reversed: 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.