2

I am able to post a video from a public URL as a REEL:

import requests
token = "..."
api_version="v23.0"
headers = {
 "Content-Type": "application/json",
 "Authorization": f"Bearer {token}"
}
# Get my user ID
id_url = f"https://graph.instagram.com/{api_version}/me"
id_response = requests.get(id_url, headers=headers)
user_id = id_response.json()['id']
# Upload a video on a public URL as a REEL
url = f"https://graph.instagram.com/{api_version}/{user_id}/media"
video_url = "https://download.samplelib.com/mp4/sample-5s.mp4"
payload = {
 "video_url": video_path,
 "media_type": "REELS",
}
response = requests.post(
 url=url,
 headers=headers,
 data=payload
)
post_id = json.loads(out.content)['id']
# wait until video has been uploaded ...
publish_url = f"https://graph.instagram.com/{api_version}/{user_id}/media_publish"
payload = {
 "creation_id": post_id
}
response = requests.post(publish_url, headers=headers, data=payload)
reel_id = response.json()['id'])

However, I cannot upload a local file. I've tried following the documentation but without any luck. I currenty have an App with Instagram Login.

Ajeet Verma
4,5567 gold badges20 silver badges31 bronze badges
asked Aug 15, 2025 at 16:25
4

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.