Trade API

Trade API Documentation

Search trade history, export CSV files, and view trending powers from one API endpoint.



Base Endpoint
https://pythbots.com/api/trade.php

The Trade API can return data from two different sources:

  • Raw trade history from the
    trades
    table

  • Trending / summarized power data from the
    avg
    table



What This API Can Do

  • Search trades by power

  • Search by user ID

  • Filter by buy or sell

  • Filter by exact date or date range

  • Filter by amount and per-day price

  • Export results as CSV

  • View the top 3 trending powers


  • Basic Examples

    All trades


    https://pythbots.com/api/trade.php

    Search by power


    https://pythbots.com/api/trade.php?power=gold

    Search by user ID


    https://pythbots.com/api/trade.php?user_id=221192

    Buy trades only


    https://pythbots.com/api/trade.php?type=buy

    Sell trades only


    https://pythbots.com/api/trade.php?type=sell



    Parameters

    power


    Search one exact normalized power name.

    https://pythbots.com/api/trade.php?power=gold

    Power search is an exact match after normalization.
    For example,
    gold
    matches
    gold
    , but not
    golden
    .

    userid


    Return trades for one specific user ID.

    https://pythbots.com/api/trade.php?user_id=221192

    username


    Search by username using a partial match.

    https://pythbots.com/api/trade.php?username=mathias

    type


    Allowed values:
  • buy

  • sell
  • https://pythbots.com/api/trade.php?type=buy

    date


    Search one exact day.

    Accepted format:

    dd.mm.yy

    Example:

    https://pythbots.com/api/trade.php?date=17.03.26

    datefrom and dateto


    Search a date range.

    https://pythbots.com/api/trade.php?date_from=01.03.26&date_to=17.03.26

    timefrom and timeto


    Search a time range.

    https://pythbots.com/api/trade.php?time_from=10:00&time_to=18:00

    amountmin and amountmax


    Filter by trade amount.

    https://pythbots.com/api/trade.php?amount_min=100&amount_max=5000

    perdaymin and perdaymax


    Filter by per-day value.

    https://pythbots.com/api/trade.php?per_day_min=2&per_day_max=20

    dayscount


    Return trades for powers with a specific day count.

    https://pythbots.com/api/trade.php?days_count=30

    hasprice


    Filter by whether the row has a price.

  • 1
    = only rows with prices

  • 0
    = only rows without prices
  • https://pythbots.com/api/trade.php?has_price=1
    https://pythbots.com/api/trade.php?has_price=0

    raw


    Search inside the original stored trade message.

    https://pythbots.com/api/trade.php?raw=buy%20gold

    sort


    Allowed sort fields:

  • id

  • username

  • user_id

  • date

  • time

  • type

  • power

  • amount

  • days_count

  • per_day

  • created_at
  • Example:

    https://pythbots.com/api/trade.php?sort=amount&order=desc

    order


    Allowed values:
  • asc

  • desc
  • https://pythbots.com/api/trade.php?sort=amount&order=asc

    limit


    Control how many rows are returned.

    https://pythbots.com/api/trade.php?limit=25

    offset


    Useful for pagination.

    https://pythbots.com/api/trade.php?limit=25&offset=25

    summaryonly


    Return only summary totals without the full row list.

    https://pythbots.com/api/trade.php?power=gold&summary_only=1

    exclude_unknown


    Hide rows where the username is blank or
    Unknown
    .

    https://pythbots.com/api/trade.php?power=gold&exclude_unknown=1



    Output Formats

    Default JSON output


    https://pythbots.com/api/trade.php?power=gold

    CSV export


    Add
    format=csv
    .

    https://pythbots.com/api/trade.php?power=gold&format=csv
    https://pythbots.com/api/trade.php?user_id=221192&format=csv

    All normal search filters work with CSV export too.



    Trending Powers

    Trending mode uses the

    avg
    table and returns the top 3 powers.

    Top 3 by total trade count


    https://pythbots.com/api/trade.php?trending=1

    Top 3 by average overall price


    https://pythbots.com/api/trade.php?trending=1&trending_by=avg_all

    Top 3 by average buy price


    https://pythbots.com/api/trade.php?trending=1&trending_by=avg_buy

    Top 3 by average sell price


    https://pythbots.com/api/trade.php?trending=1&trending_by=avg_sell

    Top 3 by highest max price


    https://pythbots.com/api/trade.php?trending=1&trending_by=max_price

    Top 3 by minimum price


    https://pythbots.com/api/trade.php?trending=1&trending_by=min_price

    Export trending powers as CSV


    https://pythbots.com/api/trade.php?trending=1&format=csv

    Filter trending by power


    https://pythbots.com/api/trade.php?trending=1&power=gold

    Filter trending by day count


    https://pythbots.com/api/trade.php?trending=1&days_count=30

    Trending mode uses the
    avg
    table.
    Normal trade searches use the
    trades
    table.



    Clean Example URLs

    One power


    https://pythbots.com/api/trade.php?power=gold

    One power as CSV


    https://pythbots.com/api/trade.php?power=gold&format=csv

    One user


    https://pythbots.com/api/trade.php?user_id=221192

    One user, buy trades only


    https://pythbots.com/api/trade.php?user_id=221192&type=buy

    Date range


    https://pythbots.com/api/trade.php?date_from=01.03.26&date_to=17.03.26

    Amount range


    https://pythbots.com/api/trade.php?amount_min=100&amount_max=5000

    Only rows with prices


    https://pythbots.com/api/trade.php?has_price=1

    Summary only


    https://pythbots.com/api/trade.php?power=gold&summary_only=1

    Trending powers


    https://pythbots.com/api/trade.php?trending=1

    Trending as CSV


    https://pythbots.com/api/trade.php?trending=1&format=csv



    JSON Response Structure

    A normal JSON response includes:

  • ok

  • filters

  • summary

  • grouped.by_power

  • grouped.by_user

  • grouped.by_date

  • count_returned

  • rows
  • Example shape:

    {
      "ok": true,
      "filters": { ... },
      "summary": { ... },
      "grouped": {
        "by_power": [ ... ],
        "by_user": [ ... ],
        "by_date": [ ... ]
      },
      "count_returned": 25,
      "rows": [ ... ]
    }

    Summary fields


    The
    summary
    object may contain:

  • total_rows

  • unique_users

  • unique_powers

  • total_buys

  • total_sells

  • priced_rows

  • unpriced_rows

  • min_amount

  • max_amount

  • avg_amount

  • avg_per_day

  • earliest_date

  • latest_date


  • Trending Response Structure

    Trending mode returns:

  • ok

  • trending.sort_by

  • trending.count

  • trending.rows
  • Example shape:

    {
      "ok": true,
      "trending": {
        "sort_by": "trades",
        "count": 3,
        "rows": [
          {
            "power": "gold",
            "trades": 42,
            "avg_all": 1200,
            "avg_buy": 1100,
            "avg_sell": 1300,
            "min_price": 800,
            "max_price": 2000,
            "last_seen": "17.03.26 14:10"
          }
        ]
      }
    }



    Important Notes

    Dates must be passed in
    dd.mm.yy
    or
    dd.mm.yyyy
    format.

    Normal searches and trending searches use different tables:

  • Normal search =
    trades

  • Trending search =
    avg
  • By default, rows with username
    Unknown
    are included.
    Use
    exclude_unknown=1
    only if you want to hide them.



    Quick Reference
    https://pythbots.com/api/trade.php
    https://pythbots.com/api/trade.php?power=gold
    https://pythbots.com/api/trade.php?user_id=221192
    https://pythbots.com/api/trade.php?type=buy
    https://pythbots.com/api/trade.php?date=17.03.26
    https://pythbots.com/api/trade.php?date_from=01.03.26&date_to=17.03.26
    https://pythbots.com/api/trade.php?amount_min=100&amount_max=5000
    https://pythbots.com/api/trade.php?per_day_min=2&per_day_max=20
    https://pythbots.com/api/trade.php?has_price=1
    https://pythbots.com/api/trade.php?summary_only=1
    https://pythbots.com/api/trade.php?format=csv
    https://pythbots.com/api/trade.php?trending=1
    https://pythbots.com/api/trade.php?trending=1&trending_by=avg_all
    https://pythbots.com/api/trade.php?trending=1&format=csv

    End of Trade API documentation