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

# 参数

Fast Search API 用于即时获取SERP结果

Fast Search是获取SERP结果最快捷的方式。

## 输入参数

Fast Search API可用的请求参数：

| 参数       | 类型      | 是否必填 | 描述                                                                                                                      |
| :------- | :------ | :--- | :---------------------------------------------------------------------------------------------------------------------- |
| `query`  | string  | ✅    | 搜索查询。                                                                                                                   |
| `geo`    | string  |      | 设置提交查询时使用的国家。可用位置的完整列表请参见[**此处**](https://help.decodo.com/docs/web-scraping-api-localisation#/geo-parameter-locations)。 |
| `uule`   | string  |      | UULE（通用URL语言编码器）是添加到Google搜索URL中的一个特殊参数，可让用户模拟从特定地理位置进行搜索。<br />如果同时设置了`geo`和`uule`参数，将使用`uule`参数。                      |
| `gl`     | string  |      | 2字母国家代码。<br />如果同时设置了`geo`和`gl`参数，将使用`geo`参数。                                                                           |
| `locale` | string  |      | 设置该值以更改Google搜索页面网页界面的语言。                                                                                               |
| `page`   | integer |      | 设置应返回搜索结果的哪一页。默认值为`1`。                                                                                                  |

### POST 端点

`https://fastsearch.decodo.com/v0/search`

### 请求示例

<CodeGroup>
  ```shellscript cURL theme={null}
  # 将 'TOKEN VALUE' 更新为您的授权令牌
  curl --request 'POST' \
          --url 'https://fastsearch.decodo.com/v0/search' \
          --header 'Accept: application/json' \
          --header 'Authorization: Basic TOKEN VALUE' \
          --header 'Content-Type: application/json' \
          --data '
      {
        "query": "laptop"
      }
  '
  ```

  ```javascript Node theme={null}

  const scrape = async() => {
    const response = await fetch("https://fastsearch.decodo.com/v0/search", {
      method: "POST",
      body: JSON.stringify({
        "query": "laptop"
      }),
      headers: {
        "Content-Type": "application/json",
        "Authorization": "Basic TOKEN VALUE" // 更新为您的授权令牌
      },
    }).catch(error => console.log(error));

    console.log(await response.json())
  }

  scrape()
  ```

  ```python Python theme={null}
  import requests
    
  url = "https://fastsearch.decodo.com/v0/search"
    
  payload = {
        "query": "laptop"
  }
    
  headers = {
      "accept": "application/json",
      "content-type": "application/json",
      "authorization": "Basic TOKEN VALUE" # 更新为您的授权令牌
  }
    
  response = requests.post(url, json=payload, headers=headers)
    
  print(response.text)
  ```
</CodeGroup>

## 输出

解析后的`JSON`中`results`部分各字段的描述如下表所示。

| 结果键           | 描述                                                                    |
| :------------ | :-------------------------------------------------------------------- |
| `organic`     | 包含详细信息的自然搜索结果数组。                                                      |
| `top_stories` | 当搜索查询与新闻相关时，包含详细信息的文章数组。                                              |
| `status`      | 任务状态可以是`done`或`faulted`。如果Google未返回自然搜索结果，状态将为`done`，但`organic`数组将为空。 |

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>
