Vigyata.AI
Is this your channel?

Get YouTube Subscriber Count

89 views· 4 likes· 12:46· May 4, 2026

🛍️ Products Mentioned (1)

Get YouTube Subscriber Count in Google Sheets with Apps Script + YouTube Data API v3 Get Code: https://bettersheets.co/snippets/get-youtube-subscriber-count-from-youtube-channel-url This episode shows how to pull a YouTube channel’s subscriber count into Google Sheets by writing a Google Apps Script custom function that accepts a channel URL containing a handle. It walks through enabling the YouTube Data API v3 in Apps Script, creating and selecting a matching Google Cloud project, setting the project number in Apps Script, completing the OAuth consent screen, enabling the YouTube Data API in Google Cloud, and creating an API key. The script extracts the handle from a YouTube URL with a regular expression, calls the YouTube search endpoint to convert the handle to a channel ID, then calls the channels endpoint to return statistics.subscriberCount. It also covers fixing a small items/items typo, formatting the result with TEXT, and adding an @customfunction annotation so the function appears in Sheets. 00:00 Goal and Overview 00:27 Apps Script Setup 01:53 Link Cloud Project 03:03 OAuth Consent Screen 04:09 Enable YouTube API 04:39 Create API Key 06:35 Code Handle to Channel ID 08:46 Fetch Subscriber Count 10:10 Use in Sheets and Format 11:10 Custom Function Autocomplete 12:04 Wrap Up and Next Steps

🎬 More from Better Sheets