Simple Upload

The simple upload endpoint can only be used to upload images(gifs).

You can get more information for this at docs

follow the steps below to upload an image:

with open("path/to/image", "rb") as media:
    resp = my_api.upload_media_simple(media=media)

also you can upload with base64 encoded image:

import base64

with open("path/to/image", "rb") as f:
    media_data = base64.b64encode("utf-8")
    resp = my_api.upload_media_simple(media_data=media_data)