:doc:`IVS <../../ivs>` / Client / get_stream

**********
get_stream
**********



.. py:method:: IVS.Client.get_stream(**kwargs)

  

  Gets information about the active (live) stream on a specified channel.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ivs-2020-07-14/GetStream>`_  


  **Request Syntax**
  ::

    response = client.get_stream(
        channelArn='string'
    )
    
  :type channelArn: string
  :param channelArn: **[REQUIRED]** 

    Channel ARN for stream to be accessed.

    

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

    
    ::

      {
          'stream': {
              'channelArn': 'string',
              'health': 'HEALTHY'|'STARVING'|'UNKNOWN',
              'playbackUrl': 'string',
              'startTime': datetime(2015, 1, 1),
              'state': 'LIVE'|'OFFLINE',
              'streamId': 'string',
              'viewerCount': 123
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **stream** *(dict) --* 
        

        - **channelArn** *(string) --* 

          Channel ARN for the stream.

          
        

        - **health** *(string) --* 

          The stream’s health.

          
        

        - **playbackUrl** *(string) --* 

          URL of the master playlist, required by the video player to play the HLS stream.

          
        

        - **startTime** *(datetime) --* 

          Time of the stream’s start. This is an ISO 8601 timestamp; *note that this is returned as a string*.

          
        

        - **state** *(string) --* 

          The stream’s state. Do not rely on the ``OFFLINE`` state, as the API may not return it; instead, a "NotBroadcasting" error will indicate that the stream is not live.

          
        

        - **streamId** *(string) --* 

          Unique identifier for a live or previously live stream in the specified channel.

          
        

        - **viewerCount** *(integer) --* 

          A count of concurrent views of the stream. Typically, a new view appears in ``viewerCount`` within 15 seconds of when video playback starts and a view is removed from ``viewerCount`` within 1 minute of when video playback ends. A value of -1 indicates that the request timed out; in this case, retry.

          
    
  
  **Exceptions**
  
  *   :py:class:`IVS.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`IVS.Client.exceptions.ValidationException`

  
  *   :py:class:`IVS.Client.exceptions.ChannelNotBroadcasting`

  