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

# 联网搜索

联网搜索 API 是一个专给大模型用的搜索引擎，在传统搜索引擎网页抓取、排序的能力基础上，增强了意图识别能力，返回更适合大模型处理的结果（网页标题、URL、摘要、名称、图标等）。支持意图增强检索、结构化输出和多引擎支持。


## OpenAPI

````yaml openapi.yaml POST /web_search
openapi: 3.1.0
info:
  title: 极客智坊 API文档
  description: 极客智坊 API 消息接口规范文档
  version: 1.0.0
servers:
  - url: https://geekai.co/api/v1
    description: 国内代理入口
  - url: https://geekai.dev/api/v1
    description: 海外代理入口
security:
  - bearerAuth: []
  - apiKeyAuth: []
paths:
  /web_search:
    post:
      tags:
        - WebSearch
      summary: 联网搜索接口
      description: 在传统搜索引擎网页抓取、排序的能力基础上，增强了意图识别能力，返回更适合大模型处理的结果（网页标题、URL、摘要、名称、图标等）。
      operationId: createWebSearch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  description: 搜索模型
                  default: glm-search-std
                prompt:
                  type: string
                  description: 搜索提示
                  example: 杭州今天天气怎么样?
                intent:
                  type: boolean
                  description: 是否开启意图识别，默认为false
                  default: false
                count:
                  type: integer
                  description: 返回结果数量，默认10，最大50
                  default: 10
                  minimum: 1
                  maximum: 50
                domain_filter:
                  type: string
                  description: 域名过滤器，逗号分隔的域名列表，搜索结果将只包含这些域名的内容
                  example: baidu.com,google.com
                recency_filter:
                  type: string
                  description: >-
                    搜索指定时间范围内的网页，可选值为 noLimit（默认值，不限时间）, oneDay（一天内）,
                    oneWeek（一周内）, oneMonth（一月内）, oneYear（一年内）
                  enum:
                    - noLimit
                    - oneDay
                    - oneWeek
                    - oneMonth
                    - oneYear
                  default: noLimit
                content_size:
                  type: string
                  description: >-
                    控制返回网页摘要内容的长短，可选值为 medium（中等摘要，满足常规问答任务，默认值）,
                    high（详细摘要，最大化上下文，适合需要细节支撑的场景）
                  enum:
                    - medium
                    - high
                  default: medium
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                required:
                  - id
                  - created
                  - results
                properties:
                  id:
                    type: string
                    description: 请求ID
                  created:
                    type: integer
                    description: 请求创建时间戳
                    format: unix-timestamp
                  results:
                    type: array
                    description: 搜索结果列表
                    items:
                      type: object
                      required:
                        - link
                        - title
                        - content
                      properties:
                        link:
                          type: string
                          description: 网页链接
                        title:
                          type: string
                          description: 网页标题
                        content:
                          type: string
                          description: 内容摘要
                        icon:
                          type: string
                          description: 网站图标
                        media:
                          type: string
                          description: 网站名称
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/StandardError'
components:
  responses:
    ValidationError:
      description: 参数验证错误
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: validation_error
              message:
                type: string
                example: 参数验证失败
              details:
                type: object
                additionalProperties:
                  type: string
                example:
                  field: 错误描述
    Unauthorized:
      description: 未授权
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                example: unauthorized
              message:
                type: string
                example: Invalid API key or token
    StandardError:
      description: 标准错误响应
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: 错误代码
          example: invalid_request
        message:
          type: string
          description: 错误信息描述
          example: 请求参数不合法
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API认证token
    apiKeyAuth:
      type: apiKey
      in: header
      name: GeekAI-API-Key
      description: API密钥认证

````