TrollflixDevelopers

Quickstart

Upload your first video to Trollflix in about two minutes.

Create an API key

Go to Settings → Integrations and click Create API key. Copy the key now: it starts with tfx_ and is shown only once.

Treat it like a password

Anyone with your key can post to your channel. Keep it in an environment variable or a secret manager, never in client-side code or a public repo.

Store it in your environment

export TROLLFLIX_API_KEY="tfx_..."

Upload a video

Any MP4 between 2 and 120 seconds works.

curl -X POST "https://uploads.backend.trollflix.com/api/php/developer/upload_video" \
  -H "Authorization: Bearer $TROLLFLIX_API_KEY" \
  -F "[email protected]" \
  -F "caption=When the build passes on the first try #programming"
upload.mjs (Node.js 20+)
import { openAsBlob } from "node:fs";

const form = new FormData();
form.append("file", await openAsBlob("meme.mp4"), "meme.mp4");
form.append("caption", "When the build passes on the first try #programming");

const response = await fetch(
  "https://uploads.backend.trollflix.com/api/php/developer/upload_video",
  {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.TROLLFLIX_API_KEY}` },
    body: form,
  },
);

console.log(await response.json());
upload.py
import os
import requests

with open("meme.mp4", "rb") as video:
    response = requests.post(
        "https://uploads.backend.trollflix.com/api/php/developer/upload_video",
        headers={"Authorization": f"Bearer {os.environ['TROLLFLIX_API_KEY']}"},
        files={"file": ("meme.mp4", video, "video/mp4")},
        data={"caption": "When the build passes on the first try #programming"},
        timeout=600,
    )

print(response.json())

Check the response

A successful upload returns success: true (shortened here, see the full response):

{
  "success": true,
  "content_id": 18301,
  "message_code": "content_upload_success",
  "slug_url": "when-the-build-passes-on-the-first-try-programming"
}

Your meme will be at https://www.trollflix.com/meme/{slug_url} once processing finishes, usually within a few minutes.

Next steps