Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

Download Instagram Reel using Python

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

In this article, we will discuss how to download Instagram reel using Python.

Instagram is a social networking platform owned by Facebook. In Python, there are numbers of libraries available by which we can solve some real-life problems and it also provides some tools to scrape information from Instagram. One of the tools is Instascrape Python Package. Instascrape is the powerful Instagram data scrapping toolkit.  

Installation :

Install insta-scrape library from PyPI

pip install insta-scrape

To download reels from Instagram first import all the required libraries. In our example, we are importing the time module because while saving the file we will concatenate time with the filename to avoid naming conflict. Now add Session-Id and Headers. Session-Id is valid until you logged out. so when u will next time, again you need to pass a new session-id that time. ( You will get your session-id in Session Storage by Inspecting the page ). It is not that easy to scrape data directly due to updated policies of Instagram so we have to pass the session id into the headers. Using Reel Module and Providing Download Location we can get the job done.


insta_reel=Reel(‘instagram link’)


By following the above procedure, you will get downloaded reel in your specified directory.   

Example: Download Instagram reels using Python


from instascrape import Reel
import time
# session id
SESSIONID = "Paste session Id Here"
# Header with session id
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)\
    AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.74 \
    Safari/537.36 Edg/79.0.309.43",
    "cookie": f'sessionid={SESSIONID};'
# Passing Instagram reel link as argument in Reel Module
insta_reel = Reel(
# Using  scrape function and passing the headers
# Giving path where we want to download reel to the
# download function".\\Desktop\\reel{int(time.time())}.mp4")
# printing success Message
print('Downloaded Successfully.')


My Personal Notes arrow_drop_up
Last Updated : 19 Nov, 2021
Like Article
Save Article
Similar Reads
Related Tutorials