# Check a prefix

`GET https://api.vidmoat.com/v1/interactive-sites/availability`

- Scope: `projects.read`
- Cost: Free

Whether a prefix is allowed and free for this account, and if not, why.

### Query parameters

- `prefix` (string, required): The name to check.

## Response

Returns `200`.

### Response fields

- `available` (boolean): Whether it can be taken.
- `prefix` (string): The name as it would be stored (lower case).
- `code` (string): When not: `shape`, `length`, `punycode`, `reserved`, `brand`, `phishing`, `taken`, `held` or `yours`.
- `reason` (string): When not: why, in a sentence.

## Errors

Besides the errors any request can get ([authentication](https://developer.vidmoat.com/developer/docs/authentication#when-a-request-is-refused), [rate limits](https://developer.vidmoat.com/developer/docs/rate-limits)):

| Status | Code | When |
| --- | --- | --- |
| 429 | [`rate_limited`](https://developer.vidmoat.com/developer/docs/errors#rate_limited) | More than 40 checks in 10 minutes on the account. |

## Request examples

```bash curl
curl "https://api.vidmoat.com/v1/interactive-sites/availability?prefix=river-films" \
  -H "Authorization: Bearer $VIDMOAT_KEY"
```

```js Node
const res = await fetch('https://api.vidmoat.com/v1/interactive-sites/availability?prefix=river-films', {
  headers: {
    Authorization: `Bearer ${process.env.VIDMOAT_KEY}`,
  },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? `HTTP ${res.status}`);
console.log(data);
```

```python Python
import os
import requests

res = requests.get(
    "https://api.vidmoat.com/v1/interactive-sites/availability?prefix=river-films",
    headers={"Authorization": f"Bearer {os.environ['VIDMOAT_KEY']}"},
    timeout=60,
)
res.raise_for_status()
print(res.json())
```

## Example response

```json
{
  "available": true,
  "prefix": "river-films",
  "url": "https://river-films.interactive.vidmoat.com"
}
```

---

Source: https://developer.vidmoat.com/developer/docs/api/interactive-sites/interactive-site-availability
Previous: [Make a site](https://developer.vidmoat.com/developer/docs/api/interactive-sites/create-interactive-site.md)
Next: [Get a site](https://developer.vidmoat.com/developer/docs/api/interactive-sites/get-interactive-site.md)
All documentation: https://developer.vidmoat.com/llms-full.txt
