# Search domains

Check availability and yearly prices for supported domain endings. unchecked lists candidates whose registry did not respond.

POST https://api.brigg.app/v1/operations/domains.SearchDomains

## Access & visibility

Allow `domains.SearchDomains` on your API key.

**Acting member required.** Send `Brigg-Act-As` with an [approved member account ID](https://developer.brigg.app/authentication#member-delegation). The key supplies permissions; the member selects whose data is used.

The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | A name or a full domain (acme, acme.no). At least 1 character. At most 253 characters. |

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `label` | string | Yes | Human-readable label shown for this item; use its ID or key in API calls. |
| `results` | array of [DomainSearchResult](#domainsearchresult-response-results) | Yes | Availability and price results for the requested domain candidates. |
| `unchecked` | array of string | Yes | Domains whose registry did not return an availability result. |

### DomainSearchResult · response.results[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | Yes | Website hostname, without a scheme or path. |
| `tld` | string | Yes | Domain ending, such as com or no. |
| `available` | boolean | Yes | Whether the registry reports this domain as available to register. Allowed: `false`, `true`. |
| `premium` | boolean | Yes | Whether the registry classifies this as a premium-priced domain. Allowed: `false`, `true`. |
| `reason` | null or string | Yes | Explanation for the returned availability or setup outcome. |
| `yearly_price_nok` | null or number | Yes | Quoted annual price in Norwegian kroner. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. Supply Brigg-Act-As with a member authorized by the key’s delegation grant. The selected member must be active and approved by the credential. This selects whose private data is used; the credential supplies permissions. Private ownership and project boundaries still apply. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Example request

Fictional values. Replace IDs and business details with values from your workspace.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/domains.SearchDomains' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  -H "Brigg-Act-As: $BRIGG_ACT_AS" \
  --data-raw '{
  "query": "northstar"
}'
```

#### TypeScript


```typescript
const actAs = process.env.BRIGG_ACT_AS;
if (!actAs) throw new Error("Set BRIGG_ACT_AS to an approved member account ID.");

const response = await fetch("https://api.brigg.app/v1/operations/domains.SearchDomains", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
    "Brigg-Act-As": actAs,
  },
  body: JSON.stringify({
    "query": "northstar"
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "query": "northstar"
}
request = Request(
    "https://api.brigg.app/v1/operations/domains.SearchDomains",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
        "Brigg-Act-As": os.environ["BRIGG_ACT_AS"],
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "label": "northstar",
  "results": [],
  "unchecked": []
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 253,
      "description": "A name or a full domain (acme, acme.no)."
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "query": "northstar"
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "label": {
      "type": "string",
      "description": "Human-readable label shown for this item; use its ID or key in API calls."
    },
    "results": {
      "type": "array",
      "items": {
        "title": "DomainSearchResult",
        "type": "object",
        "properties": {
          "domain": {
            "type": "string",
            "description": "Website hostname, without a scheme or path."
          },
          "tld": {
            "type": "string",
            "description": "Domain ending, such as com or no."
          },
          "available": {
            "type": "boolean",
            "enum": [
              false,
              true
            ],
            "description": "Whether the registry reports this domain as available to register."
          },
          "premium": {
            "type": "boolean",
            "enum": [
              false,
              true
            ],
            "description": "Whether the registry classifies this as a premium-priced domain."
          },
          "reason": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "string"
              }
            ],
            "description": "Explanation for the returned availability or setup outcome."
          },
          "yearly_price_nok": {
            "anyOf": [
              {
                "type": "null"
              },
              {
                "type": "number"
              }
            ],
            "description": "Quoted annual price in Norwegian kroner."
          }
        },
        "required": [
          "domain",
          "tld",
          "available",
          "premium",
          "reason",
          "yearly_price_nok"
        ],
        "additionalProperties": false
      },
      "description": "Availability and price results for the requested domain candidates."
    },
    "unchecked": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Domains whose registry did not return an availability result."
    }
  },
  "required": [
    "label",
    "results",
    "unchecked"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "label": "northstar",
      "results": [],
      "unchecked": []
    }
  ]
}
```

