# search()

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/domains/search/
Language: zh

`api.domains.search(query, { tlds? }) → Promise<Result[]>`

哪些名字是免费的,读着 DNS 毫无保留,即自由的、即时的、无保留的。

Status: free · reserves nothing · a phrase is refused

```javascript
await api.domains.search("example");                    // across the usual extensions
await api.domains.search("example.com");                // that one
await api.domains.search("example", { tlds: ["fr"] });  // the ones you name
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `query` | string | 必填 | 姓名,有的有,有的没有,有的没有扩展名。 **不是一个短语。** |
| `tlds` | string[] |  | 哪个扩展选项要尝试 。 |

## 返回值 {#returns}

```javascript
[{ name: "example.com", available: false, priceCredits: null }]
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string |  | 整个名字 |
| `available` | boolean|null |  | **`null` 何时 DNS 没有清楚回答。** 猜不到 估计不到 |
| `priceCredits` | integer|null |  | `null` 登记员没有被电汇——比不真实的价格好。 |

> **无效是一个答案**
>
> DNS 答案不回答显然是真实的状态, 把它变成“ 可用 ” 将是昂贵的错误。 显示“ 未知 ” 而不是猜测。

## 拒绝一个短语 {#phrase}

要求它为里昂的面包店找东西, 却只回回拒绝, 而不是回一个没人要求的名字,

## 原文如下: DNS而不是登记簿 {#dns-only}

确定一个名称。 可能不是免费的, 登记官是决定登记的人。

## 没有任何保留,任何费用都不收费 {#no-charge}

搜索是自由的,没有留下任何痕迹。 [加( 加)](/zh/sdk/ref/domains/add),它的工作范围已经是你拥有的。

- [add()](/zh/sdk/ref/domains/add): 随附一个
- [api.domains](/zh/sdk/ref/domains): 搜索,附属,列名。

```python
api.domains.search("example")                  # across the usual extensions
api.domains.search("example.com")              # that one
api.domains.search("example", tlds=["fr"])     # the ones you name
```

```python
[{"name": "example.com", "available": False, "priceCredits": None}]
```
