instagram private api code example
Example 1: instagram api python
git clone [email protected]:Instagram/python-instagram.git
Example 2: instagram private api
from api import privateAPI
api = privateAPI(username = "username", password = "password")
response = api.userInfo(user_id = "427553890")
info = response.json()
print ("USERNAME: ", info["user"]["username"])
api.upload("path_to_image/image.jpg", "Description for image \n #hot #hacker #wow")
api.follow(user_id = "427553890")
api.unfollow(user_id = "427553890")
response = api.listFollower(user_id = "427553890")
list_followers = response.json()
response = api.listFollowing(user_id = "427553890")
list_followings = response.json()
next_max_id = list_followings["next_max_id"]
response = api.listFollowing(user_id = "427553890", max_id = next_max_id)
response = api.userMedia(user_id = "427553890")
next_max_id = response.json()["items"][-1]["next_max_id"]
response = api.userMedia(user_id = "427553890", max_id = next_max_id)
media_list = response.json()
Example 3: instagram private api
from api import privateAPI
api = privateAPI(username = "username", password = "password")
response = api.userInfo(user_id = "427553890")
info = response.json()
print ("USERNAME: ", info["user"]["username"])
api.upload("path_to_image/image.jpg", "Description for image \n #hot #hacker #wow")
api.follow(user_id = "427553890")
api.unfollow(user_id = "427553890")
response = api.listFollower(user_id = "427553890")
list_followers = response.json()
response = api.listFollowing(user_id = "427553890")
list_followings = response.json()
next_max_id = list_followings["next_max_id"]
response = api.listFollowing(user_id = "427553890", max_id = next_max_id)
response = api.userMedia(user_id = "427553890")
next_max_id = response.json()["items"][-1]["next_max_id"]
response = api.userMedia(user_id = "427553890", max_id = next_max_id)
media_list = response.json()