# Check country availability

Checks country availability.

```http
GET https://api.pozy.ai/v1/phone-numbers/availability
```

- Area: Phone & voice / Phone Numbers
- Auth: Authorization: Bearer pz_live_...

## Query parameters

- `country` (string, required)
- `numberType` (string): one of local, mobile, national, toll_free
- `sms` (boolean)

## Example request

```bash
curl -X GET "https://api.pozy.ai/v1/phone-numbers/availability?country=US" \
  -H "Authorization: Bearer $POZY_API_KEY"
```

```ts
const res = await fetch("https://api.pozy.ai/v1/phone-numbers/availability?country=US", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.get(
    "https://api.pozy.ai/v1/phone-numbers/availability",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={
        "country": "US",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `country`, string
- `numberType`, string
- `available`, boolean
- `preOrderable`, boolean
- `addressConstraint`, string: One of `geo`, `country`, `none`
- `areas`, array of string
- `areaOptions`, array of object
  - `ndc`, string
  - `name`, string
  - `count`, integer
- `soldOutAreas`, array of object
  - `ndc`, string
  - `name`, string
  - `preOrderable`, boolean
- `areaAvailability`, object
  - `inStock`, array of object
    - `ndc`, string
    - `name`, string
    - `count`, integer
    - `ndcs`, array of string
    - `aliases`, array of string
  - `preOrder`, array of object
    - `ndc`, string
    - `name`, string
    - `ndcs`, array of string
    - `aliases`, array of string
  - `outOfStock`, array of object
    - `ndc`, string
    - `name`, string
    - `listed`, integer
    - `ndcs`, array of string
    - `aliases`, array of string

```json
{
  "country": "US",
  "numberType": "string",
  "available": true,
  "preOrderable": true,
  "addressConstraint": "geo",
  "areas": [
    "string"
  ],
  "areaOptions": [
    {
      "ndc": "string",
      "name": "Acme",
      "count": 42
    }
  ],
  "soldOutAreas": [
    {
      "ndc": "string",
      "name": "Acme",
      "preOrderable": true
    }
  ],
  "areaAvailability": {
    "inStock": [
      {
        "ndc": "string",
        "name": "Acme",
        "count": 42,
        "ndcs": [
          "string"
        ],
        "aliases": [
          "string"
        ]
      }
    ],
    "preOrder": [
      {
        "ndc": "string",
        "name": "Acme",
        "ndcs": [
          "string"
        ],
        "aliases": [
          "string"
        ]
      }
    ],
    "outOfStock": [
      {
        "ndc": "string",
        "name": "Acme",
        "listed": 1,
        "ndcs": [
          "string"
        ],
        "aliases": [
          "string"
        ]
      }
    ]
  }
}
```
