:doc:`Chime <../../chime>` / Client / search_available_phone_numbers

******************************
search_available_phone_numbers
******************************



.. py:method:: Chime.Client.search_available_phone_numbers(**kwargs)

  

  Searches for phone numbers that can be ordered. For US numbers, provide at least one of the following search filters: ``AreaCode``, ``City``, ``State``, or ``TollFreePrefix``. If you provide ``City``, you must also provide ``State``. Numbers outside the US only support the ``PhoneNumberType`` filter, which you must use.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/chime-2018-05-01/SearchAvailablePhoneNumbers>`_  


  **Request Syntax**
  ::

    response = client.search_available_phone_numbers(
        AreaCode='string',
        City='string',
        Country='string',
        State='string',
        TollFreePrefix='string',
        PhoneNumberType='Local'|'TollFree',
        MaxResults=123,
        NextToken='string'
    )
    
  :type AreaCode: string
  :param AreaCode: 

    The area code used to filter results. Only applies to the US.

    

  
  :type City: string
  :param City: 

    The city used to filter results. Only applies to the US.

    

  
  :type Country: string
  :param Country: 

    The country used to filter results. Defaults to the US Format: ISO 3166-1 alpha-2.

    

  
  :type State: string
  :param State: 

    The state used to filter results. Required only if you provide ``City``. Only applies to the US.

    

  
  :type TollFreePrefix: string
  :param TollFreePrefix: 

    The toll-free prefix that you use to filter results. Only applies to the US.

    

  
  :type PhoneNumberType: string
  :param PhoneNumberType: 

    The phone number type used to filter results. Required for non-US numbers.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    The maximum number of results to return in a single call.

    

  
  :type NextToken: string
  :param NextToken: 

    The token used to retrieve the next page of results.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'E164PhoneNumbers': [
              'string',
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **E164PhoneNumbers** *(list) --* 

        List of phone numbers, in E.164 format.

        
        

        - *(string) --* 
    
      

      - **NextToken** *(string) --* 

        The token used to retrieve the next page of search results.

        
  
  **Exceptions**
  
  *   :py:class:`Chime.Client.exceptions.BadRequestException`

  
  *   :py:class:`Chime.Client.exceptions.ForbiddenException`

  
  *   :py:class:`Chime.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`Chime.Client.exceptions.UnauthorizedClientException`

  
  *   :py:class:`Chime.Client.exceptions.ThrottledClientException`

  
  *   :py:class:`Chime.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`Chime.Client.exceptions.ServiceFailureException`

  