> ## 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)

<img src="https://mintcdn.com/fossadev/CPTmXSRcXIGlG-eS/img/variables/youtube-logo.svg?fit=max&auto=format&n=CPTmXSRcXIGlG-eS&q=85&s=14922ec00e812321531b1595a93b14e4" width="140" alt="YouTube logo" data-path="img/variables/youtube-logo.svg" />

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

**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)**

#### Parameters

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

#### Example Output

* `$(youtube xqcow)`

  ```
  xQc Cries from Laughing at Fan-Made Memes | Reddit Recap #213 - https://youtu.be/ONPkz0cHt9E
  ```

* `$(youtube UCmDTrq0LNgPodDOFZiSbsww)`

  ```
  xQc Cries from Laughing at Fan-Made Memes | Reddit Recap #213 - https://youtu.be/ONPkz0cHt9E
  ```

* `$(youtube playlist=PLKeR9CeyAc9brDTtmz6DcCQpy5mA6m9AK)`

  ```
  You Wont Believe This Great Escape - https://youtu.be/6nXBfJ3ZGE4 
  ```

#### Error Output

* In case an invalid or no channel name, channel ID or playlist ID is provided, returns the following:

  ```
  [Error: YouTube API returned an error.]
  ```


## Related topics

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


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