Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get YouTube sub count onto a Roblox game?

Asked by 5 years ago

On this game: https://web.roblox.com/games/2599973805/PewDiePie-vs-T-Series

They have a life subcount of pewdiepie and tseries How is it possible that they got the subcount onto roblox? I've never seen that before (It is acurate and updating real time)

0
Might wanna use some type of Http fr2013 88 — 5y
0
They use HttpService to send requests and stuff to socialblade or something. User#24403 69 — 5y
0
Httpservice. LoganboyInCO 150 — 5y

1 answer

Log in to vote
1
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
5 years ago

You can easily do that using youtube's api and roblox's HttpService

Here's an example:

local HS = game:GetService"HttpService"
local ApiKey = "your youtube api key here"

while wait(2) do
    local resp = HS:GetAsync("https://www.googleapis.com/youtube/v3/channels?part=statistics&id=UC-lHJZR3Gqxm24_Vd_AJ5Yw&key=" .. ApiKey, true)
    resp = HS:JSONDecode(resp)

    textlabel.Text = resp.items[1].statistics.subscriberCount
end

here's an example response

0
Awesome thx didnt know u could do that, ill try this barrettr500 53 — 5y
0
I put in my apikey on line 2 but on line 5 do you know how I would change that to another youtubers channel? barrettr500 53 — 5y
0
change the channel id after the &id= part Amiaa16 3227 — 5y
0
got it thx barrettr500 53 — 5y
Ad

Answer this question