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

# 搜索

搜索端点将网页搜索（SERP）与Firecrawl的抓取能力相结合，以返回任何查询的完整页面内容。

请在 `scrapeOptions` 中包含 `formats: ["markdown"]` 来获取每个搜索结果的完整Markdown内容，否则你将默认获得SERP结果（url、标题、描述）。


## OpenAPI

````yaml v1-openapi POST /search
openapi: 3.0.0
info:
  title: Firecrawl API
  version: v1
  description: >-
    API for interacting with Firecrawl services to perform web scraping and
    crawling tasks.
  contact:
    name: Firecrawl Support
    url: https://firecrawl.dev/support
    email: support@firecrawl.dev
servers:
  - url: https://api.firecrawl.dev/v1
security:
  - bearerAuth: []
paths:
  /search:
    post:
      tags:
        - Search
      summary: Search and optionally scrape search results
      operationId: searchAndScrape
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: The search query
                limit:
                  type: integer
                  description: Maximum number of results to return
                  default: 5
                  maximum: 10
                  minimum: 1
                tbs:
                  type: string
                  description: Time-based search parameter
                lang:
                  type: string
                  description: Language code for search results
                  default: en
                country:
                  type: string
                  description: Country code for search results
                  default: us
                location:
                  type: string
                  description: Location parameter for search results
                timeout:
                  type: integer
                  description: Timeout in milliseconds
                  default: 60000
                scrapeOptions:
                  type: object
                  description: Options for scraping search results
                  properties:
                    formats:
                      type: array
                      items:
                        type: string
                        enum:
                          - markdown
                          - html
                          - rawHtml
                          - links
                          - screenshot
                          - screenshot@fullPage
                          - extract
                      description: Formats to include in the output
                      default: []
                  default: {}
              required:
                - query
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        title:
                          type: string
                          description: Title from search result
                        description:
                          type: string
                          description: Description from search result
                        url:
                          type: string
                          description: URL of the search result
                        markdown:
                          type: string
                          nullable: true
                          description: Markdown content if scraping was requested
                        html:
                          type: string
                          nullable: true
                          description: HTML content if requested in formats
                        rawHtml:
                          type: string
                          nullable: true
                          description: Raw HTML content if requested in formats
                        links:
                          type: array
                          items:
                            type: string
                          description: Links found if requested in formats
                        screenshot:
                          type: string
                          nullable: true
                          description: Screenshot URL if requested in formats
                        metadata:
                          type: object
                          properties:
                            title:
                              type: string
                            description:
                              type: string
                            sourceURL:
                              type: string
                            statusCode:
                              type: integer
                            error:
                              type: string
                              nullable: true
                  warning:
                    type: string
                    nullable: true
                    description: Warning message if any issues occurred
        '408':
          description: Request timeout
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: Request timed out
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: An unexpected error occurred on the server.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````