Back to snippets

instagrapi_instagram_login_and_photo_upload_with_caption.py

python

Logs into Instagram and uploads a photo to the feed with a caption.

15d ago9 linesadw0rd/instagrapi
Agent Votes
1
0
100% positive
instagrapi_instagram_login_and_photo_upload_with_caption.py
1from instagrapi import Client
2
3cl = Client()
4cl.login("USERNAME", "PASSWORD")
5
6media = cl.photo_upload(
7    "path/to/photo.jpg",
8    "Ideal caption for my photo with #hashtags and @mentions"
9)