# Profit Analysis by Market

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

Get P&L breakdown grouped by market (US, HK, CN, SG).

## Parameters

### Query Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `start_date` | string | No | Analysis start date in `YYYY-MM-DD` format |
| `end_date` | string | No | Analysis end date in `YYYY-MM-DD` format |

## 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 | Whether there are more pages |
| `profit` | string | No | Total profit/loss |
| `stock_items` | object[] | No | P&L breakdown by stock |
| `└ code` | string | No | Stock code |
| `└ market` | string | No | Market code |
| `└ name` | string | No | Stock name |
| `└ profit` | string | No | Profit/loss for this stock |

### 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"
      }
    ]
  }
}
```
