Trade Log

This endpoint retrieves all the trades of the specified user

Get List of Trades for a User

GET https://api.aitrade.com/api/trades

Query Params

Name
Type
Required
Description

page_size

integer

maximum number of items returned per request

page

integer

Current page number for pagination

status

string

Filter the list by status, options are open or close

side

string

filter the list by side, options are BUY or SELL

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.

{
    "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": "« 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 »",
                "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
    }
}

Last updated