> For the complete documentation index, see [llms.txt](https://apidocs-ga092.stockhero.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs-ga092.stockhero.ai/bot-execution/trade-log.md).

# Trade Log

This endpoint retrieves all the trades of the specified user

**Get List of Trades for a User**

<mark style="color:green;">**`GET`**</mark> **`https://api.aitrade.com/api/trades`**

**Query Params**

<table><thead><tr><th width="152">Name</th><th width="126">Type</th><th width="109" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>page_size</td><td>integer</td><td>false</td><td>maximum number of items returned per request</td></tr><tr><td>page</td><td>integer</td><td>false</td><td>Current page number for pagination</td></tr><tr><td>status</td><td>string</td><td>false</td><td>Filter the list by status, options are <code>open</code> or <code>close</code></td></tr><tr><td>side</td><td>string</td><td>false</td><td>filter the list by side, options are <code>BUY</code> or <code>SELL</code></td></tr></tbody></table>

**Responses:**

* Returns a list of trades including details such as `bot_name`, `side`, trade `time`, and more. Paginated response includes total trade counts.
* **Failure (401)**: Unauthenticated, indicating you're not logged in or lack permission to carry out the request.

{% tabs %}
{% tab title="200  successfully returned" %}

```javascript
{
    "code": 200,
    "message": "Success",
    "trades": {
        "current_page": 1,
        "data": [
            {
                "bot_name": "test mnqh24",
                "bot_type": "simple",
                "bot_rent_id": null,
                "base_name": "MNQH24",
                "quote_name": "USD",
                "quote_quantity": 17603,
                "filled": 1,
                "time": "2024-02-02 04:26:48",
                "side": "SELL",
                "pair": {
                    "id": 7696,
                    "from": "MNQH24",
                    "to": "USD",
                    "name": "MNQH24-USD",
                    "kline_exchange_id": 18,
                    "quote_image": "https://yourdomain/path_to_image_file",
                    "base_image": "https://yourdomain/path_to_image_file"
                }
            }
        ],
        "first_page_url": "https://api.stockhero.ai/api/deals/trades?page=1",
        "from": 1,
        "last_page": 27,
        "last_page_url": "https://api.stockhero.ai/api/deals/trades?page=27",
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "https://api.stockhero.ai/api/deals/trades?page=1",
                "label": "1",
                "active": true
            },
           
            {
                "url": "https://api.stockhero.ai/api/deals/trades?page=2",
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "next_page_url": "https://api.stockhero.ai/api/deals/trades?page=2",
        "path": "https://api.stockhero.ai/api/deals/trades",
        "per_page": 10,
        "prev_page_url": null,
        "to": 10,
        "total": 263
    }
}
```

{% endtab %}

{% tab title="401 Unauthenticated" %}

```
{
  "code": 401,
  "success": false,
  "message": "Unauthenticated."
}
```

{% endtab %}
{% endtabs %}
