I would like to create a live event with my viewers to celebrate a subscriber milestone. However, I’m stuck on one problem: Creating the live subcount.
Additionally, (as long as this is allowed) I will give 3k robux or more to whoever can fully fix this problem.
There’s a couple of problems that occur when attempting to create a subcount that displays in real time – but the primary one is this:
The YouTube API does not allow for specific numbers. For example, if I had 72,142 subscribers, it would only display 72,100. The only workaround for this is to be signed in to the account. When I’m signed in, I can view the exact amount of subscribers I have.
Here is a tutorial on how to do it. However, this tutorial still causes the number to be rounded. If anyone knows a workaround for this, please let me know.
My question is:
How can I create an accurate subscriber count that displays in real-time?
Ah wow this is a difficult problem. In general I wouldn’t advise working around APIs as it always means breaking the terms of service, however if you really need to do this you could make it using puppeteer (https://pptr.dev/) and a server (replit.com seems good for this). Read up there if you dare. This is the way to do it the “crackhead way” as @RealMysticall said. Probably the best solution though is to just figure out a way to make it work with rounded numbers.
Mind explaining where this goes against the terms of service? I wasn’t aware that this wasn’t allowed.
Additionally, I’m not experienced enough at all to do that so I would need to have a step-by-step guide or hire a developer to make it for me. (Most likely the latter )
Also, now that I see how difficult this would be to solve, I’m adding a 3,000 robux (or more) prizepool for whoever can fix this problem (as long as this is allowed by the devforum).
Hey! Although its not easy through youtube.com there are other websites that use GET requests to show a live sub count for channels, using one of them we can use this script to get an estimate of your subscribers:
local http = game:GetService('HttpService')
local channel_id = 'UCs6yDXwXuKeLoz0d87Uhosg'
local url = 'https://api.socialcounts.org/youtube-live-subscriber-count/'..channel_id
local success,data = pcall(function()
return http:GetAsync(url)
end)
if data then
local decoded = http:JSONDecode(data)
local subs = decoded["est_sub"]
print(subs)
end
You’re going to have to scrape the from the analytics page that you’re viewing. You’re gonna have to run a webserver using something like aws, or if you want to be cheap you could run it off your pc.
That shocks me! As I’m able to dynamically unsubscribe and resubscribe and within a matter of seconds the sub count correctly updates. I’m so confused as to how this works?
Genuinely no idea. Unless youtube doesn’t want people knowing about them having a private api of sort so they have to use that as a coverup (which I find hard to believe) there has to be some api message which detects when someone unsubscribes / resubscribes.
Sorry I can’t be of much more help, late where I am and the last thing I want to do is dig through the youtube api