# Get data for the Statistics widget

Use the following two methods to get information for display in the **Statistics** widget for a specific master or investment account:

* <mark style="color:green;">`GET`</mark> `[host]/api/v1/investment/widget/detail/{account}`
* <mark style="color:green;">`GET`</mark> `[host]/api/v1/investment/widget/statistics/{account}`

## Get details for the widget

<mark style="color:green;">`GET`</mark> `[host]/api/v1/investment/widget/detail/{account}`

This method returns information about the fee plan created for a master account, number of followers, account return, chart data, profile picture, strategy description, and other relevant information. In the widget, the returned information is displayed as follows:

<figure><img src="/files/VLDVwQdplXMYb40BuR6E" alt="Statistics widget"><figcaption><p>Statistics widget</p></figcaption></figure>

### **Request**

**Headers**

`Authorization: Bearer <access_token>`

**Path parameter**

<table><thead><tr><th width="272">Name</th><th width="125">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>account</code></td><td>Yes</td><td>The MT login (number) of an account for which you want to get information.</td></tr></tbody></table>

**Query parameter**

<table><thead><tr><th width="273">Name</th><th width="103">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>investment_platform_id</code></td><td>Yes</td><td><p>The identifier of the investment platform instance.</p><ul><li>If only one MT server is connected to your B2COPY investment platform, specify 1.</li><li>If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.</li></ul></td></tr></tbody></table>

**Request example**

```sh
curl --location --request GET 'https://host.name/api/v1/investment/widget/detail/77616894?investment_platform_id=1' \
--header 'Authorization: Bearer <token>'
```

### **Response**

The response includes the object providing details about the requested account for display in the **Statistics** widget.

<details>

<summary><strong>Response example</strong></summary>

```
{
    "status": 200,
    "meta": {
        "behaviours": [],
        "status": 200
    },
    "data": {
        "id": 32065,
        "aum": 25091.19,
        "followers": 4,
        "badge": {
            "activity": 1
        },
        "created": "2024-07-18 08:19:11",
        "currency": "USD",
        "description": "Trading strategy description",
        "fees": {
            "plan_id": 112,
            "performance_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "performance_fee": "10",
            "management_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "management_fee": "2",
            "profit_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "profit_fee": "10",
            "subscription_fee_period": {
                "value": 1,
                "caption": "Daily"
            },
            "subscription_fee": "1",
            "volume_fee": "1",
            "joining_fee": "1"
        },
        "minichart": {
            "points": [
              {
                "etwr": 0,
                "btwr": 0,
                "balance": 1000,
                "equity": 1000,
                "timestamp": 1721290807
            }
            ],
            "count": 40
        },
        "name": "Account name",
        "requirements": {
            "minDeposit": 0
        },
        "risk": 86,
        "user": {
            "nickname": "Client's nickname",
            "country": ""
        },
        "platform": {
            "id": 21,
            "caption": "MT5 B2COPY",
            "short_caption": "",
            "name": "MT5 B2COPY",
            "class": "MetaTrader5",
            "enabled": true,
            "demo": false,
            "has_multiple_type_password": true
        },
        "account_id": "124214",
        "active_subscriptions_count": 0,
        "balance": "691.56",
        "equity": "13,373.77",
        "trade": 10,
        "children": 4,
        "children_last_week": 2,
        "max_daily_loss": 1756.07,
        "max_daily_profit": 3934.85,
        "max_dd": 86,
        "negative_pl_90_days": 0,
        "negative_pl_all_days": 0,
        "order_last_week": 1,
        "positive_pl_90_days": 0,
        "positive_pl_all_days": 0,
        "profit_12_month": 577,
        "profit_18_month": 577,
        "profit_3_month": 577,
        "profit_6_month": 577,
        "profit_all": 577,
        "profit_factor_90_days": 0,
        "profit_factor_all_days": 0,
        "profit_month": 26,
        "profit_week": 142,
        "realized_pl": -1308.44,
        "score": 49,
        "symbol": "USD",
        "subscribersIds": [
            143220,
            146565,
            124217,
            124218
        ],
        "minimum_deposit": 0,
        "has_subscription_code": false,
        "has_promo_offer": false,
        "show_in_leaderbord": true,
        "subscriptionInvestorAccounts": [
            143220,
            146565,
            124217,
            124218
        ],
        "allocation_method": 4,
        "risk_ratio": 1
    },
    "modules": []
}
```

</details>

## Get statistics for the widget

<mark style="color:green;">`GET`</mark> `[host]/api/v1/investment/widget/statistics/{account}`

This method returns information about trading instruments used on a master or investment account and the percentage ratios of their use, as well as some trading statistics. In the widget, the returned information is displayed as follows:

<figure><img src="/files/HVTXai29zHA0URViTt5a" alt="Trading Statistics"><figcaption><p>Trading Statistics</p></figcaption></figure>

### Request

**Headers**

**‍**‍**‍**`Authorization: Bearer <access_token>`

**Path parameter**

<table><thead><tr><th width="272">Name</th><th width="125">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>account</code></td><td>Yes</td><td>The MT login (number) of an account for which you want to get information.</td></tr></tbody></table>

**Query parameter**

<table><thead><tr><th width="273">Name</th><th width="103">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>investment_platform_id</code></td><td>Yes</td><td><p>The identifier of the investment platform instance.</p><ul><li>If only one MT server is connected to your B2COPY investment platform, specify 1.</li><li>If you have more than one MT server connected to your B2COPY investment platform, contact the Support team for assistance.</li></ul></td></tr></tbody></table>

**Request example**

```sh
curl --location --request GET 'https://host.name/api/v1/investment/widget/statistics/77616894?investment_platform_id=1' \
--header 'Authorization: Bearer <token>'
```

### **Response**

The response includes the object providing information about trading instruments used on the requested account for display in the **Statistics** widget.

<details>

<summary><strong>Response example</strong></summary>

```
{
    "status": 200,
    "meta": {
        "behaviours": [],
        "status": 200
    },
    "data": {
        "instruments_ratios": [
            {
                "name": "GBPUSD",
                "ratio": 27
            },
            {
                "name": "USDJPY",
                "ratio": 27
            },
            {
                "name": "USDCHF",
                "ratio": 9
            },
            {
                "name": "EURUSD",
                "ratio": 37
            }
        ],
        "number_of_trades": 11,
        "total_instruments": 4,
        "winning_trades": 3,
        "losing_trades": 8,
        "buy_trades": 5,
        "sell_trades": 6,
        "winning_weeks": 2,
        "losing_weeks": 1,
        "avg_trade_time": "0.14",
        "avg_trades_per_week": "5.5",
        "consecutive_losses": 3,
        "consecutive_wins": 1
    },
    "modules": []
}
```

</details>

**See also:**

[Configure B2COPY widgets](/admin-guide/configure-b2copy-widgets.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2copy.b2broker.com/api-documentation/get-data-for-the-statistics-widget.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
