# Auto-generate Youtube thumbnail URL

**URL:** <https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862>\
**Category:** Ask for Help\
**Created:** [March 29, 2021, 9:00am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862 "2021-03-29T09:00:59Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamm\_Studios\_Doha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamm_studios_doha/32/19678_2.png) [@Jamm\_Studios\_Doha](https://community.glideapps.com/u/Jamm_Studios_Doha)\
**Post date:** [March 29, 2021, 9:00am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/1 "2021-03-29T09:00:59Z")

</div>

Hello,

Is there a way inside the Glide data editor (not in GS) to automatically generate the thumbnail URL from a Youtube link, perhaps using the template and generate URL columns?

i.e. I want to automatically turn

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/f/5f69030fdc54b45b5b5e78ad22aa6ac0755ed27b.jpeg "Learn To Play Kenny Garrett Happy People - Insta Jamm") ](https://www.youtube.com/watch?v=Os35h63ySLk)

into  
 ![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/1/1138dd848af719e66fd3a66fe7f9a496c58583a6.jpeg)

Thanks!

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [March 29, 2021, 9:08am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/2 "2021-03-29T09:08:08Z")

</div>

Sure. Assuming you know the YouTubeID then you can create 2x template columns as follows:

URL for the video:  
[https://www.youtube.com/embed/{YTID}](https://www.youtube.com/embed/%7BYTID%7D)

URL for the thumbnail:  
[https://img.youtube.com/vi/{YTID}/0.jpg](https://img.youtube.com/vi/%7BYTID%7D/0.jpg)

In both cases {YTID} is the YouTube ID.

Hope that helps

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [March 29, 2021, 9:08am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/3 "2021-03-29T09:08:35Z")

</div>

You can use a template column replacing the video\_id

> [@Youtube thumbnails](https://community.glideapps.com/t/youtube-thumbnails/2337/6):
>
> You can get a thumbnail for any YouTube video given the video ID: [https://img.youtube.com/vi/VIDEO\_ID/0.jpg](https://img.youtube.com/vi/VIDEO_ID/0.jpg) Using the Template column, you could derive Video and Thumbnail columns from a Video ID column.

> **[Glide Docs](https://www.glideapps.com/docs)**
>
> Welcome to Glide Docs, a steadily growing collection of articles and videos on how to use Glide. We can’t wait to see what you build!

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [March 29, 2021, 9:14am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/4 "2021-03-29T09:14:18Z")

</div>

Same question with a twist – if you have the video ID, how can you get at the:

- video duration
- description
- number of views

I see in reading around the topic that you need a YouTube API key (I got that setup) which you do NOT need for the image thumbnail or the RSS feed).

I would like to get at the data in either GSheets or in Glide (this is for my son’s project “YouTube for Kids”).

Thanks!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 29, 2021, 9:37am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/5 "2021-03-29T09:37:17Z")

</div>

You can try this.

> **[Using Sheets and the YouTube API to track video analytics](https://dev.to/rick_viscomi/using-sheets-and-the-youtube-api-to-track-video-analytics-6el)**
>
> A walkthrough of setting up Sheets and Apps Script code to monitor the stats of a series of YouTube videos.

---

<div class="post-metadata">

**Author:** ![Jamm\_Studios\_Doha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamm_studios_doha/32/19678_2.png) [@Jamm\_Studios\_Doha](https://community.glideapps.com/u/Jamm_Studios_Doha)\
**Post date:** [March 29, 2021, 9:44am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/6 "2021-03-29T09:44:08Z")

</div>

I don’t have the Youtube ID, I have the URL.

So the solution I’m looking needs to be able to extract that prior to any of those steps.

---

<div class="post-metadata">

**Author:** ![Jamm\_Studios\_Doha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamm_studios_doha/32/19678_2.png) [@Jamm\_Studios\_Doha](https://community.glideapps.com/u/Jamm_Studios_Doha)\
**Post date:** [March 29, 2021, 9:45am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/7 "2021-03-29T09:45:37Z")

</div>

I’m aware of this.

But as I mentioned in my original post I need to do it from the Youtube link.

To be clear, the Video ID is not given.

The crux of the issue is being able to extract that ID from the Youtube link inside the Glide data table.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 29, 2021, 9:54am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/8 "2021-03-29T09:54:53Z")

</div>

> [@Jamm\_Studios\_Doha](#):
>
> The crux of the issue is being able to extract that ID from the Youtube link inside the Glide data table.

It might be possible, but I can almost guarantee you that it won’t be pretty.  
Without any string manipulation functions in the GDE, any solution that succeeds with this sort of task is going to be a nasty kludge.

This is a case where I’d probably resort to a GSheet formula, and just live with the sync delay (I assume that’s why you are looking for a way to do it in Glide?)

---

<div class="post-metadata">

**Author:** ![Jamm\_Studios\_Doha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jamm_studios_doha/32/19678_2.png) [@Jamm\_Studios\_Doha](https://community.glideapps.com/u/Jamm_Studios_Doha)\
**Post date:** [March 29, 2021, 10:05am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/9 "2021-03-29T10:05:02Z")

</div>

Okay, thanks for your input!

If it doesn’t make sense to achieve it in Glide then GS would be fine. I wanted to know if it was possible/easy.

Could you point me to a thread, or let me know yourself if you can, of the simplest array formula that can achieve this?

Thanks again!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 29, 2021, 10:37am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/10 "2021-03-29T10:37:19Z")

</div>

Maybe this…

> [@Using Regex in Glide with ARRAYFORMULA + YouTube thumbnails](https://community.glideapps.com/t/using-regex-in-glide-with-arrayformula-youtube-thumbnails/19243):
>
> Just wanted to share a little tip since Glide doesn’t yet have regular expression matching, and probably a lot of people would like to generate YouTube thumbnails easily for use in Glide. I needed to extract YouTube IDs from URLs and generate thumbnail images with them. Problem is, users can input all kinds of YouTube URLs, with query params after the ID, etc, so it’s not enough to do a simple replace using Glide templates to get rid of a predictable string like “[https://youtu.be/](https://youtu.be/)” - if it we…

Worth noting however that YouTube URL’s come in a variety of formats, and from a quick look the solution offered in that post may not deal with all of them.

Here’s a Stackoverflow thread that’s worth a read…

> <https://stackoverflow.com/questions/3452546/how-do-i-get-the-youtube-video-id-from-a-url>

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 29, 2021, 12:18pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/11 "2021-03-29T12:18:34Z")

</div>

You could probably create a basic text column, but don’t fill it with anything. So an empty column. Then create a template column that’s pointed to the url column and replaces any parts that don’t contain the video id with the empty column. The end result should be the id that can be used to build the url for the image.

As an alternative, you could create a template column pointing to the url column and instead of replacing non-id parts of the url with an empty value, you directly replace the non-id parts with the parts of a url required for the image url. This will require separate template columns with partial urls to use for the replacements.

---

<div class="post-metadata">

**Author:** ![Purvang\_Joshi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/purvang_joshi/32/12645_2.png) [@Purvang\_Joshi](https://community.glideapps.com/u/Purvang_Joshi)\
**Post date:** [March 30, 2021, 12:44pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/12 "2021-03-30T12:44:58Z")

</div>

In Google Sheets, Copy this formula to get the ID.  
=ARRAYFORMULA(IF(LEN(A2:A)=0, MID(A2:A,33,11)))

A2:A is the youtube URL column.

I’m fetching statistics of 300 Videos daily via apps script.  
Also, I’ve set a trigger that is running every 3 hours.

It can fetch Thumbnails, Title, Description, total views, total comments, total likes/dislikes, timestamps.

If you’re interested to get the script, let me know.

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [March 30, 2021, 1:13pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/13 "2021-03-30T13:13:38Z")

</div>

Nice one ☝ I’m interested in seeing the script (if possible) thanks 😊

---

<div class="post-metadata">

**Author:** ![RossBoone](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rossboone/32/72496_2.png) [@RossBoone](https://community.glideapps.com/u/RossBoone)\
**Post date:** [April 20, 2022, 3:21am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/14 "2022-04-20T03:21:55Z")

</div>

Hi Guys, I realized there is actually a pre-programed feature now, to get the thumbnail from a YouTube video! In the native spreadsheet editor, make a new column, choose type “column type-\>image-\>YouTube Thumbnail”

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 20, 2022, 3:41am UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/15 "2022-04-20T03:41:28Z")

</div>

Yeah, it has been added recently.

---

<div class="post-metadata">

**Author:** ![Nadir\_Abdelrahman\_MD](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nadir_abdelrahman_md/32/5237_2.png) [@Nadir\_Abdelrahman\_MD](https://community.glideapps.com/u/Nadir_Abdelrahman_MD)\
**Post date:** [April 21, 2022, 11:40pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/16 "2022-04-21T23:40:50Z")

</div>

I am interested too.  
Thanks

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 21, 2022, 11:44pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/17 "2022-04-21T23:44:07Z")

</div>

@Nadir_Abdelrahman_MD Just use the built in column type as indicated above.

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:49pm UTC](https://community.glideapps.com/t/auto-generate-youtube-thumbnail-url/24862/19 "2024-01-17T16:49:36Z")

</div>


