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

# Business Search 快速开始

> 发送第一个 Business Search 请求。以 Instant 模式调用一次 [POST /search/company](/cn/api-reference/business-search/search-company)，最多返回 10 条记录，并附带 req_id 与 meta。

<Note>
  Business Search 目前处于早期访问阶段。请联系 [sales@brightdata.com](mailto:sales@brightdata.com) 申请开通权限。
</Note>

本快速开始用 cURL 运行一次公司搜索，并读懂响应的三个部分：`req_id`、`meta` 和 `documents`。

## 前提条件

* 一个已开通 Business Search 权限的 Bright Data 账户。可在[控制面板](https://brightdata.com/cp/start)中查看权限
* 一个来自[身份验证](/cn/api-reference/authentication)的 Bright Data API key

## 第 1 步：设置 API key

把 key 存入环境变量，避免出现在命令历史或被提交的文件中。下一步的请求会从该变量读取 key：

```bash theme={null}
export BRIGHTDATA_API_KEY="YOUR_API_KEY"
```

## 第 2 步：发送公司搜索请求

以下请求使用 Instant 模式查找员工数在 50 到 500 之间的美国软件公司。`view: "summary"` 表示返回紧凑记录，而不是默认的 `id_only`：

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST "https://api.brightdata.com/search/company" \
    --header "Authorization: Bearer $BRIGHTDATA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{
      "source": "linkedin_company",
      "mode": "instant",
      "query": "US software companies with 50 to 500 employees",
      "offset": 0,
      "limit": 10,
      "view": "summary"
    }'
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      "https://api.brightdata.com/search/company",
      headers={
          "Authorization": f"Bearer {os.environ['BRIGHTDATA_API_KEY']}",
          "Content-Type": "application/json",
      },
      json={
          "source": "linkedin_company",
          "mode": "instant",
          "query": "US software companies with 50 to 500 employees",
          "offset": 0,
          "limit": 10,
          "view": "summary",
      },
  )

  data = response.json()
  if response.status_code == 200:
      print(data["req_id"], data["meta"]["matched"])
      for doc in data["documents"]:
          print(doc["data"]["name"])
  else:
      print(response.status_code, data)
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.brightdata.com/search/company", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${process.env.BRIGHTDATA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      source: "linkedin_company",
      mode: "instant",
      query: "US software companies with 50 to 500 employees",
      offset: 0,
      limit: 10,
      view: "summary",
    }),
  });

  const data = await response.json();
  if (response.status === 200) {
    console.log(data.req_id, data.meta.matched);
    for (const doc of data.documents) console.log(doc.data.name);
  } else {
    console.log(response.status, data);
  }
  ```
</CodeGroup>

请求返回 HTTP 200，响应体以 `req_id` 开头。

如果响应体是 `{"error":"Invalid token"}` 且状态码为 HTTP 401，说明 key 缺失、无效或已过期。请检查第 1 步中导出的值。HTTP 403 表示该 key 对应的账户未激活，或尚未加入 Business Search 允许列表。请联系 [sales@brightdata.com](mailto:sales@brightdata.com) 申请开通权限。

## 第 3 步：读懂响应

成功的响应包含请求元数据和一个 `documents` 数组。下面是一次真实请求返回的 10 条记录中的第一条，省略了 `url` 和 `logo`：

```json theme={null}
{
  "req_id": "ra7672a1925f744ebb592ec88b9f6bbf1",
  "source": "linkedin_company",
  "meta": {
    "coverage_percent": 100,
    "matched": 605,
    "offset": 0,
    "limit": 10
  },
  "documents": [
    {
      "bright_id": "7b8d489b82344beae097e05cddfcf1da56ed51e37fab6fc64b2ca58e7b0713bd",
      "data": {
        "name": "SourceForge",
        "slogan": "The complete software platform. SourceForge is the largest B2B software review and comparison directory in the world.",
        "industry": "Software Development",
        "headquarters_location": "San Diego, California",
        "headquarters_country_code": "US",
        "offices_cities": ["San Diego"],
        "company_size_from": 51,
        "company_size_to": 200,
        "employees_in_linkedin": 59,
        "linkedin_followers": 39183,
        "website": "https://sourceforge.net/",
        "domain": "sourceforge.net"
      }
    }
  ]
}
```

`req_id` 标识本次请求。请保留它用于排查问题，并在提交工单时附上。

## 你完成了什么，以及接下来做什么

你发送了一次自然语言公司搜索，并读懂了返回的记录。接下来可以在 [什么是 Business Search](/cn/products/business-search/introduction#每种模式有什么作用)中判断你需要大规模候选集还是排序精选列表。然后参照 [Business Search 查询语法](/cn/products/business-search/query-syntax)编写第一个结构化查询。
