Other players

Trading

The trading post, vendors and the guild bank.

trading_post

Prices are in copper. trading_post.query asks for an item's listings; the answer comes later, in the on_trading_post_query callback.

function on_trading_post_query(result)
    local best = result.sells[1]
    if best then print(result.item_id, best.price, best.quantity) end
end

trading_post.query(19721)
Whether the trading post is open.
Asks for an item's buy and sell listings.
Places a buy order at price each.
Lists an Item for sale at price each.
Whether you're listing too fast.
Your orders: {order_id, item_id, price, quantity, created, buy_order}.
What's waiting to be picked up: {coins, items}.
Picks it all up.

vendor

Whether a vendor window is open.
The open tab: {idx, tab_type, name, count}.
What the vendor sells: {idx, item, quantity, payment}, each payment {kind = "item", item, quantity} or {kind = "currency", currency, quantity}.
Buys an item.
Sells an Item.
Sells all junk.
Closes the vendor.
Vendor tabs
TAB_BUYTAB_SELLTAB_BUYBACK

guild_bank

The guild bank's bags: {slot, gold, capacity, items}, each item {slot, quantity, item}.
Deposits from one of your slots.
Withdraws into one of your slots.