Python Tutorial

How to Upload Videos to TikTok with Python

To upload a video to TikTok with Python, install the multi-upload-tool SDK (pip install multi-upload-tool) and call client.uploads.upload(). It posts through TikTok's official Content Posting API. This tutorial covers upload, scheduling, and automation in 5 minutes.

upload.py
from multi_upload_tool import MultiUploadClient

client = MultiUploadClient(api_token="your-api-token")
upload = client.uploads.upload(
    account_id='ACCOUNT_ID',
    file_path="video.mp4",
    title="My TikTok Video #python",
)
print(upload)  # {"success": True, "message": "Upload queued successfully", "data": {"uploadId": ..., "status": "pending"}}

Published via TikTok's official Content Posting API

TL;DR: Upload to TikTok with Python in 4 Lines

Terminal
pip install multi-upload-tool
Python
from multi_upload_tool import MultiUploadClient

client = MultiUploadClient(api_token="your-api-token")
upload = client.uploads.upload(
    account_id='ACCOUNT_ID',
    file_path="video.mp4",
    title="My TikTok Video #python",
)
print(upload)  # {"success": True, "message": "Upload queued successfully", "data": {"uploadId": ..., "status": "pending"}}

Why Upload to TikTok with Python?

Uploading videos to TikTok manually is fine for one video. But when you need to post daily, manage multiple accounts, or integrate TikTok publishing into your app, you need automation. Common use cases for programmatic TikTok uploads:

Content automation

Schedule a week of TikTok content with a Python script

Multi-account management

Post to 10+ TikTok accounts without logging in manually

SaaS integration

Add "publish to TikTok" as a feature in your product

Batch processing

Upload 50+ videos from a local file list

CI/CD pipelines

Automatically publish videos after editing/rendering

TikTok API Options for Python Developers

There are two approaches to upload videos to TikTok with Python:

Direct TikTok API (Hard Way)

  • Apply for TikTok Developer access (weeks)
  • Implement OAuth2 flow with PKCE
  • Handle token refresh every 24 hours
  • Manage video chunked upload protocol
  • Monitor for API breaking changes
  • Handle rate limiting and retries

Estimated time: 2-4 weeks of development

Multi Upload Tool SDK (Easy Way)

  • pip install multi-upload-tool
  • OAuth handled via dashboard (one-time)
  • Token refresh is automatic
  • Simple file upload, no chunking
  • We handle API changes for you
  • Built-in retry logic

Estimated time: 5 minutes

Step 1: Install the SDK

Install the multi-upload-tool Python package from PyPI:

Terminal
pip install multi-upload-tool

Requirements: Python 3.8+. No other dependencies.

Step 2: Get Your API Token

  1. Sign up at multi-upload-tool.com
  2. Go to Settings → API Keys
  3. Click "Create API Key" and copy your token
Security tip: Store your API token in an environment variable, not in your code. Use os.environ.get("MUT_API_TOKEN").

Step 3: Connect Your TikTok Account

  1. In the dashboard, click "Add Account" → TikTok
  2. Authorize via TikTok's official OAuth flow (no password shared)
  3. Note the Account ID shown in the dashboard. You'll need it for API calls

Step 4: Upload a Video to TikTok

upload.py
from multi_upload_tool import MultiUploadClient

# Initialize client
client = MultiUploadClient(api_token="your-api-token")

# Upload a video to TikTok
upload = client.uploads.upload(
    account_id='ACCOUNT_ID',                 # Your TikTok account ID
    file_path="/path/to/video.mp4", # Local video file
    title="My first automated TikTok! #python #coding",
    privacy_level="PUBLIC_TO_EVERYONE",  # or "SELF_ONLY", "MUTUAL_FOLLOW_FRIENDS"
)

print(f"Upload {upload['data']['uploadId']}: {upload['data']['status']}")

client.close()

That's it. Your video is queued and publishes to TikTok in the background.

Advanced: Schedule, Bulk Upload, Multi-Platform

Schedule a TikTok Post for Later

schedule.py
from multi_upload_tool import MultiUploadClient
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo

client = MultiUploadClient(api_token="your-api-token")

# Schedule for tomorrow at 7 PM New York time (timezone-aware ISO 8601)
tomorrow_7pm = (datetime.now(ZoneInfo("America/New_York")) + timedelta(days=1)).replace(
    hour=19, minute=0, second=0, microsecond=0
)

upload = client.uploads.upload(
    account_id='ACCOUNT_ID',
    file_path="video.mp4",
    title="Scheduled post 📅",
    schedule_date=tomorrow_7pm.isoformat(),
)
print(f"Scheduled for: {tomorrow_7pm}")

client.close()

Bulk Upload from a File List

bulk.py
from multi_upload_tool import MultiUploadClient

client = MultiUploadClient(api_token="your-api-token")

# List of videos with metadata
videos = [
    {"file_path": "video_01.mp4", "title": "Morning routine", "schedule_date": "2026-12-01T19:00:00Z"},
    {"file_path": "video_02.mp4", "title": "Quick tip", "schedule_date": "2026-12-02T19:00:00Z"},
]

for video in videos:
    upload = client.uploads.upload(
        account_id='ACCOUNT_ID',
        file_path=video["file_path"],
        title=video["title"],
        schedule_date=video["schedule_date"],
    )
    print(f"✅ Scheduled: {video['title']}")

client.close()

Upload to TikTok + YouTube + Instagram at Once

everywhere.py
from multi_upload_tool import MultiUploadClient

client = MultiUploadClient(api_token="your-api-token")

# Get all connected accounts
accounts = client.accounts.list(status="active")
account_ids = [a["id"] for a in accounts]

# Upload to ALL platforms in one call
upload = client.uploads.upload(
    account_id=account_ids,  # List of account IDs
    file_path="video.mp4",
    title="Published everywhere! 🚀",
)

# One result per account
for item in upload["results"]["results"]:
    print(f"{item.get('platform')}: {'queued' if item['success'] else item['error']}")

client.close()

Alternative: Use the REST API Directly

If you prefer not to use the SDK, you can call the API directly with requests:

requests
import requests

url = "https://api.multi-upload-tool.com/api/v1/upload"
headers = {"x-api-key": "YOUR_API_KEY"}

with open("video.mp4", "rb") as f:
    response = requests.post(
        url,
        headers=headers,
        files={"video": f},
        data={
            "accountId": "ACCOUNT_ID",
            "title": "My TikTok Video #python",
            "privacy_level": "PUBLIC_TO_EVERYONE",
        },
    )

print(response.json())

Troubleshooting

Video format not supported

Our API accepts MP4, MOV, and AVI. We auto-transcode to TikTok's requirements. If your file is in another format, convert it to MP4 first with FFmpeg: ffmpeg -i input.webm output.mp4

OAuth token expired

Multi Upload Tool handles token refresh automatically. If you see auth errors, reconnect your TikTok account in the dashboard. The OAuth grant may have been revoked.

Rate limit exceeded

Free tier: 13 uploads/month. Upgrade to Basic ($14.99/mo) for unlimited uploads. The SDK includes built-in retry logic with exponential backoff.

FAQ

Frequently Asked Questions

Still stuck? Read the docs or start free and see for yourself.

How do I upload a video to TikTok with Python?

Install the multi-upload-tool SDK with `pip install multi-upload-tool`, create a client with your API token, and call `client.uploads.upload(account_id='ACCOUNT_ID', file_path='video.mp4', title='My Video')`. The SDK handles OAuth2, video transcoding, and TikTok's Content Posting API.

Is there a Python library for TikTok uploads?

Yes. The `multi-upload-tool` package on PyPI provides a Python SDK for uploading videos to TikTok. Install with `pip install multi-upload-tool`. It also supports YouTube Shorts, Instagram Reels, Facebook, and LinkedIn.

Do I need TikTok developer access to use the API?

No. Multi Upload Tool handles all TikTok API complexity for you. You don't need to apply for TikTok developer access, manage OAuth tokens, or deal with the Content Posting API directly. Just use our SDK with your MUT API token.

Can I schedule TikTok posts with Python?

Yes. Add a `schedule_date` parameter with an ISO 8601 timestamp to your upload call: `client.uploads.upload(account_id='ACCOUNT_ID', file_path='video.mp4', title='Scheduled', schedule_date='2026-12-01T19:00:00Z')`.

How do I upload to TikTok and YouTube at the same time with Python?

Pass multiple account IDs to the upload method: `client.uploads.upload(account_id=[tiktok_id, youtube_id], file_path='video.mp4', title='My Video')`. One API call, both platforms.

What video formats does the TikTok upload API support?

MP4, MOV, and AVI up to 4GB. Our server-side FFmpeg processing automatically transcodes videos to meet TikTok's requirements (H.264 codec, AAC audio, 9:16 aspect ratio).

Is using a third-party API safe for TikTok? Will I get shadowbanned?

Multi Upload Tool uses TikTok's official Content Posting API. We use the official API, not browser automation. TikTok treats our uploads identically to native uploads: no shadowban risk.

How much does the TikTok upload API cost?

Free plan: 13 uploads/month. Basic: $14.99/month (unlimited uploads). Pro: $29.99/month (API access, webhooks). All plans include TikTok support.

Related Resources

Start Uploading to TikTok with Python

Free plan available. Install the SDK and publish your first TikTok video in under 5 minutes.