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

# Web 搜索

> 搜索网络

搜索网络，并返回包含标题、链接和摘要的结构化结果。

**最适合：** 获取当前网络信息、快速发现信息来源以及非学术研究背景资料。

<Note>
  Scholar 搜索端点使用 `POST`，参数位于查询字符串中。请勿通过 JSON 或表单请求体发送 `query` 或 `max_num_results`。
</Note>

## 示例

```bash theme={null}
curl -X POST "https://api.aisa.one/apis/v1/scholar/search/web?query=self-correcting%20agent%20frameworks&max_num_results=5" \
  -H "Authorization: Bearer ${AISA_API_KEY}"
```

## 响应

返回搜索 `id` 和包含网络搜索结果的 `results` 数组。将返回的 `id` 与[解释搜索结果](/zh/api-reference/scholar/post_scholar-search-explain)配合使用，可基于这些结果生成说明。


## OpenAPI

````yaml openapi/zh/platform-txyz-openapi.json POST /scholar/search/web
openapi: 3.0.0
info:
  title: TXYZ Platform API
  version: 1.0.0
  description: platform.txyz.ai 服务的 API 文档，包括学术搜索功能
  contact:
    email: support@txyz.ai
  license:
    name: Proprietary
servers:
  - url: https://api.aisa.one/apis/v1
security:
  - BearerAuth: []
paths:
  /scholar/search/web:
    post:
      tags:
        - Search
        - Web
      summary: 搜索网络
      description: 执行网页搜索并返回结构化结果。参数以查询参数形式接收；此操作不支持请求体。
      operationId: searchWeb
      parameters:
        - name: query
          in: query
          required: true
          description: 学术资料搜索查询
          schema:
            type: string
            example: machine learning
        - name: max_num_results
          in: query
          description: 返回的搜索结果最大数量，最多 100 条
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
        - name: as_ylo
          in: query
          description: 出版年份下限
          schema:
            type: integer
            nullable: true
            minimum: 1900
            maximum: 2030
        - name: as_yhi
          in: query
          description: 出版年份上限
          schema:
            type: integer
            nullable: true
            minimum: 1900
            maximum: 2030
      responses:
        '200':
          description: 搜索成功响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebSearchResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth: []
components:
  schemas:
    WebSearchResponse:
      type: object
      required:
        - id
        - results
      properties:
        id:
          type: string
          description: 搜索请求的唯一标识符
        results:
          type: array
          items:
            $ref: '#/components/schemas/WebResult'
          description: 网页搜索结果列表
    WebResult:
      type: object
      required:
        - title
        - link
        - snippet
      properties:
        title:
          type: string
          description: 网页标题
        link:
          type: string
          format: uri
          description: 用于访问网页的 URL
        snippet:
          type: string
          description: 网页内容的简要摘要或预览
        display_url:
          type: string
          description: 适合展示的 URL
        published_date:
          type: string
          format: date-time
          description: 网页的发布日期
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: 描述错误原因的错误消息
        code:
          type: integer
          description: HTTP 状态码
        details:
          type: string
          description: 其他错误详情
  responses:
    BadRequest:
      description: 错误请求 - 参数无效
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: 未授权 - API 密钥无效或缺失
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: 超出速率限制
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: 内部服务器错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````