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

# Webpages Search

> Retrieve the full content of a webpage

## 网页搜索

**URL**: `/v2/search/webpages`\
**方法**: `POST`\
**描述**: 搜索网页内容。

### 请求参数

| 参数名             | 类型  | 必填 | 描述                                             |
| --------------- | --- | -- | ---------------------------------------------- |
| query           | str | 是  | 搜索关键词。                                         |
| num             | int | 否  | 返回的结果数量，默认值为 `10`，最大值为 `100`。                  |
| start\_datetime | str | 否  | 开始时间，格式为 `YYYY-MM-DD` 或 `YYYY-MM-DD HH:MM:SS`。 |
| end\_datetime   | str | 否  | 结束时间，格式为 `YYYY-MM-DD` 或 `YYYY-MM-DD HH:MM:SS`。 |

### 响应参数

| 参数名             | 类型     | 描述                   |
| --------------- | ------ | -------------------- |
| docs            | array  | 搜索结果文档数组，每个文档包含以下字段： |
|   doc\_id       | str    | 文档唯一 ID。             |
|   title         | str    | 文档标题。                |
|   summary       | str    | 文档摘要。                |
|   category      | str    | 文档类别。                |
|   published\_at | int    | 发布时间（毫秒级时间戳）。        |
|   companies     | array  | 相关公司列表。              |
|   metadata      | object | 文档元数据。               |
|   score         | number | 相关性评分。               |
|   url           | str    | 文档链接。                |
| total\_count    | int    | 匹配文档总数。              |
| took\_ms        | int    | 搜索执行时间（毫秒）。          |

### 请求示例

**cURL**

```bash theme={null}
curl -X POST https://api.reportify.cn/v2/search/webpages \
-H "Authorization: Bearer 447460****09c9" \
-H "Content-Type: application/json" \
-d '{
    "query": "人工智能 投资趋势",
    "num": 10,
    "start_datetime": "2024-01-01",
    "end_datetime": "2024-12-31"
}'
```

**Python 示例**

```python theme={null}
import requests

url = "https://api.reportify.cn/v2/search/webpages"
headers = {
    "Authorization": "Bearer 447460****09c9",
    "Content-Type": "application/json"
}
payload = {
    "query": "人工智能 投资趋势",
    "num": 10,
    "start_datetime": "2024-01-01",
    "end_datetime": "2024-12-31"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

### 响应示例

```json theme={null}
{
  "docs": [
    {
      "doc_id": "1046915273103380487",
      "title": "2024年人工智能投资趋势分析",
      "summary": "### 内容要点\n- AI 领域投资持续增长\n- 大模型和生成式 AI 成为热点\n...",
      "category": "webpages",
      "published_at": 1730390400000,
      "companies": [],
      "metadata": {
        "report_type": 4,
        "report_status": 2,
        "report_scope": 1,
        "report_language": "zh"
      },
      "score": 0.9412,
      "url": "https://example.com/ai-investment-trends-2024"
    }
  ],
  "total_count": 1,
  "took_ms": 72
}
```

### 错误响应

| HTTP 状态码 | 描述       |
| -------- | -------- |
| 422      | 请求参数验证错误 |


## OpenAPI

````yaml POST /v2/search/webpages
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:
  /v2/search/webpages:
    post:
      tags:
        - openapi-v2-search
      summary: Webpages Search
      description: Retrieve the full content of a webpage
      operationId: webpages_search_reportify_api_v2_search_webpages_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchToolsWebpagesRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchToolsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    SearchToolsWebpagesRequest:
      properties:
        query:
          type: string
          title: Query
          description: Search query
        num:
          type: integer
          maximum: 100
          minimum: 1
          title: Num
          description: Number of results to return
          default: 10
        start_datetime:
          type: string
          title: Start Datetime
          description: Start datetime in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format
        end_datetime:
          type: string
          title: End Datetime
          description: End datetime in YYYY-MM-DD or YYYY-MM-DD HH:MM:SS format
      type: object
      required:
        - query
      title: SearchToolsWebpagesRequest
      description: Request model for webpage search
    SearchToolsResponse:
      properties:
        docs:
          items:
            $ref: '#/components/schemas/SearchToolsDoc'
          type: array
          title: Docs
          description: Search result documents
        total_count:
          type: integer
          title: Total Count
          description: Total number of matching documents
          default: 0
        took_ms:
          type: integer
          title: Took Ms
          description: Search execution time in milliseconds
          default: 0
      type: object
      title: SearchToolsResponse
      description: Response model for all search tools
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SearchToolsDoc:
      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: integer
          title: Published At
          description: Publication timestamp in milliseconds
        companies:
          items:
            $ref: '#/components/schemas/CompanyLabel'
          type: array
          title: Companies
          description: Related companies
        metadata:
          type: object
          title: Metadata
          description: Document metadata
        score:
          type: number
          title: Score
          description: Relevance score
        url:
          type: string
          title: Url
          description: Document URL
      type: object
      required:
        - doc_id
        - title
        - url
      title: SearchToolsDoc
      description: Individual search result document
    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
    CompanyLabel:
      properties:
        name:
          type: string
          title: Name
        logo:
          type: string
          title: Logo
        stocks:
          items:
            $ref: '#/components/schemas/CompanyStock'
          type: array
          title: Stocks
      type: object
      required:
        - name
      title: CompanyLabel
    CompanyStock:
      properties:
        symbol:
          type: string
          title: Symbol
        market:
          type: string
          title: Market
        code:
          type: string
          title: Code
      type: object
      required:
        - symbol
        - market
        - code
      title: CompanyStock
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Enter your Bearer token

````