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

# 搜索 Firecrawl 政府索引

搜索来自美国联邦、州和地方政府来源的基础法律与监管资料，包括成文法、法规、法典、法院判决及其他政府出版物。结果以标准的 `web` 分组返回，结构与 [`/search`](/zh/api-reference/endpoint/search) 返回的网页结果相同。

同一路径也支持 `POST`，字段相同，以 JSON 请求体传入。包含未知字段的请求将被拒绝，并返回 `400`。

<CodeGroup>
  ```bash cURL theme={null}
  # 无需 API 密钥即可开始使用；添加 -H "Authorization: Bearer $FIRECRAWL_API_KEY" 可获得更高的限流额度：
  curl -s "https://api.firecrawl.dev/v2/search/gov?query=food%20labeling%20requirements%20for%20allergens&k=10"
  ```

  ```bash cURL (POST) theme={null}
  curl -X POST https://api.firecrawl.dev/v2/search/gov \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "query": "food labeling requirements for allergens",
      "k": 10
    }'
  ```
</CodeGroup>

工作流概览请参见[政府索引指南](/zh/features/gov)。


## OpenAPI

````yaml zh/api-reference/v2-openapi.json GET /search/gov
openapi: 3.0.0
info:
  contact:
    email: support@firecrawl.dev
    name: Firecrawl Support
    url: https://firecrawl.dev/support
  description: 用于与 Firecrawl 服务交互，执行网页抓取和爬取任务的 API。
  title: Firecrawl API
  version: v2
servers:
  - url: https://api.firecrawl.dev/v2
security:
  - bearerAuth: []
paths:
  /search/gov:
    get:
      tags:
        - Government
      summary: 搜索 Government Index
      operationId: govSearch
      parameters:
        - description: 自然语言问题或搜索短语。
          in: query
          name: query
          required: true
          schema:
            minLength: 1
            type: string
        - description: 要返回的结果数量。
          in: query
          name: k
          required: false
          schema:
            default: 10
            maximum: 100
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              example:
                data:
                  web:
                    - description: 所有供人食用的产品均应提供食品营养标签……
                      position: 1
                      title: 21 CFR Part 101 -- Food Labeling
                      url: >-
                        https://www.ecfr.gov/current/title-21/chapter-I/subchapter-B/part-101
                success: true
              schema:
                $ref: '#/components/schemas/GovSearchResponse'
          description: '`web` 组中已排序的 Government Index 结果。'
        '400':
          description: 无效请求，可能包含未知字段
        '401':
          description: 无效的 Bearer 令牌
        '429':
          description: 超出限流
        '502':
          description: 上游错误
        '504':
          description: 上游超时
      security:
        - bearerAuth: []
components:
  schemas:
    GovSearchResponse:
      properties:
        data:
          properties:
            web:
              items:
                properties:
                  description:
                    description: 源文档中匹配的 snippet。
                    type: string
                  position:
                    description: 在结果列表中的排名，从 1 开始。
                    type: integer
                  title:
                    type: string
                  url:
                    format: uri
                    type: string
                type: object
              type: array
          type: object
        success:
          type: boolean
      type: object
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.