Python 3 Instagram GraphQL API Example to Download Instagram Video Post From URL Using yt-dlp
111 views
Jun 3, 2025
Buy the full source code of application here:
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you a
0:04
Python module which can download your
0:06
Instagram videos directly inside your
0:09
terminal so there is a package here just
0:12
search for this package
0:16
YTDL_P i think this is actually the
0:19
package here so if you just search for
0:21
this YT sorry
0:25
YT_DLP so this is actually the package
0:28
here
0:31
so what you need to
0:33
do simply execute this
0:37
command to install this i have already
0:40
installed it
0:42
so
0:44
now just create a simple app py
0:48
file and first of all we just need to
0:50
import this module so we simply say
0:53
import yt
0:56
we import this module and then we simply
0:58
write the Instagram URL where the video
1:02
is located
1:04
so you can take any post here so we are
1:07
taking this post we copy the URL and
1:10
paste it so we provide this URL here and
1:14
then we need to provide some options
1:16
right here like this so here we
1:25
specify this option
1:29
and so we need to download the full
1:32
video so we provide the path here
1:36
so after that we simply need to call
1:38
this with
1:40
yt DLP and it contains this function
1:44
YouTube
1:47
dl and here we
1:50
pass this options that we specify and uh
1:55
as
1:57
y dl and here it contains this function
2:02
ydl dot download and then here we simply
2:06
pass the URL that you
2:09
specified that's all so this is the
2:12
overall code required so if I run this
2:14
script now so what will happen it will
2:18
go to the URL and it will download that
2:20
Instagram's video so we run the script
2:24
here so you can see it is downloading
2:29
it you can see 100% complete so now the
2:33
video has been downloaded you can see
2:41
that so internally it is using the
2:44
Instagram graphql API it is
2:47
communicating with that to download the
2:49
video you can take any example here
2:51
let's suppose I take a different video
2:53
this video so you just need the URL and
2:57
uh you need to paste the URL once again
3:00
it will communicate with the Instagram
3:01
graphql API and the nice thing about
3:04
this module it's totally free you don't
3:06
require any API key you can do it
3:08
unlimited number of time and once again
3:11
the video has been downloaded in a MP4
3:14
format you can see that so with this
3:17
module you can build out a web
3:18
application where you allow user to
3:21
submit the URL and then download the
3:23
video automatically in the browser so
3:25
it's a great Python module communicating
3:28
with the GraphQL Instagram
3:31
API and uh you just need the
3:36
URL you can see simply paste the URL of
3:41
the
3:43
video and just run the script so you can
3:46
see we can do it unlimited number of
3:49
time
3:51
so you can use this module to download
3:55
Instagram videos so thank you very much
3:57
for watching this video and also check
3:58
out my website freemediattools.com
4:01
uh which contains thousands of tools
#Multimedia Software
#Online Media
#Photo & Video Sharing
#Video Sharing