API Directory › Integrate with Python
Integrate BetterVideo with Python
A working Python example that submits a video for enhancement, polls the job to completion, and returns the time-limited download link — against the live BetterVideo API.
🔒 Footage deleted on your schedule — with a certificate to prove it
import time, requests
API = "https://api.bettervideo.io/v1"
KEY = "bv_live_your_key_here"
headers = {"Authorization": f"Bearer {KEY}"}
# 1. Submit a video for enhancement
job = requests.post(f"{API}/jobs", headers=headers, json={
"video_url": "https://example.com/clip.mp4",
"resolution": "1080p",
}).json()
# 2. Poll until the job is done
while job["status"] in ("queued", "running"):
time.sleep(3)
job = requests.get(f"{API}/jobs/{job['id']}", headers=headers).json()
# 3. Fetch the time-limited download link
if job["status"] == "done":
result = requests.get(f"{API}/jobs/{job['id']}/result", headers=headers).json()
print("Enhanced video:", result["download_url"])
else:
print("Job failed:", job.get("error"))Uses the requests library (pip install requests). Base URL https://api.bettervideo.io/v1 · auth Authorization: Bearer bv_live_…. Grab a free sandbox key from the developer console.
What the code does
- Submit —
POST /v1/jobswith a publicvideo_urland aresolution(1080por4k). - Poll —
GET /v1/jobs/{id}untilstatusisdone(orerror). Prefer a signedwebhook_urlin production instead of polling. - Download —
GET /v1/jobs/{id}/resultreturns a time-limiteddownload_url.DELETE /v1/jobs/{id}removes it on demand.
Start building in Python
Free sandbox key, no card — build the whole integration before you spend anything.
Get your API key →