# YouTube Video Uploader (`dami_studio/youtube-video-uploader`) Actor

Upload a video to your YouTube channel from a URL — set title, description, tags, privacy, schedule, and a custom thumbnail. Connects to your own channel via OAuth (your login is never shipped to the cloud). Use it as the publish step of any automated video pipeline, or for scheduled uploads.

- **URL**: https://apify.com/dami\_studio/youtube-video-uploader.md
- **Developed by:** [Dami's Studio](https://apify.com/dami_studio) (community)
- **Categories:** Social media, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 video uploadeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## YouTube Video Uploader

Uploads a video from a URL to your own YouTube channel using the official YouTube Data API. It sets the title, description, tags, hashtags, privacy, schedule, and an optional custom thumbnail in one run. Built to be the publish step of an automated video pipeline (render somewhere, drop the file on a CDN, point this actor at the URL), but it works fine for one-off scheduled uploads too.

### How it works

You give it a public URL to the video file and your Google OAuth credentials. The actor downloads the file to its temp disk, authenticates with your refresh token, and calls `youtube.videos.insert` (followed by `thumbnails.set` if you passed a thumbnail). Nothing about your channel is stored beyond the run.

#### Try it free (sample mode)

Run it **without any credentials** to get one clearly-labeled `_demo` sample row showing the exact output shape — a free preview, no upload performed and nothing charged. As soon as you supply real OAuth credentials (or YouTube cookies for the browser method) it performs a real upload. You can also force the preview with the `demoMode` checkbox.

### Input

| Field | Required | Notes |
|---|---|---|
| `videoUrl` | yes | Public direct URL to the video file (.mp4/.mov). You host it (S3, a CDN, Apify key-value store). It must be reachable without auth. |
| `title` | yes | YouTube title. Trimmed to 100 characters. |
| `description` | no | Video description. Hashtags are appended to the end. |
| `tags` | no | Up to 30 tags. Anything past 30 is dropped. |
| `hashtags` | no | Appended to the description as `#tag`. Non-alphanumeric characters are stripped. |
| `privacyStatus` | no | `public`, `unlisted`, or `private`. Defaults to `private`. |
| `publishAt` | no | ISO datetime to auto-publish. Only applies when `privacyStatus` is `private` (YouTube schedules a private video to go public). |
| `thumbnailUrl` | no | Public URL to a thumbnail image. Custom thumbnails require a verified channel; if the API rejects it the upload still succeeds. |
| `categoryId` | no | YouTube category ID. Defaults to `22` (People & Blogs). 24 = Entertainment, 23 = Comedy, 27 = Education. |
| `madeForKids` | no | Declares the video as made for kids (COPPA). Defaults to false. |
| `clientId` / `clientSecret` / `refreshToken` | yes (for the API method) | Your own Google OAuth credentials from Google Cloud Console. The refresh token must carry the `youtube.upload` scope. Marked secret. |

The actor also has a `browser` method that drives YouTube Studio with exported login cookies. It works locally but tends to hit Google's session anti-fraud on cloud runs, so the API method is the default and the one to use for anything unattended. If you do use it, a residential proxy matching your usual country is strongly recommended.

### Output

One dataset record per run. The useful fields are `videoId`, `watchUrl` (the `youtu.be` link), `privacyStatus`, `scheduledFor` (null unless you set `publishAt`), `thumbnailSet`, and `uploadSeconds`. `ok: true` means the insert returned a video ID.

### Example

```json
{
  "videoUrl": "https://cdn.example.com/clips/episode-12.mp4",
  "title": "How the Roman aqueducts actually worked",
  "description": "A short breakdown of gravity-fed water systems.",
  "tags": ["history", "engineering", "rome"],
  "hashtags": ["shorts", "history"],
  "privacyStatus": "private",
  "publishAt": "2026-06-15T14:00:00Z",
  "categoryId": "27",
  "clientId": "YOUR_CLIENT_ID.apps.googleusercontent.com",
  "clientSecret": "YOUR_CLIENT_SECRET",
  "refreshToken": "YOUR_REFRESH_TOKEN"
}
````

### Pricing

$0.05 per successful upload. Pay per result, no subscription. Where an AI model is involved you bring your own OpenAI key.

### Notes

You need your own Google OAuth credentials. There is no shared app. Create an OAuth client in Google Cloud Console with the YouTube Data API enabled, then generate a refresh token with the `youtube.upload` scope. New API projects also start in testing mode, which can cap or expire tokens until you publish the OAuth consent screen, so set that up before relying on it in a pipeline.

# Actor input Schema

## `method` (type: `string`):

api = official Data API with OAuth (default, reliable; needs clientId/secret/refreshToken). browser = automate YouTube Studio with exported login cookies (works locally; cloud runs face Google's session anti-fraud).

## `demoMode` (type: `boolean`):

Return one clearly-labeled SAMPLE row instead of uploading — a free preview of the output shape, no credentials needed. The Actor also falls back to this automatically when no credentials are supplied. Uncheck (and add credentials) to upload for real.

## `videoUrl` (type: `string`):

Public direct URL to the video file to upload (.mp4/.mov). You host it (S3/CDN/Apify KV).

## `title` (type: `string`):

YouTube title (max 100 chars).

## `description` (type: `string`):

Video description (hashtags appended automatically).

## `tags` (type: `array`):

Up to 30 video tags (used by the API method).

## `hashtags` (type: `array`):

Hashtags appended to the end of the description (e.g. shorts, reddit).

## `privacyStatus` (type: `string`):

public, unlisted, or private.

## `cookies` (type: `string`):

Your exported YouTube login session: a cookies array OR a Playwright storageState ({cookies,origins}) as JSON. Export with a 'Cookie-Editor'/'Get cookies.txt' extension (for .youtube.com AND .google.com), or `npx playwright codegen --save-storage`. Kept secret.

## `channelId` (type: `string`):

Target channel ID (UC...) if your account has multiple channels.

## `thumbnailUrl` (type: `string`):

Optional public URL to a thumbnail image.

## `madeForKids` (type: `boolean`):

Declare the video as made for kids (COPPA).

## `publishAt` (type: `string`):

ISO datetime to auto-publish (API method + privacy=private).

## `categoryId` (type: `string`):

YouTube category ID. 22 = People & Blogs, 24 = Entertainment, 23 = Comedy, 27 = Education.

## `proxyConfiguration` (type: `object`):

RESIDENTIAL strongly recommended for a logged-in Google session (matches your usual country).

## `clientId` (type: `string`):

Only for method=api. From Google Cloud Console.

## `clientSecret` (type: `string`):

Only for method=api.

## `refreshToken` (type: `string`):

Only for method=api. Refresh token with the youtube.upload scope.

## Actor input object example

```json
{
  "method": "api",
  "demoMode": false,
  "videoUrl": "https://example.com/my-video.mp4",
  "privacyStatus": "private",
  "madeForKids": false,
  "categoryId": "22",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Result rows / metadata are stored in the default dataset (one row per item).

## `files` (type: `string`):

Generated media/files (video, audio, images, captions) are stored in the default key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dami_studio/youtube-video-uploader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("dami_studio/youtube-video-uploader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call dami_studio/youtube-video-uploader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dami_studio/youtube-video-uploader",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Video Uploader",
        "description": "Upload a video to your YouTube channel from a URL — set title, description, tags, privacy, schedule, and a custom thumbnail. Connects to your own channel via OAuth (your login is never shipped to the cloud). Use it as the publish step of any automated video pipeline, or for scheduled uploads.",
        "version": "0.1",
        "x-build-id": "Dbxhs5tdr0E0YxmtV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dami_studio~youtube-video-uploader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dami_studio-youtube-video-uploader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dami_studio~youtube-video-uploader/runs": {
            "post": {
                "operationId": "runs-sync-dami_studio-youtube-video-uploader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dami_studio~youtube-video-uploader/run-sync": {
            "post": {
                "operationId": "run-sync-dami_studio-youtube-video-uploader",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "method": {
                        "title": "Upload method",
                        "enum": [
                            "browser",
                            "api"
                        ],
                        "type": "string",
                        "description": "api = official Data API with OAuth (default, reliable; needs clientId/secret/refreshToken). browser = automate YouTube Studio with exported login cookies (works locally; cloud runs face Google's session anti-fraud).",
                        "default": "api"
                    },
                    "demoMode": {
                        "title": "Demo / sample mode (no real upload)",
                        "type": "boolean",
                        "description": "Return one clearly-labeled SAMPLE row instead of uploading — a free preview of the output shape, no credentials needed. The Actor also falls back to this automatically when no credentials are supplied. Uncheck (and add credentials) to upload for real.",
                        "default": false
                    },
                    "videoUrl": {
                        "title": "Video URL",
                        "type": "string",
                        "description": "Public direct URL to the video file to upload (.mp4/.mov). You host it (S3/CDN/Apify KV)."
                    },
                    "title": {
                        "title": "Video title",
                        "type": "string",
                        "description": "YouTube title (max 100 chars)."
                    },
                    "description": {
                        "title": "Description",
                        "type": "string",
                        "description": "Video description (hashtags appended automatically)."
                    },
                    "tags": {
                        "title": "Tags",
                        "type": "array",
                        "description": "Up to 30 video tags (used by the API method).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "hashtags": {
                        "title": "Hashtags",
                        "type": "array",
                        "description": "Hashtags appended to the end of the description (e.g. shorts, reddit).",
                        "items": {
                            "type": "string"
                        }
                    },
                    "privacyStatus": {
                        "title": "Privacy / visibility",
                        "enum": [
                            "public",
                            "unlisted",
                            "private"
                        ],
                        "type": "string",
                        "description": "public, unlisted, or private.",
                        "default": "private"
                    },
                    "cookies": {
                        "title": "YouTube session (cookies) — browser method",
                        "type": "string",
                        "description": "Your exported YouTube login session: a cookies array OR a Playwright storageState ({cookies,origins}) as JSON. Export with a 'Cookie-Editor'/'Get cookies.txt' extension (for .youtube.com AND .google.com), or `npx playwright codegen --save-storage`. Kept secret."
                    },
                    "channelId": {
                        "title": "Channel ID (optional, browser method)",
                        "type": "string",
                        "description": "Target channel ID (UC...) if your account has multiple channels."
                    },
                    "thumbnailUrl": {
                        "title": "Custom thumbnail URL",
                        "type": "string",
                        "description": "Optional public URL to a thumbnail image."
                    },
                    "madeForKids": {
                        "title": "Made for kids",
                        "type": "boolean",
                        "description": "Declare the video as made for kids (COPPA).",
                        "default": false
                    },
                    "publishAt": {
                        "title": "Publish at (schedule, API method)",
                        "type": "string",
                        "description": "ISO datetime to auto-publish (API method + privacy=private)."
                    },
                    "categoryId": {
                        "title": "Category ID (API method)",
                        "type": "string",
                        "description": "YouTube category ID. 22 = People & Blogs, 24 = Entertainment, 23 = Comedy, 27 = Education.",
                        "default": "22"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy (browser method)",
                        "type": "object",
                        "description": "RESIDENTIAL strongly recommended for a logged-in Google session (matches your usual country).",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "clientId": {
                        "title": "Google OAuth Client ID (API method)",
                        "type": "string",
                        "description": "Only for method=api. From Google Cloud Console."
                    },
                    "clientSecret": {
                        "title": "Google OAuth Client Secret (API method)",
                        "type": "string",
                        "description": "Only for method=api."
                    },
                    "refreshToken": {
                        "title": "Google OAuth Refresh Token (API method)",
                        "type": "string",
                        "description": "Only for method=api. Refresh token with the youtube.upload scope."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
