Skip to content
bpBrandon Perez
All notes
1 min read

Wiring an AI agent to publishing APIs: what actually took the time

Notes from connecting a personal AI agent to short-form video platforms through their official APIs. Spoiler, the code was the easy part.

Developer Tools#agents#automation#apis#ffmpeg

I'm building a pipeline where an AI agent scouts ideas, helps produce short vertical videos, and publishes them, but only after I approve each one. Here's where the time actually went.

content-pipeline.arch
  1. 01Trend scout agentdaily research · idea pitches · scheduled job
  2. 02ProductionAI video · voice · captions · ffmpeg assembly
  3. 03Human approvalpreview on phone · nothing posts without it
  4. 04Publishing APIsYouTube Data API · Instagram API · TikTok
  5. 05Analytics loopweekly metrics feed the next ideas

1. Developer onboarding, not code

Every platform has its own path: switching to a creator account, creating a developer app, adding yourself as a tester, setting up a consent screen, and often providing a public privacy policy and terms page. That last requirement is part of why this website exists.

2. "Upload by URL" needs a reachable file

Some publishing APIs don't accept a file upload. They fetch the video from a public URL. Free temporary file hosts were unreliable: one was down, and another redirected bots to an HTML page, which made processing fail with a bare ERROR. Serving the file briefly from my own machine through a short-lived tunnel, then closing it, worked every time.

3. Brand-new hostnames and local DNS

A freshly created tunnel hostname can fail on your own machine for minutes because the local resolver cached the earlier "doesn't exist" answer. Check through public DNS instead:

curl -sI --doh-url https://1.1.1.1/dns-query https://<new-hostname>/video.mp4

4. Vertical video needs per-shot framing

A single center crop from 16:9 to 9:16 chops people out of frame. Reframing shot by shot, and placing wide group shots over a blurred copy of themselves, keeps every subject visible.

5. Keep a human in the loop

Upload and publish are two separate steps. The agent stages everything as unpublished, sends me a preview, and publishes only after an explicit approval. That's cheap insurance against an automated mistake going public.