# Search domain

URL: https://docs.hanzo.ai/docs/openapi/domain/get-domain-search

> Finds names built from the keyword q, plus the registrar's alternate-TLD suggestions, and answers a quote for each: the name, whether it is purchasable, whether it is premium, the first-term and renewal price in cents, and the TLD.

`GET /v1/domain/search`

> [Domain →](https://docs.hanzo.ai/docs/openapi/domain) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                         |
| ------------- | --------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/domain/search` |
| **Method**    | `GET`                                   |
| **Operation** | `get_domain_search`                     |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`  |

Finds names built from the keyword q, plus the registrar's alternate-TLD
suggestions, and answers a quote for each: the name, whether it is purchasable,
whether it is premium, the first-term and renewal price in cents, and the TLD.

Prices are RETAIL — this deployment's markup is already applied and the wholesale
cost is never on the wire.

It requires a validated principal; 401 without one. Nothing is charged and
nothing is held — a quote is not a reservation, and the price is re-quoted at
purchase, so a name quoted here can be gone or dearer by the time you buy it. A
deployment with no registrar credentials answers 503.

## Request

2 fields.

| Field | In    | Type   | Required | Description                                                           |
| ----- | ----- | ------ | -------- | --------------------------------------------------------------------- |
| `q`   | query | string | yes      | Q is the keyword to build names from.                                 |
| `tld` | query | string | —        | TLD narrows the search to a comma-separated set of top-level domains. |

## Response

| Status    | Body             | Meaning |
| --------- | ---------------- | ------- |
| `200`     | domain.quoteList | ok      |
| `default` | problem-details  | refused |

`200` body — 8 fields.

| Field                         | In   | Type            | Always | Description                                                                                                                             |
| ----------------------------- | ---- | --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| `results`                     | body | domain.Offer\[] | —      | Results is one quote per name, priced RETAIL — this deployment's markup is already applied and the wholesale cost is never on the wire. |
| `results[].available`         | body | boolean         | —      | whether it can be bought right now                                                                                                      |
| `results[].currency`          | body | string          | —      | the currency both prices are in                                                                                                         |
| `results[].domain`            | body | string          | —      | the name this quote prices                                                                                                              |
| `results[].premium`           | body | boolean         | —      | whether the registry prices it above the standard rate                                                                                  |
| `results[].priceCents`        | body | integer (int64) | —      | sell (first-term registration)                                                                                                          |
| `results[].renewalPriceCents` | body | integer (int64) | —      | sell (renewal)                                                                                                                          |
| `results[].tld`               | body | string          | —      | the top-level domain the name sits under                                                                                                |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo domain search --q <q>
```

**SDK**

**.ts**

```ts
import { Configuration, DomainApi } from 'hanzoai';

const api = new DomainApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getDomainSearch({ q: 'q' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DomainApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DomainApi(client).get_domain_search(q='q')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DomainAPI.GetDomainSearch(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, domain_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = domain_api::get_domain_search(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DomainApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DomainApi(client).getDomainSearch();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/domain/search?q=%3Cq%3E \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `domain`, op `get_domain_search` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "domain",
         "arguments": {
           "op": "get_domain_search",
           "input": {
             "q": "<q>"
           }
         }
       }
     }'
```

---

[Domain API](https://docs.hanzo.ai/docs/openapi/domain) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
