Тёмный

YouTube Data API Tutorial - Create a YouTube Subscriber Count with JavaScript 

Raddy
Подписаться 33 тыс.
Просмотров 19 тыс.
50% 1

In this video, I will show you how to use the RU-vid Data API v3 to grab and display the RU-vid Channel subscriber count using vanilla JavaScript.
Article: www.raddy.dev/...
☕ BuyMeACoffee: www.buymeacoff...
Discounts:
⚡ Hostinger: www.hostg.xyz/...
⚡ Elementor: be.elementor.c...
Recording Equipment:
◾ Microphone: amzn.to/3Ppp8Ok
◾ Shotgun Mic: amzn.to/3IVqIot
◾ Camera: amzn.to/3z0bxpF
◾ Lens: amzn.to/3Pw4s7d
◾ Lighting: amzn.to/3PGXvzW
Computer Gear:
◾ Keyboard: amzn.to/3PGXvzW
◾ Headphones: amzn.to/3PJl9fg
◾ Mouse: amzn.to/3z1TGPf
Connect with me:
◾ Website: www.raddy.dev
◾ Newsletter: www.raddy.co.u...

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 124   
@RaddyDev
@RaddyDev 4 года назад
Today we are going to learn how to work with the RU-vid API and get the Subscription Count of a channel.
@Aarusharcade
@Aarusharcade Год назад
I dont think it works anymore because there is no user id. It is replaced by the @user system
@hackmeornot2196
@hackmeornot2196 2 года назад
i spend 24 hours looking for this! Great man!
@daveperry7179
@daveperry7179 4 года назад
legend mate. I have tried and failed with several youtube API tuts but this was simple, no styling. Just heres how to grab the data. Liked and subscribed. Look forward to more vids
@RaddyDev
@RaddyDev 4 года назад
I am glad that you found it helpful. Thank you for subscribing!
@shinroka1871
@shinroka1871 3 года назад
Thankyou man! I didn't know if this was going to work because some tutorials don't teach you what to do, but you told us step by step what to do. You also went through everything very clearly, so now I have added this onto my website, thankyou! Everything works as it's supposed to! Your reward from me is two more subscribers and two more likes, because I have two accounts xD.
@RaddyDev
@RaddyDev 3 года назад
hahaha that's awesome! Thank you so much!
@shinroka1871
@shinroka1871 3 года назад
@@RaddyDev your welcome :D
@Winter_Electro
@Winter_Electro 2 года назад
Hola como puedo conseguir el contador exacto de subscriptores? porque cuando autentico a un usuario de 350k de seguidores lo redondea y no me da el numero exacto
@RaddyDev
@RaddyDev 2 года назад
Hola, Desafortunadamente, ya no puedes hacer eso. Google cambió la API y ahora los números se abrevian
@DoctorMGL
@DoctorMGL Год назад
using this API is it possible to create a notification in OBS that show up whatever there is a new subscriber on youtube ?? there is platforms for that like streamlabs , but they are very limited in term of alert video size .. extra and i want more freedom in customizing my alerts
@RaddyDev
@RaddyDev Год назад
I am not familiar with Streaming and their API's. No idea how they work, sorry. I would assume that you would need something like a NodeJs server and SocketsIO for low latency updates
@Findgoodsong
@Findgoodsong 3 года назад
hi i did everything perfect but i did not got live subscribe count it is just number 16000 i need 16235 changing subscriber but other just went great please tell me how we can do that
@ControlAltSuprimir
@ControlAltSuprimir 3 года назад
Nice video but the music is way to loud dude
@RaddyDev
@RaddyDev 3 года назад
Hi, thanks for letting me know. You are right about the audio, but unfortunately RU-vid won't let me edit it unless no re-upload. I invested in a nice mic and the newer videos should be okay
@Ginfio
@Ginfio 3 года назад
Can you help me? please and thank u. okay, so I'm trying to make an arguement with it so I can call it and output multiple chanels without having to rewrite the code over and over again. So in the end it would be like this: channela = 222 subsdribers channelb = 78232 pewdiepie = 107000000 ginfio = 1860 Like. that. To do that, the code would look like something like this: channel1.innerHTML = getSubscribers(channelb_id, myKEY) channel2.innerHTML = getSubscribers(channelb_id, my KEY) u see what I'm sayin?
@RaddyDev
@RaddyDev 3 года назад
If the Google API only accepts one ID at a time you could create an array that contains the channel IDs and then create a loop that goes and gets the data one my one. The issue with that is if you have let's say 100 accounts then you have to do 100 request which doesn't sound good I am not aware if you could do multiple accounts with one request. You could look on their documentation or search on the internet to see if somebody else has had the same problem. I hope that you solve it! 👊🦍
@Ginfio
@Ginfio 3 года назад
@@RaddyDev thank you for the response. I’m gonna go experiment with it and apply some of the things you said in ur reply... and see where I get. And ill come back.
@hoffmannjohn
@hoffmannjohn 4 года назад
Somehow that video was hard to find. Very informative, it saved me a lot of time. Thank you very much!
@RaddyDev
@RaddyDev 4 года назад
I need to update the title, description and keywords. It's probably not ranking well on RU-vid Search. Thanks for you comment and I am glad that you found the video useful.
@meitanteiedugawa8751
@meitanteiedugawa8751 3 года назад
Question I tried to change the font in more than one way for the numbers to appear in a different font than the average, but the matter did not work on the text, knowing that if I changed the font size easily, can you help me with that const subCount = document.getElementById ('subCount'); const delay = 1000; // 10 min window.subCount.fontFamily = "Impact, Charcoal, sans-serif"; window.subCount.style.fontSize = "70px";
@RaddyDev
@RaddyDev 3 года назад
Why are you not using CSS to make it look the way you want?
@ankitaburman5406
@ankitaburman5406 2 года назад
Thanks raddy the video was short concise and clear ...great 👍👍👍👍
@RaddyDev
@RaddyDev 2 года назад
Glad that you found it helpful, OtakuGirl! Thank you for the comment
@Buhllistic
@Buhllistic 3 года назад
Is it possible to make the live a live subscriber count that is actually 10-100 more than you actually have. I'm trying to get a real-time "subscriber goal counter" for my livestreams
@RaddyDev
@RaddyDev 3 года назад
Yes, there is no limit. The only thing that you have to be aware of is that channels with fewer than 1,000 subscribers, the exact (non-abbreviated) subscriber count will be shown. Once your channel passes the 1000 subscriber milestone, RU-vid will begin to abbreviate your public subscriber numbers on a sliding scale. If a channel has 4,227 subscribers, the public subscriber count will read “4.2k” until the channel reaches 4,300. If a channel has 133,017 subscribers, the public subscriber count will read “133K” until the channel reaches 134,000. And so on... It's a shame that you can't have it non abbreviated. I hope this helps
@diyordev35
@diyordev35 Год назад
Uncaught (in promise) TypeError: Cannot set properties of null (setting 'innerHTML') at script.js:14:28 I am getting this error how do i fix it?
@RaddyDev
@RaddyDev Год назад
It sounds like you are not getting any data back. On the second .then try console.log(data) and see if you get the data in the inspector under console.
@pinagotraveling
@pinagotraveling 3 года назад
Is there a way to display subscriber count from 2 channels? I put an array on youtubeUser. How can I display both of them? Thank you in advance.
@RaddyDev
@RaddyDev 3 года назад
The Google API only accepts one ID at a time and so you could create an array that contains the channel IDs and then create a loop that goes and gets the data. I am not aware if you could do multiple accounts with one request so that might be your only option
@SuperSACHINNN
@SuperSACHINNN 2 года назад
Thank you for this. I was looking for this.
@RaddyDev
@RaddyDev 2 года назад
Glad I could help
@ahmedhassan_saver
@ahmedhassan_saver 2 года назад
Bro, is there any way with js to get channel id for channels that have customURL?
@RaddyDev
@RaddyDev 2 года назад
Yeah, every channel has a unique channel ID and the custom names are kind of just a nice link to it. Usually, you can search for a channel, click on it and it should give you its unique id. I am sure that there are plenty of websites that can show you your unique id by typing the channel name
@ahmedhassan_saver
@ahmedhassan_saver 2 года назад
@@RaddyDev i didn't find any website does that, Right now, i can't find any proper way to get the id for channels that have customURL
@RaddyDev
@RaddyDev 2 года назад
@@ahmedhassan_saver Ah I see... You can do it manually, but with JS is a bit more difficult. Could you use a data scraper? So you provide the channel URL example: youtube dot com/raddydev and then use the scraper to grab the channel ID. I found it in the source code a couple of times so it should be ok to select
@atharvparlikar8765
@atharvparlikar8765 3 года назад
What if I made the project public on GitHub? I mean is the API key important or something😕😕😕
@RaddyDev
@RaddyDev 3 года назад
You can restrict the access to your API's from the Google Developers Console. The restriction controls which websites, IP addresses, or applications can use your API key. In short, as long as you don't have it open to everyone you should be fine. Thanks for the comment! 🦍
@kumarPinku
@kumarPinku 3 года назад
@@RaddyDev Is there any way to hide API key from websites
@RaddyDev
@RaddyDev 3 года назад
@@kumarPinku Not unless you use a backend language I guess. As long as you restrict it, it shouldn't be a problem. You can always re-generate a new API key if for some reason you need to do that
@ultrafilipsz.5827
@ultrafilipsz.5827 2 года назад
great tutorial, have a great day!
@RaddyDev
@RaddyDev 2 года назад
Thank you and you too, UltraFlip!
@kumarPinku
@kumarPinku 3 года назад
I want to publish it to my blog, is there any way to protect API Key so anyone except me cannot use the key. Is it safe to use the key on my website. Is there any way to hide api key from view source.
@RaddyDev
@RaddyDev 3 года назад
You can restrict your API to a specific IP address. Grab the IP address of your web server and go to the google console and you'll find the setting under Credentials
@codingwithkenny6492
@codingwithkenny6492 3 года назад
Thank you sooo much sir for making this video!! It was very helpful and I learned a lot from it!! Once again, thank you so much for posting this video and perfectly explaining how to create a youtube subscribe count Data API! :) You got a new subscriber!
@RaddyDev
@RaddyDev 3 года назад
Glad that you found it helpful! Thanks for the comment
@codingwithkenny6492
@codingwithkenny6492 3 года назад
@@RaddyDev You are very welcome and thank you! :))
@codingwithkenny6492
@codingwithkenny6492 3 года назад
@@RaddyDev 10/10!!!
@AmeerYT
@AmeerYT 3 года назад
very helpful
@RaddyDev
@RaddyDev 3 года назад
Thank you!
@shaikshiriyaj498
@shaikshiriyaj498 2 года назад
How get random user details by entering in search
@RaddyDev
@RaddyDev 2 года назад
You might be able to use the RU-vid Search API to do that
@KalaniChen
@KalaniChen 2 года назад
thanks a lot
@RaddyDev
@RaddyDev 2 года назад
You are most welcome
@Ginfio
@Ginfio 3 года назад
Great video: - *easy to understand* - *easy to follow* - *simple* Thx for this.
@RaddyDev
@RaddyDev 3 года назад
Thank you!
@shivarajghimire3198
@shivarajghimire3198 3 года назад
Please make video on real time subscriber count ❤
@stoic_sheep
@stoic_sheep Год назад
how to add channel name?
@Findgoodsong
@Findgoodsong 3 года назад
So if we follow same process can we get any RU-vidr subscriber count ??
@RaddyDev
@RaddyDev 3 года назад
Yes, you can
@samifootballlive8412
@samifootballlive8412 3 года назад
Make video on real time subscriber count love from Nepal ❤
@RaddyDev
@RaddyDev 3 года назад
Sorry, for some reason I didn't see this comment. I actually did a video which was showing a counter (almost real time). It was checking every 10 minutes or so and that was to save on API calls. It's not super accurate as RU-vid changed the way the API displays the numbers, but it's as close as you can get it I guess. I actually had to delete that video as there was something wrong with the intro. I might re-do the intro and re-upload it. It's a very long video, but I could section the RU-vid API section to make it easy. Thanks for the comment and sorry for the slow reply!
@Marcus7z
@Marcus7z 3 года назад
you are awesome
@RaddyDev
@RaddyDev 3 года назад
thank you 🙂
@Findgoodsong
@Findgoodsong 3 года назад
So if we follow same process can we get any RU-vidr subscriber count
@RaddyDev
@RaddyDev 3 года назад
👍
@didenkuswendi
@didenkuswendi 4 года назад
cool. how to detect people was subscribed? base on login google
@RaddyDev
@RaddyDev 4 года назад
You can do setInterval to run the getSubscribers function at specified intervals. Let's say make it check the RU-vid API every 10 min...
@didenkuswendi
@didenkuswendi 4 года назад
@@RaddyDev I'm trying to use youtube api to get a list of subscribers to a channel i own then check a user's login to find out if he's subscribed or not. and im trying this link and always get error : www.googleapis.com/youtube/v3/subscriptions?part=subscriberSnippet&myRecentSubscribers=true&key=xxxxx where's the fault? *Sorry for my bad english
@RaddyDev
@RaddyDev 4 года назад
I think you need to add &mine=true but you also have to be authorized. By the way brother, don't post your key publicly as people might abuse it.
@rjmediaindonesia6869
@rjmediaindonesia6869 2 года назад
nice tutorial
@RaddyDev
@RaddyDev 2 года назад
Thank you, Rj
@erforscher
@erforscher 9 месяцев назад
we cannot get the channel id anymore
@RaddyDev
@RaddyDev 9 месяцев назад
How come? You can't find it?
@erforscher
@erforscher 9 месяцев назад
Ah, found it. ui got changed, need to go to share channel link button, rather than url
@kumarPinku
@kumarPinku 3 года назад
Will it charge for using this api?
@RaddyDev
@RaddyDev 3 года назад
You can use the free tier, but there is a limit. I can't remember the exact number you'll have to see it in their pricing model. If you find that you are using the free limit then you can pay for more API calls if you wish
@D3str0
@D3str0 3 года назад
Sorry but using ${} that's not jQuery?
@RaddyDev
@RaddyDev 3 года назад
It does look like it a little bit, but it's not jQuery. They are called Template literals (template strings) and they are quite nice to use for embedding expressions just like I have on the video. To use them, you just use backticks and then you can add your variables with the dollar sign and the expression - ${expression}. Thank you for the question :)
@jakubkliszczak
@jakubkliszczak 2 года назад
Awesome tutorial :) Would it be possible to make such a counter for a live subscribers sum of many RU-vid channels?
@RaddyDev
@RaddyDev 2 года назад
Yes, you can do that. I am pretty sure that you can chain the channels id's to get more results at once. Let's say we have: Jakub and LinusTechTips You can store their channels id's into something like an array and then you would chain them like so: youtube/v3/channels?id=[replace with Jakub channel ID]&id=[replace with LinusTechTips ID]&key=[YOUR_API_KEY] I hope this helps :-)
@FunctionDev
@FunctionDev 3 года назад
make a liking counter in real time when you are broadcasting a livestream on youtube PLEASE!
@RaddyDev
@RaddyDev 3 года назад
Have you looked at the likescounter dot com website? Maybe that's something you could use instead of making a custom one. I like the idea
@LightslicerGP
@LightslicerGP 3 года назад
This is insane, but what is the response.json for?
@RaddyDev
@RaddyDev 3 года назад
We get the response from the API and we parse it as JSON. Another example would be if you want the response to return as text you would do response.text()
@LightslicerGP
@LightslicerGP 3 года назад
@@RaddyDevohh, and then that's what goes into the console right?
@RaddyDev
@RaddyDev 3 года назад
Yeah that's it. In the console we can see the data and how is structured to help us select what we need
@------.-....-..----.-----..--.
@------.-....-..----.-----..--. 3 года назад
😳
@Findgoodsong
@Findgoodsong 3 года назад
I want to make real subscribers count and live of one RU-vidr name 4k gaming nepal but how can i make real time count of his subscriber please tell me reply please
@RaddyDev
@RaddyDev 3 года назад
You can use setInterval to call the API every second and that would give you the live subscriber count. There are limited free API calls that you can make, so you would have to pay. I created a live subscriber count for myself a while back, but I just set it to update every 10 min and that was fine for me. I also used the javascript library Odometer to make the numbers spin which was pretty cool and easy to do. I've added the setInterval on my blog post in the description. I can add the odometer one too if you want it.
@Findgoodsong
@Findgoodsong 3 года назад
@@RaddyDev we cannot get one for free my parents won't let me use there money.
@RaddyDev
@RaddyDev 3 года назад
It's free to get started and you can do 10,000 units per day. Just don't request the API every second and that should be more than enough to build your project
@Findgoodsong
@Findgoodsong 3 года назад
@@RaddyDev but i am beginners 😂😂😂
@Findgoodsong
@Findgoodsong 3 года назад
@@RaddyDev can you make video for that??
@meitanteiedugawa8751
@meitanteiedugawa8751 3 года назад
How to get subscription information in real time from RU-vid I don't know how some RU-vid channels get instantaneous subscribers Whenever you use this script, you get a fixed counter like 15K 15000 appears statically and the numbers do not move momentarily like 15001 until the 16000 channel arrives
@RaddyDev
@RaddyDev 3 года назад
Unfortunately, you can't do that anymore. Google changed the API and now the numbers are abbreviated. The only way to get the accurate subscriber count is from your RU-vid account in RU-vid Studio. Not sure what else you can do... it sucks
@meitanteiedugawa8751
@meitanteiedugawa8751 3 года назад
Thank you, although I am baffled by some of the RU-vid channels that broadcast live subscribers to this day You can watch it by writing top 50 RU-vid subscriptions It uses RU-vid API
@RaddyDev
@RaddyDev 3 года назад
​@@meitanteiedugawa8751 I am not sure why that is, but it could be that it only works for the TOP channels. This is from the Social Blade website: UPDATE 1: Sept 17 2019 3pm ET (19:00 UTC) - RU-vid has started to roll this out to the API. Some (not all) channels now show abbreviated counts. Here is the full article if you want to have a look. socialblade.com/blog/abbreviated-subscriber-counts-on-youtube/ If you look at the comments, you can see that a lot of people want the live subscriber count back, but Google doesn't seem to care.
@meitanteiedugawa8751
@meitanteiedugawa8751 3 года назад
@@RaddyDev thanks for your reply There are always things that do not have an explanation or are out of the ordinary Greetings to you
@RaddyDev
@RaddyDev 3 года назад
@@meitanteiedugawa8751 I found this website which does it for the TOP RU-vid subscribers. I think that they are just very good predictions. The website let's you embed the subscriber count, but it's still abbreviated for everyone else. Here is MrBeast: livecounts.io/youtube-live-subscriber-count/UCX6OQ3DkcsbYNE6H8uQQuVA
@screenisscreaming934
@screenisscreaming934 3 года назад
Please make video on real time subscriber count
@RaddyDev
@RaddyDev 3 года назад
One day, when Google changes the way their API works.
@PaxSchlacht118
@PaxSchlacht118 3 года назад
what is the website
@RaddyDev
@RaddyDev 3 года назад
Console cloud Google
@rockwithkunal
@rockwithkunal 3 года назад
Awsome Video, but I have a question bro, can we search most viewed videos in India on youtube from youtube api ??
@RaddyDev
@RaddyDev 3 года назад
Their API is quite large and powerful so I would assume that you can do it. Have you look in their documentation
@rockwithkunal
@rockwithkunal 3 года назад
@@RaddyDev I m unable to find it, that's why I m asking
@RaddyDev
@RaddyDev 3 года назад
You can do it all. You can search by location and get results by view count which is what you want. Here is the link: developers.google.com/youtube/v3/docs/search/list
@rockwithkunal
@rockwithkunal 3 года назад
@@RaddyDev It is not possible through this
@Findgoodsong
@Findgoodsong 3 года назад
Help
@duzeybilisim8425
@duzeybilisim8425 3 года назад
Thank you vary much but today the chanel id in chanel home url
@RaddyDev
@RaddyDev 3 года назад
Glad that you found it useful
@rohitdhende9716
@rohitdhende9716 3 года назад
very nice bro... u deserve more views ... +1 sub from me and difficult to find the right video
@RaddyDev
@RaddyDev 3 года назад
Glad that you found it useful. Thank you!
@Findgoodsong
@Findgoodsong 3 года назад
Helpp😔😔😔
@shinroka1871
@shinroka1871 3 года назад
??
@sushant6970
@sushant6970 3 года назад
Please make vedio on real time subscriber count
@RaddyDev
@RaddyDev 3 года назад
Okay Dokey
Далее
annyang! SpeechRecognition with JavaScript
13:04
Просмотров 4,7 тыс.
How to Use YouTube API in Node - Full Tutorial
24:43
Просмотров 18 тыс.
iPhone 16 для НИЩЕБРОДОВ!
00:51
Просмотров 610 тыс.
Sigma Girl Pizza #funny #memes #comedy
00:14
Просмотров 1,9 млн
1.4: JSON - Working with Data and APIs in JavaScript
16:22
Build a Web Scraper (super simple!)
23:26
Просмотров 954 тыс.
Don't Learn Machine Learning, Instead learn this!
6:21
Postman Api Testing Tutorial for beginners
16:45
Просмотров 32 тыс.
JavaScript Pro Tips - Code This, NOT That
12:37
Просмотров 2,5 млн