> ## Documentation Index
> Fetch the complete documentation index at: https://fossabot.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# $(youtube)

![YouTube logo](https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/variables/youtube-logo.svg?fit=max\&auto=format\&n=CPTmXSRcXIGlG-eS\&q=85\&s=14922ec00e812321531b1595a93b14e4)

Returns metadata about the latest YouTube video of a channel or a playlist that can be accessed via multiple different variable members.

**We use YouTube API Services to query data that powers this variable. Use of this variable is subject to the [Google Privacy Policy](https://policies.google.com/privacy) and [YouTube Terms of Service](https://www.youtube.com/t/terms)**

## \$(youtube)

Returns the title and URL of the latest YouTube video of a channel or a playlist.

#### Parameters

This variable takes **one** *required* parameter that is either a **channel name**, **channel ID** or **playlist ID**. Prefix a playlist ID with `playlist=`.

#### Example Output

* `$(youtube Fossabot)`

  ```
  Getting started with Fossabot - https://youtu.be/VIDEO_ID
  ```

* `$(youtube playlist=PLAYLIST_ID)`

  ```
  Getting started with Fossabot - https://youtu.be/VIDEO_ID
  ```

#### Error Output

* In case the channel cannot be found, returns the following:

  ```
  [Error: Channel not found]
  ```

* In case no public, non-livestream videos are found, returns the following:

  ```
  [Error: No videos found]
  ```

## \$(youtube.description)

Returns the description of the latest YouTube video of a channel or a playlist.

#### Parameters

This variable takes **one** *required* parameter that is either a **channel name**, **channel ID** or **playlist ID**. Prefix a playlist ID with `playlist=`.

#### Example Output

* `$(youtube.description Fossabot)`

  ```
  Learn how to add Fossabot to your stream.
  ```

* `$(youtube.description playlist=PLAYLIST_ID)`

  ```
  Learn how to add Fossabot to your stream.
  ```

#### Error Output

* In case the channel cannot be found, returns the following:

  ```
  [Error: Channel not found]
  ```

* In case no public, non-livestream videos are found, returns the following:

  ```
  [Error: No videos found]
  ```

## \$(youtube.title)

Returns the title of the latest YouTube video of a channel or a playlist.

#### Parameters

This variable takes **one** *required* parameter that is either a **channel name**, **channel ID** or **playlist ID**. Prefix a playlist ID with `playlist=`.

#### Example Output

* `$(youtube.title Fossabot)`

  ```
  Getting started with Fossabot
  ```

* `$(youtube.title playlist=PLAYLIST_ID)`

  ```
  Getting started with Fossabot
  ```

#### Error Output

* In case the channel cannot be found, returns the following:

  ```
  [Error: Channel not found]
  ```

* In case no public, non-livestream videos are found, returns the following:

  ```
  [Error: No videos found]
  ```

## \$(youtube.url)

Returns the URL of the latest YouTube video of a channel or a playlist.

#### Parameters

This variable takes **one** *required* parameter that is either a **channel name**, **channel ID** or **playlist ID**. Prefix a playlist ID with `playlist=`.

#### Example Output

* `$(youtube.url Fossabot)`

  ```
  https://youtu.be/VIDEO_ID
  ```

* `$(youtube.url playlist=PLAYLIST_ID)`

  ```
  https://youtu.be/VIDEO_ID
  ```

#### Error Output

* In case the channel cannot be found, returns the following:

  ```
  [Error: Channel not found]
  ```

* In case no public, non-livestream videos are found, returns the following:

  ```
  [Error: No videos found]
  ```

## \$(youtube.video\_id)

Returns the YouTube video ID of the latest video of a channel or a playlist.

#### Parameters

This variable takes **one** *required* parameter that is either a **channel name**, **channel ID** or **playlist ID**. Prefix a playlist ID with `playlist=`.

#### Example Output

* `$(youtube.video_id Fossabot)`

  ```
  VIDEO_ID
  ```

* `$(youtube.video_id playlist=PLAYLIST_ID)`

  ```
  VIDEO_ID
  ```

#### Error Output

* In case the channel cannot be found, returns the following:

  ```
  [Error: Channel not found]
  ```

* In case no public, non-livestream videos are found, returns the following:

  ```
  [Error: No videos found]
  ```


## Related topics

- [Moderation](https://fossabot.com/docs/mediarequest/moderation.md)
- [Backup playlist](https://fossabot.com/docs/mediarequest/backup-playlist.md)
- [!sr](https://fossabot.com/docs/commands/default/sr.md)
- [Requesting songs](https://fossabot.com/docs/mediarequest/requesting-songs.md)
- [Media request](https://fossabot.com/docs/mediarequest/index.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.