How can I post an image to Facebook using Python?
You can use the facebook provided Python SDK to upload photos using an oauth key.
Once you get the oauth key, you can upload a picture with GraphAPI.put_object():
graph = facebook.GraphAPI(oauth_access_token)
photo = open("picture.jpg", "rb")
graph.put_object("me", "photos", message="You can put a caption here", source=photo.read())
photo.close()
Unfortunately, the Python SDK is discontinued now. Will not work. Need to use Javascript / PHP / iOS / Android APIs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With