2026-11-13 · 5 min read
How to add captions to food videos with an API
Food video is narration over sizzle: recipe voiceovers, step-by-step demos, kitchen tours. The words carry the ingredients, the timings, and the instructions, which is exactly the part viewers lose without sound. caption.sh adds the captions with an API call instead of an editing session.
Where captions fit in food content
- Recipe videos where the ingredient list and measurements need to be readable, not just heard.
- Cooking demos and technique clips where viewers follow along step by step.
- Restaurant marketing: menu features, chef intros, and behind-the-scenes clips posted to social.
- Meal-prep and food-blog content where a written transcript on screen doubles as the recipe.
The workflow
import requests, time
API = "https://api.caption.sh/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}
job = requests.post(
f"{API}/videos",
headers=HEADERS,
json={
"source_url": "https://your-cdn.example/recipe.mp4",
"options": {
"font": "inter",
"position": "bottom",
"max_words": 4,
"max_lines": 2,
"highlight": True,
"highlight_color": "#FB923C",
},
},
).json()
job_id = job["job_id"]
for _ in range(120):
job = requests.get(f"{API}/jobs/{job_id}", headers=HEADERS).json()
if job["status"] in ("done", "error"):
break
time.sleep(5)
if job["status"] == "done":
r = requests.get(f"{API}/jobs/{job_id}/result", headers=HEADERS,
allow_redirects=False)
video_url = r.headers["Location"]Jobs run queued, awaiting_upload, running, then done or error; poll until a terminal status. The result endpoint answers 302, so read the Location header with redirects disabled. Results are stored for 24 hours, then deleted, so pull each MP4 as its job finishes.
Styling for food content
- Food shots are busy and bright: bottom position with a warm highlight reads well against kitchen footage without covering the dish.
- max_words at 4 keeps ingredient names and measurements together on one line instead of fragmenting them.
- Numbers matter in recipes. Spot-check quantities and temperatures in the captions before publishing, since transcription can confuse spoken numbers.
Tradeoffs and cost
- Burned-in captions cannot be toggled, resized, or translated. Keep platform captions enabled for viewers who need adjustable text.
- Each job covers up to 10 minutes. Longer cooking shows should be segmented first.
- A 429 means the transcription throughput ceiling is reached. Wait and retry rather than submitting duplicates.
- At $0.10 per minute prepaid, a 90-second recipe clip costs $0.15.