LevPasha的Instagram API python、instabot和许多其他API自2020年10月24日起不再起作用,因为Facebook不推荐传统API,现在有了一个新的、需要身份验证的API。现在需要在Facebook上注册你的应用程序,才能访问许多API功能(通过oembed),这些功能以前不需要任何身份验证即可使用
bot.upload_photo(image, caption="blah blah blah") #the image variable here is a path to that image
all_posts = bot.get_your_medias() #this will return all of your medias of the account
#to get the info of each media, use
for post in all_posts:
print(bot.get_media_info(post))
LevPasha的Instagram API python、instabot和许多其他API自2020年10月24日起不再起作用,因为Facebook不推荐传统API,现在有了一个新的、需要身份验证的API。现在需要在Facebook上注册你的应用程序,才能访问许多API功能(通过oembed),这些功能以前不需要任何身份验证即可使用
有关新实现和如何迁移的更多详细信息,请参见https://developers.facebook.com/docs/instagram/oembed/
您仍然可以通过新的oEmbed API和python获取追随者列表等。这需要注册应用程序,通过python请求包使用您的身份验证密钥调用新的get API,然后处理结果
您可以使用https://github.com/LevPasha/Instagram-API-python调用Instagram API 而且,如果您想直接调用API,也可以使用requests包。 它还支持GraphQLAPI。 这里您可以看到一个示例: https://gist.github.com/gbaman/b3137e18c739e0cf98539bf4ec4366ad
有一个名为instabot的库。此实用库具有与insta帐户交互所需的所有功能/方法。阅读其文档here
pip安装为:
pip install instabot
首先,假设您只想登录到您的帐户
要获得你的追随者名单
如果你想上传照片或发帖
该库中还有许多其他可用的函数/方法
实际上,使用python与instagram交互非常有趣。你会玩得很开心的。享受:)
相关问题 更多 >
编程相关推荐