API Reference
The TubePull Developer API lets you fetch video metadata and queue downloads programmatically. Completed downloads are delivered as secure, signed, time-limited links on dl.tubepull.com.
Introduction
Base URL
https://tubepull.com/api/v1
Authentication
Authenticate every request with a Bearer token in the Authorization header. Generate a key from your API keys dashboard.
Authorization: Bearer tp_live_your_api_key_here
Responses
All responses are Content-Type: application/json and use a consistent envelope.
On success:
{ "success": true, "data": { ... } }
On error, the error field is an object with a machine-readable code and a human-readable message:
{ "success": false, "error": { "code": "error_code", "message": "Human-readable message" } }
Rate limit headers
Every response includes your current limit state:
X-RateLimit-Limit— your plan's hourly request capX-RateLimit-Remaining— requests left in the current hourly windowX-RateLimit-Reset— Unix timestamp when the window resetsX-Credits-Remaining— download credits left this billing period
GET /video/metadata
Returns metadata for a YouTube video without consuming a download credit.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Full YouTube video URL |
Example request
curl -X GET "https://tubepull.com/api/v1/video/metadata?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \
-H "Authorization: Bearer tp_live_your_api_key_here"
Example response
{
"success": true,
"data": {
"platform": "youtube",
"video_id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up",
"duration": 213,
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg",
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}
}
duration is in seconds. A successful lookup consumes one metadata credit.
Error codes
| HTTP | Code |
|---|---|
| 400 | invalid_request |
| 400 | unsupported_platform |
| 402 | metadata_quota_exceeded |
| 401 | unauthorized |
| 429 | rate_limited |
POST /video/download
Queues a video for download. Returns a request_token to poll via /video/status.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Full video URL |
format | string | No | video or audio (default: video). audio returns MP3. |
quality | string | No | One of best, 2160, 1440, 1080, 720, 480, 360 (default: best) |
Example request
curl -X POST "https://tubepull.com/api/v1/video/download" \
-H "Authorization: Bearer tp_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"format": "video",
"quality": "1080"
}'
Example response
Returns 202 Accepted with a request_token. Poll /video/status with this token to retrieve the download URL.
{
"success": true,
"data": {
"request_token": "9f8c1a2b3d4e5f60718293a4b5c6d7e8",
"status": "queued",
"platform": "youtube",
"video_id": "dQw4w9WgXcQ",
"format": "video",
"quality": "1080",
"overage": false
}
}
A successful queue consumes one download credit. On paid tiers, overage is true when the request is billed past your included allowance; on the free tier the allowance is a hard cap (402).
Error codes
| HTTP | Code |
|---|---|
| 400 | invalid_request |
| 400 | unsupported_platform |
| 402 | download_quota_exceeded |
| 401 | unauthorized |
| 429 | rate_limited |
| 502 | enqueue_failed |
GET /video/status
Poll job status. Returns a secure, signed download URL when complete. Download links expire 1 hour after they are issued.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The request_token returned by /video/download |
Status values
queued · claimed · running · done · failed
Example request
curl -X GET "https://tubepull.com/api/v1/video/status?token=9f8c1a2b3d4e5f60718293a4b5c6d7e8" \
-H "Authorization: Bearer tp_live_your_api_key_here"
Example response (done)
{
"success": true,
"data": {
"status": "done",
"request_token": "9f8c1a2b3d4e5f60718293a4b5c6d7e8",
"video_id": "dQw4w9WgXcQ",
"download_url": "https://dl.tubepull.com/d/...&sig=...",
"expires_in": 3600,
"file_size_bytes": 41884320,
"file_mime": "video/mp4"
}
}
Example response (failed)
{
"success": true,
"data": {
"status": "failed",
"request_token": "9f8c1a2b3d4e5f60718293a4b5c6d7e8",
"video_id": "dQw4w9WgXcQ",
"error": "unavailable",
"message": "The download failed."
}
}
Note: download_url expires expires_in seconds (1 hour) after it is issued. Re-poll /video/status to mint a fresh link. A request for another user's token returns 404 not_found.
GET /credits
Returns your current credit balance and billing period. Takes no parameters.
Example request
curl -X GET "https://tubepull.com/api/v1/credits" \
-H "Authorization: Bearer tp_live_your_api_key_here"
Example response
{
"success": true,
"data": {
"plan": "studio500",
"downloads": { "limit": 500, "used": 1, "remaining": 499 },
"metadata": { "limit": 10000, "used": 13, "remaining": 9987 },
"overage": { "downloads": 0, "cents": 0 },
"period_start": "2026-06-01 00:00:00.000",
"period_end": "2026-07-01 00:00:00.000"
}
}
POST /auth/key
Programmatically generate a new API key. Requires an existing valid API key (or a session cookie for web-authenticated users). The raw key is returned once and never stored — save it immediately.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
label | string | No | A human-readable label for the key |
Example request
curl -X POST "https://tubepull.com/api/v1/auth/key" \
-H "Authorization: Bearer tp_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{ "label": "my-app" }'
Example response
Returns 201 Created. The raw key is shown once — store it immediately.
{
"success": true,
"data": {
"key": "tp_live_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
"key_prefix": "tp_live_a1b2",
"label": "my-app",
"created_at": "2026-06-30 14:04:05.123"
}
}
Error reference
| HTTP Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or malformed parameter |
| 400 | unsupported_platform | URL is not a supported video platform |
| 401 | unauthorized | Missing, invalid, or revoked API key |
| 402 | download_quota_exceeded | Monthly download allowance exhausted (free tier hard cap) |
| 402 | metadata_quota_exceeded | Monthly metadata allowance exhausted |
| 404 | not_found | No download job found for the given token |
| 405 | method_not_allowed | Wrong HTTP method for this endpoint |
| 429 | rate_limited | Hourly request limit reached for this key |
| 502 | metadata_unavailable | Upstream metadata probe failed — retry |
| 502 | enqueue_failed | Could not queue the download — retry |
| 502 | delivery_failed | File no longer available — request a fresh download |
Rate limits
Requests are limited per API key on a rolling hourly window. Exceeding the limit returns 429 RATE_LIMITED.
| Plan | Hourly request limit |
|---|---|
| Sandbox (Free) | 10 |
| Dev 100 | 30 |
| Studio 500 | 60 |
| Scale 2000 | 120 |
| Enterprise | 500 |