> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# list_available_countries

> List countries with available phone numbers.

List countries that have phone numbers available for purchase.

### Schema

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /Accounts/{AccountSid}/AvailablePhoneNumbers:
    get:
      operationId: list_available_phone_number_resources
      summary: List of AvailablePhoneNumber resources
      description: >-
        Returns a list of URIs to phone number resources available to the
        account, categorized by type (Local, Toll-Free, Mobile, etc) and ISO
        country.


        #### Permissions


        The API token used to authenticate must have the following scope(s)
        enabled to make a successful request: _Numbers_.


        [Learn more about API scopes](/docs/platform/your-signalwire-api-space).
      tags:
        - subpackage_availablePhoneNumbers
      parameters:
        - name: AccountSid
          in: path
          description: The Project ID that uniquely identifies the Account to retrieve.
          required: true
          schema:
            $ref: '#/components/schemas/uuid'
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AvailablePhoneNumberResourcesResponse'
        '400':
          description: >-
            The request was invalid or cannot be processed. Check the error
            details for more information.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
        '401':
          description: Authentication failed. Please verify your credentials and try again.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompatibilityErrorResponse'
servers:
  - url: https://YOUR_SPACE.signalwire.com/api/laml/2010-04-01
    description: SignalWire Compatibility API
components:
  schemas:
    uuid:
      type: string
      format: uuid
      description: Universal Unique Identifier.
      title: uuid
    CountrySubresourceUris:
      type: object
      properties:
        local:
          type: string
          description: The URI for local numbers.
        toll_free:
          type: string
          description: The URI for toll-free numbers.
      required:
        - local
        - toll_free
      description: Country subresource URIs.
      title: CountrySubresourceUris
    CountryResource:
      type: object
      properties:
        country_code:
          type: string
          description: The ISO country code of the number.
        country:
          type: string
          description: The country the number is from.
        uri:
          type: string
          description: The URI for the API call.
        beta:
          type: boolean
          description: Always `false`. Included for Twilio API compatibility.
        subresource_uris:
          $ref: '#/components/schemas/CountrySubresourceUris'
          description: URIs for subresources.
      required:
        - country_code
        - country
        - uri
        - beta
        - subresource_uris
      description: Country resource for available phone numbers.
      title: CountryResource
    AvailablePhoneNumberResourcesResponse:
      type: object
      properties:
        uri:
          type: string
          description: The URI for the API call.
        countries:
          type: array
          items:
            $ref: '#/components/schemas/CountryResource'
          description: List of available countries.
      required:
        - uri
        - countries
      description: >-
        Response containing a list of available phone number resources
        (countries).
      title: AvailablePhoneNumberResourcesResponse
    CompatibilityErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code.
        message:
          type: string
          description: Error message.
        more_info:
          type: string
          description: URL for more information about the error.
        status:
          type: integer
          description: HTTP status code.
      required:
        - code
        - message
        - more_info
        - status
      description: Error response model.
      title: CompatibilityErrorResponse

```

## **Response Example**

### Response (200)

```json
{
  "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers",
  "countries": [
    {
      "country_code": "US",
      "country": "United States",
      "uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US",
      "beta": false,
      "subresource_uris": {
        "local": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/Local",
        "toll_free": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/AvailablePhoneNumbers/US/TollFree"
      }
    }
  ]
}
```

## **Example**

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

countries = client.compat.phone_numbers.list_available_countries()
```