Fireship · @fireship
How Tom Scott & Mr. Beast use APIs to update their videos programmatically
Uploaded May 25, 2020 · Length 8:53
Summary
Tom Scott and Mr. Beast use APIs to update their YouTube videos programmatically, teaching how to work with Google APIs, Node.js, and schedule background jobs.
- api updates youtube videos
- tom scott mr beast
- google api nodejs
- background jobs cloud functions
- api authentication oauth
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
today on how they do it if you watch my
- 0:01
youtube channel there's a good chance
- 0:03
you've already seen Tom Scott's video
- 0:04
this video has X amount of views if not
- 0:07
check it out
- 0:07
but basically what he does is run a
- 0:09
background job that hits the YouTube API
- 0:11
to update the title with the latest view
- 0:13
count every few minutes then another
- 0:14
youtuber you may have heard of mr. beast
- 0:16
appears to be doing the same thing in
- 0:17
his latest video where the thumbnail
- 0:19
updates every few minutes with the
- 0:20
amount of money given away if you're
- 0:22
wondering how to do this you might be a
- 0:23
little disappointed when Tom Scott says
- 0:25
I'm not gonna talk about the exact
- 0:26
details of my code here it is not the
- 0:28
important part because code is just
- 0:30
incredibly dull on camera but I have to
- 0:33
disagree there because in my opinion if
- 0:34
the code is the most exciting part so in
- 0:36
today's video we'll take a deep dive
- 0:37
into api's and i'll show you exactly how
- 0:39
these youtubers are updating their
- 0:41
videos automatically in the background
- 0:42
if you're new here like and subscribe
- 0:44
and you can grab the full source code
- 0:45
from github my primary mission today is
- 0:47
to teach you everything you need to know
- 0:48
about api's which is an essential skill
- 0:50
for both front-end and back-end
- 0:51
developers along the way you'll learn
- 0:53
about API authentication and oaah
- 0:55
- how to work with Google API s and
- 0:57
nodejs and how to schedule your code to
- 1:00
run in the background with a service
- 1:01
cloud function but first let's answer
- 1:03
the question what is an API an
- 1:05
application programming interface is
- 1:07
simply a way for two pieces of software
- 1:09
to talk to each other in this demo we
- 1:11
have our application which will
- 1:12
eventually live on a cloud function it
- 1:14
needs to talk to YouTube to get the view
- 1:16
count for a video and then tell YouTube
- 1:17
to update the video with a new title to
- 1:20
facilitate this YouTube has a standard
- 1:21
set of functions where developers can
- 1:23
request the data they need on the web
- 1:25
api's are accessed over HTTP or in other
- 1:28
words there's a URL on the internet that
- 1:30
connects that server to the rest of the
- 1:32
Internet the most popular standard for
- 1:33
implementing API is in today's world is
- 1:35
rest which stands for representational
- 1:37
state transfer API is that implement the
- 1:39
standard like YouTube are called restful
- 1:41
api is the most important concept to
- 1:43
understand is that restful api s are
- 1:45
stateless which means the client and the
- 1:47
server don't need to know anything about
- 1:49
each other's internal state instead they
- 1:51
simply pass messages back and forth the
- 1:53
process starts when the client your
- 1:55
application makes a request an HTTP
- 1:58
request message has a very specific form
- 1:59
at the start line contains the URL of


