# 選股篩選

`POST` `/v1/quote/ai/screener/search`

按策略 ID 或自定義指標條件篩選股票，支持分頁。

## Parameters

### Request Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `market` | string | Yes | 選股市場，如 `US`、`HK`、`CN`。使用策略時取自策略。 |
| `filters` | array | Yes | 篩選條件。每項為 `{ "key": "filter_pettm", "min": "10", "max": "30", "tech_values": {} }`。 |
| `returns` | array | Yes | 每個匹配項需返回的指標 key 列表，如 `filter_pettm`。 |
| `page` | integer | Yes | 頁碼（從 0 開始）。 |
| `size` | integer | Yes | 每頁數量。 |

## Request Example

```bash
curl --request POST \
  --url 'https://openapi.longbridge.com/v1/quote/ai/screener/search' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Content-Type: application/json' \
  --data '{"market":"<market>","filters":[],"returns":[],"page":0,"size":0}'
```

## Response

### Response Properties

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `total` | integer | No | 滿足條件的股票總數。 |
| `items` | object[] | No | 匹配的股票列表。 |
| `└ symbol` | string | No | 標的代碼，如 `WXT.US`。 |
| `└ name` | string | No | 標的名稱。 |
| `└ indicators` | object[] | No | 該股票的指標值。 |
| `└ ∟ key` | string | No | 指標鍵名，如 `filter_pettm`。 |
| `└ ∟ name` | string | No | 指標顯示名稱。 |
| `└ ∟ value` | string | No | 指標值（字符串），無數據時為空。 |
| `└ ∟ unit` | string | No | 數值單位，如 `%`、` 億`。 |

### Response JSON Example

```json
{
  "code": 0,
  "message": "success",
  "data": {
    "total": 88,
    "page": 0,
    "market": "US",
    "items": [
      {
        "symbol": "AAPL.US",
        "name": "Apple Inc.",
        "prevchg": 0.62,
        "marketcap": 3241500000000,
        "pettm": 32.15,
        "pbmrq": 50.21,
        "salesgrowthyoy": 8.04
      },
      {
        "symbol": "MSFT.US",
        "name": "Microsoft",
        "prevchg": 1.05,
        "marketcap": 3085000000000,
        "pettm": 35.42,
        "pbmrq": 12.87,
        "salesgrowthyoy": 12.61
      }
    ]
  }
}
```
