> ## 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.

# Public Media Timeline

> Document feed for the public media I follow

## 关注公众号时间线

**URL**: `/v1/tools/timeline/public-media`\
**方法**: `POST`\
**描述**: 获取用户关注的公众号最新动态时间线。

### 请求参数

| 参数名 | 类型      | 必填 | 描述                    |
| --- | ------- | -- | --------------------- |
| num | integer | 否  | 返回结果数量，默认 10，范围 1-100 |

### 响应参数

| 参数名             | 类型      | 描述       |
| --------------- | ------- | -------- |
| docs            | array   | 文档列表     |
|   doc\_id       | string  | 文档 ID    |
|   title         | string  | 文档标题     |
|   summary       | string  | 文档摘要     |
|   category      | string  | 文档类别     |
|   published\_at | string  | 发布时间     |
|   source        | string  | 来源       |
|   channel\_name | string  | 渠道名称     |
|   symbols       | array   | 相关股票代码列表 |
| total\_count    | integer | 匹配文档总数   |
| took\_ms        | integer | 查询耗时（毫秒） |

### 请求示例

**cURL**

```bash theme={null}
curl -X POST "https://api.reportify.cn/v1/tools/timeline/public-media" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"num": 20}'
```

**Python**

```python theme={null}
import requests

url = "https://api.reportify.cn/v1/tools/timeline/public-media"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {"num": 20}

response = requests.post(url, headers=headers, json=data)
timeline = response.json()

for doc in timeline["docs"]:
    print(f"[{doc['channel_name']}] {doc['title']}")
```

**TypeScript**

```typescript theme={null}
const response = await fetch('https://api.reportify.cn/v1/tools/timeline/public-media', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ num: 20 })
});

const data = await response.json();
console.log(`Found ${data.total_count} public media articles`);
```

### 响应示例

```json theme={null}
{
  "docs": [
    {
      "doc_id": "doc_pm123",
      "title": "深度解读：新能源汽车行业2024年展望",
      "summary": "2024年新能源汽车行业将迎来新的发展机遇...",
      "category": "news",
      "published_at": "2024-01-15T12:00:00Z",
      "source": "新能源观察",
      "channel_name": "新能源观察公众号",
      "symbols": ["CN:300750", "HK:01211"]
    }
  ],
  "total_count": 120,
  "took_ms": 35
}
```

### 错误响应

| 状态码 | 描述       |
| --- | -------- |
| 422 | 请求参数验证失败 |


## OpenAPI

````yaml POST /v1/tools/timeline/public-media
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/timeline/public-media:
    post:
      tags:
        - openapi-tools-timeline
      summary: Public Media Timeline
      description: Document feed for the public media I follow
      operationId: public_media_timeline_reportify_api_v1_tools_timeline_public_media_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAITimelineToolsRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TimelineToolsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    OAITimelineToolsRequest:
      properties:
        num:
          type: integer
          maximum: 100
          minimum: 1
          title: Num
          description: Number of results to return
          default: 10
        page:
          type: integer
          title: Page
          description: Page number, starting from 1
          default: 1
          minimum: 1
      type: object
      title: OAITimelineToolsRequest
      description: Request model for timeline tools
    TimelineToolsResponse:
      properties:
        docs:
          type: array
          items:
            $ref: '#/components/schemas/ToolAPIDocument'
          title: Docs
          description: Timeline result documents
          default: []
        total_count:
          type: integer
          title: Total Count
          description: Total number of matching documents
          default: 0
        took_ms:
          type: integer
          title: Took Ms
          description: Timeline execution time in milliseconds
          default: 0
        page:
          type: integer
          title: Page
          description: Current page number
          default: 1
        total_page:
          type: integer
          title: Total Page
          description: Total number of pages
          default: 0
      type: object
      title: TimelineToolsResponse
      description: Response model for timeline tools
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ToolAPIDocument:
      properties:
        doc_id:
          type: string
          title: Doc Id
          description: Document ID
        title:
          type: string
          title: Title
          description: Document title
        summary:
          type: string
          title: Summary
          description: Document summary
        category:
          type: string
          title: Category
          description: Document category
        published_at:
          type: string
          title: Published At
          description: Publication timestamp
        source:
          type: string
          title: Source
          description: Document source
        channel_name:
          type: string
          title: Channel Name
          description: Channel name
        symbols:
          type: array
          items:
            type: string
          title: Symbols
          description: Related stock symbols
        companies:
          type: array
          items:
            $ref: '#/components/schemas/ToolAPICompanyInfo'
          title: Companies
          description: Related companies
      type: object
      title: ToolAPIDocument
      description: Document in tool API response
    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
    ToolAPICompanyInfo:
      properties:
        name:
          type: string
          title: Name
          description: Company name
        logo:
          type: string
          title: Logo
          description: Company logo URL
        industry:
          type: string
          title: Industry
          description: Industry
        sector:
          type: string
          title: Sector
          description: Sector
        stocks:
          type: array
          items:
            type: object
          title: Stocks
          description: Stock information
      type: object
      required:
        - name
      title: ToolAPICompanyInfo
      description: Company information in tool API response
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your Bearer token

````