API reference

TubeMP4 Developer API

All API responses use JSON. Keep keys server-side and authenticate with an HTTP Bearer header. The base URL is https://tubemp4.com.

Authentication

Authorization: Bearer tubemp4_live_your_key

Keys are shown once when created. Revoke a leaked key from your account immediately.

Endpoints

GET/api/v1/video/metadata?url=…

Fetch title, thumbnail, duration, and available formats.

POST/api/v1/video/download

Queue a download with url, format, and quality.

GET/api/v1/video/status?id=…

Poll a job until status is completed and downloadUrl is present.

GET/api/v1/credits

Inspect plan limits and current-period usage.

POST/api/account/api-keys

Create a key from an authenticated TubeMP4 account.

Download jobs

POST /api/v1/video/download
{
  "url": "https://youtube.com/watch?v=…",
  "format": "mp4",
  "quality": "1080p"
}

The response includes a job ID. Poll the status endpoint until it returns completed. Delivery links are temporary; store the source URL and request a new job when needed.

YouTube format mapping

For video, send format: "mp4" with a quality such as 720p, 1080p, 1440p, or 4K. For audio, send format: "mp3" with quality: "128" or "320", or use format: "m4a". The source and provider still determine which outputs are available.

Quota windows

Developer API allowances reset at the beginning of each UTC calendar month. Metadata and download quotas are tracked separately, and only responses below HTTP 400 are counted.

Errors

TubeMP4 uses normal HTTP status codes: 400 invalid input, 401 invalid key, 402 exhausted allowance, 404 missing job, and 5xx provider or configuration failures. Security throttling may return 429 when enabled at the edge.