# 按市场盈亏分析

`GET` `/v1/portfolio/profit-analysis/by-market`

获取按市场分组的盈亏分析（美股、港股、A 股、新加坡股）。

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `start_date` | string | No | 分析开始日期，格式 `YYYY-MM-DD` |
| `end_date` | string | No | 分析结束日期，格式 `YYYY-MM-DD` |

## Request Example

```bash
curl --request GET \
  --url 'https://openapi.longbridge.com/v1/portfolio/profit-analysis/by-market' \
  --header 'Authorization: Bearer <access_token>'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `has_more` | boolean | No | 是否有更多页 |
| `profit` | string | No | 总盈亏 |
| `stock_items` | object[] | No | 按股票划分的盈亏明细 |
| `└ code` | string | No | 股票代码 |
| `└ market` | string | No | 市场代码 |
| `└ name` | string | No | 股票名称 |
| `└ profit` | string | No | 该股票盈亏 |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "has_more": false,
    "profit": "-16325.26",
    "stock_items": [
      {
        "code": "AAPL",
        "market": "US",
        "name": "Apple",
        "profit": "100.00"
      }
    ]
  }
}
```
