Skip to main content

Its A Gram Live is a Python script that create a Instagram Live and provide you a rtmp server and stream key to streaming using sofwares like OBS-Studio.

Project description

GitHub PyPI GitHub tag (latest by date)

It's A Gram Live

It's A Gram Live is a Python script that create a Instagram Live and provide you a rtmp server and stream key to streaming using sofwares like OBS-Studio or XSplit Broadcaster.


pip install ItsAGramLive


from ItsAGramLive import ItsAGramLive

live = ItsAGramLive()

# or if you want to pre-define the username and password without args
# live = ItsAGramLive(
#    username='foo',
#    password='bar'
# )

python3 -u yourInstagramUsername -p yourPassword -proxy user:password@ip:port

The output will give you the RTMP Server address and the Stream key (automatically copied to your clipboard)

Usage with FFMPEG

Note: It is not possible use commands like chat or wave with this script. The live will be finish when the file finish the streaming.

import argparse  
import subprocess  
from ItsAGramLive import ItsAGramLive  

parser = argparse.ArgumentParser(add_help=True)  
parser.add_argument("-u", "--username", type=str, help="username", required=True)  
parser.add_argument("-p", "--password", type=str, help="password", required=True)  
parser.add_argument("-f", "--file", type=str, help="File", required=True)  
args = parser.parse_args()  

live = ItsAGramLive(username=args.username, password=args.password)  

if live.login():  
    print("You'r logged in")  

    if live.create_broadcast():  

        if live.start_broadcast():  
            ffmpeg_cmd = "ffmpeg " \  
                         "-rtbufsize 256M " \  
                         "-re " \  
                         "-i '{file}' " \  
                         "-acodec libmp3lame " \  
                         "-ar 44100 " \  
                         "-b:a 128k " \  
                         "-pix_fmt yuv420p " \  
                         "-profile:v baseline " \  
                         "-s 720x1280 " \  
                         "-bufsize 6000k " \  
                         "-vb 400k " \  
                         "-maxrate 1500k " \  
                         "-deinterlace " \  
                         "-vcodec libx264 " \  
                         "-preset veryfast " \  
                         "-g 30 -r 30 " \  
                         "-f flv '{stream_server}{stream_key}'".format(

            print('CTRL+C to quit.')  
      , shell=True)  
            except KeyboardInterrupt:  
            except Exception as error:  

python3 -u yourInstagramUsername -p yourPassword -f /path/to/video/file.mp4


  • info Show details about the broadcast
  • mute comments Prevent viewers from commenting
  • unmute comments Allow viewers do comments
  • viewers List viewers
  • chat Send a comment
  • pin Send a comment and pin it
  • unpin Remove a pinned comment
  • comments Get the list of comments
  • wave Wave to a viewer
  • stop Terminate broadcast


Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.



Buy me a coffee

Buy Me A Coffee

Instagram Bot

Check my Instagram Bot: BurbnBot

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ItsAGramLive-1.6.tar.gz (8.7 kB view hashes)

Uploaded source

Built Distribution

ItsAGramLive-1.6-py3-none-any.whl (21.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page