Dynamically Generated YouTube Stats for your GitHub Readmes
Tags: showdev, github, statistics, youtube
Published: 2021-01-23 04:07:36

Do you like to share the source code via github?

If the answer to the above question is yes, then this article is valuable for you. Recently I created a project which dynamically generates [**YouTube Stats Card**](https://github.com/Dhyeythumar/youtube-stats-card) for the **youtube channels and videos**. These cards will give an aesthetic look on your Github profile readme and the repo readmes as compared to the normal youtube URL.

> YouTube Stats Card allows you to simply add a **markdown image link** and it will show the real-time stats for your Channel and Videos as follows.

In this article, I will explain how to use this to generate elegant statistics for your YT channel and videos.

. . .

#### **YouTube Channel Stats**
```markdown
![Dhyey's youtube channel stats](https://youtube-stats-card.vercel.app/api?channelid=UCpKizIKSk8ga_LCI3e3GUig&layout=extruded&theme=dark_pink)
```
The above link will generate the following stats card having layout as `extruded` and color theme as `dark pink`:

![Dhyey's youtube channel stats](https://dev-to-uploads.s3.amazonaws.com/i/mp8aoyyxhazgv2pdpo32.png)

You can also customize the appearance of your Channel Stats Card with the following URL query params:
* **`layout`** - Default, Center, Extruded (name)
* **`hide_icons`** - Hide the icons from channel card (boolean)
* **`hide_logo`** - Hide the logo from channel card (boolean)
* **`theme`** - Name of the theme, choose from [**all available themes**](https://github.com/Dhyeythumar/youtube-stats-card/blob/main/themes/README.md)
* **`hide_border`** - Hides the card's border (boolean)
* **`title_color`** - Card's title color (hex color)
* **`text_color`** - Body text color (hex color)
* **`icon_color`** - Icons color if available (hex color)
* **`bg_color`** - Card's background color (hex color)
* **`custom_title`** - Add the custom title to the channel card (use %20 to add space)
* **`cache_seconds`** - set the cache header manually (min: 1800, max: 86400)

. . .

#### **YouTube Video Stats**
```markdown
![Dhyey's youtube video stats](https://youtube-stats-card.vercel.app/api/video?videoid=4vwZNTagHsQ&layout=compact)
```
The above link will generate the following stats card having layout as `compact` and color theme as `default`:

![Dhyey's youtube video stats](https://dev-to-uploads.s3.amazonaws.com/i/a0ec0c7bb2sk7kd7fu57.png)

You can also customize the appearance of your Video Stats Card with the following URL query params:
* **`layout`** - Default, Compact (name)
* **`hide_icons`** - Hide the icons from video card (boolean)
* **`hide_preview`** - Hide the video preview from video card (boolean)
* **`theme`** - Name of the theme, choose from [**all available themes**](https://github.com/Dhyeythumar/youtube-stats-card/blob/main/themes/README.md)
* **`hide_border`** - Hides the card's border (boolean)
* **`title_color`** - Card's title color (hex color)
* **`text_color`** - Body text color (hex color)
* **`icon_color`** - Icons color if available (hex color)
* **`bg_color`** - Card's background color (hex color)
* **`hide_channelname`** - Hide the channel name in video card (boolean)
* **`cache_seconds`** - set the cache header manually (min: 1800, max: 86400)

I hope you guys liked the project ✌. And make sure to give it a star on Github ⭐.

. . .

To view all the live demos, check out the github repo:
{% github Dhyeythumar/youtube-stats-card %}