# search()

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

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

Which names are free. It reads DNS and nothing else: free, instant, and it reserves nothing.

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 | required | A name, with or without an extension. **Not a phrase.** |
| `tlds` | string[] |  | Which extensions to try. |

## Returns {#returns}

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

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `name` | string |  | The full name. |
| `available` | boolean|null |  | **`null` when DNS did not answer clearly.** Not a guess. |
| `priceCredits` | integer|null |  | `null` while no registrar is wired — better than a price that is not real. |

> **null is an answer**
>
> DNS not answering clearly is a real state, and turning it into « available » would be the expensive kind of wrong. Show « unknown » rather than a guess.

## A phrase is refused {#phrase}

It is not a name generator. Asking it to find something for « a bakery in Lyon » returns a refusal rather than a name nobody asked for — which is what it would have to invent.

## It reads DNS, not a registry {#dns-only}

A name that resolves is taken. A name that does not is probably free — and the registrar is the one that decides, at registration.

## Nothing is reserved and nothing is charged {#no-charge}

Searching is free and leaves no trace. Attaching is [add()](/sdk/ref/domains/add), and it works on a domain you already own.

- [add()](/sdk/ref/domains/add): Attaching one.
- [api.domains](/sdk/ref/domains): Searching, attaching, listing.

```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}]
```
