> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reportify.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Follow Company

> Follow a company by stock symbol

## 关注公司

**URL**: `/v1/tools/user/follow-company`\
**方法**: `POST`\
**描述**: 关注一家公司，将其添加到用户的关注列表中。

### 请求参数

| 参数名    | 类型     | 必填 | 描述                                                               |
| ------ | ------ | -- | ---------------------------------------------------------------- |
| symbol | string | 是  | 股票代码，格式为 `市场:代码`（如 `US:AAPL`、`HK:00700`、`SH:600519`、`SZ:000001`） |

### 响应参数

| 参数名           | 类型      | 描述                     |
| ------------- | ------- | ---------------------- |
| symbol        | string  | 股票代码（如 `US:AAPL`）      |
| ticker        | string  | 股票简码（如 `AAPL`）         |
| market        | string  | 市场（如 `US`, `HK`, `CN`） |
| name          | string  | 公司名称                   |
| chinese\_name | string  | 中文名称                   |
| english\_name | string  | 英文名称                   |
| logo          | string  | 公司 Logo URL            |
| followed\_at  | integer | 关注时间戳（毫秒）              |

### 请求示例

**cURL**

```bash theme={null}
curl -X POST "https://api.reportify.cn/v1/tools/user/follow-company" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol": "US:AAPL"}'
```

**Python**

```python theme={null}
import requests

url = "https://api.reportify.cn/v1/tools/user/follow-company"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json={"symbol": "US:AAPL"})
data = response.json()

print(f"已关注: {data['name']} ({data['symbol']})")
```

**TypeScript**

```typescript theme={null}
const response = await fetch(
  'https://api.reportify.cn/v1/tools/user/follow-company',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ symbol: 'US:AAPL' })
  }
);

const data = await response.json();
console.log(`已关注: ${data.name} (${data.symbol})`);
```

### 响应示例

```json theme={null}
{
  "symbol": "US:AAPL",
  "ticker": "AAPL",
  "market": "US",
  "name": "Apple Inc.",
  "chinese_name": "苹果公司",
  "english_name": "Apple Inc.",
  "logo": "https://example.com/logos/aapl.png",
  "followed_at": 1704067200000
}
```

### 错误响应

| 状态码 | 描述               |
| --- | ---------------- |
| 400 | symbol 参数缺失或格式错误 |
| 422 | 请求参数验证失败         |

### 使用场景

1. **添加公司到关注列表**
   * 用户在浏览公司信息时一键关注
   * 构建个性化投资组合

2. **与获取关注列表和时间线配合使用**
   * 关注公司后，通过 `followed_companies` 获取完整列表
   * 通过时间线接口获取关注公司的最新动态


## OpenAPI

````yaml POST /v1/tools/user/follow-company
openapi: 3.1.0
info:
  title: Reportify API
  version: 1.0.0
  description: API documentation for Reportify's document management and search services.
servers:
  - url: https://api.reportify.cn
    description: Production server
security:
  - BearerAuth: []
paths:
  /v1/tools/user/follow-company:
    post:
      tags:
        - openapi-tools-user
      summary: Follow Company
      description: Follow a company by stock symbol
      operationId: follow_company_reportify_api_v1_tools_user_follow_company_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FollowCompanyRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FollowedCompanyItem'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    FollowCompanyRequest:
      properties:
        symbol:
          type: string
          title: Symbol
          description: Stock symbol, e.g. 00700 / AAPL
      type: object
      required:
        - symbol
      title: FollowCompanyRequest
      description: Request model for following/unfollowing a company
    FollowedCompanyItem:
      properties:
        symbol:
          type: string
          title: Symbol
          description: Company symbol (e.g., US:AAPL)
        ticker:
          type: string
          title: Ticker
          description: Company ticker (e.g., AAPL)
        market:
          type: string
          title: Market
          description: Market (e.g., US, HK, CN)
        name:
          type: string
          title: Name
          description: Company name
        chinese_name:
          type: string
          title: Chinese Name
          description: Chinese name
        english_name:
          type: string
          title: English Name
          description: English name
        logo:
          type: string
          title: Logo
          description: Company logo URL
        followed_at:
          type: integer
          title: Followed At
          description: Follow timestamp in milliseconds
      type: object
      required:
        - symbol
      title: FollowedCompanyItem
      description: Followed company information
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your Bearer token

````