Use TikTok Video, Audio & Cover Downloader with Python
Download TikTok videos, cover thumbnails, background audio, and slideshow images by post URL, with quality selection and a stable download link per file.
1. Choose the data you need
Review the published README for supported collection modes, examples, and limits. The recipe below uses the current published input definition.
2. Prepare a source-based input
This JSON contains published prefills and required-field defaults. Review every value for your task before running it; it is not a promise of successful collection.
{
"assetTypes": [
"video"
],
"downloadToKv": true,
"maxConcurrency": 1,
"maxFileSizeMb": 100,
"maxItems": 1,
"postUrls": [
"https://www.tiktok.com/@nba/video/7693329153680035102"
],
"quality": "540p",
"videoVariant": "clean"
}
Download input.example.json and save your reviewed copy as input.json.
| Field | Type | Required | Description |
|---|---|---|---|
postUrls | array | required | TikTok post URLs or IDs. Accepts /@user/video/ID, /@user/photo/ID, /video/ID, /photo/ID, embed URLs (/embed/v2/ID), vm.tiktok.com / vt.tiktok.com / /t/ short links, m.tiktok.com/v/ID.html, and bare numeric post IDs. Duplicates are processed once. |
assetTypes | array | optional | Assets to produce for each post. 'video' = MP4; 'audio' = TikTok sound; 'cover' = cover image; 'slideshow' = ordered photo frames; 'metadata' = post/author/stats/music row. |
videoVariant | string | optional | 'clean' = no-watermark MP4 (requires a same-page browser session and is always re-hosted). 'watermarked' = logo copy, usable as an expiring CDN URL. 'both' = one row per variant. |
quality | string | optional | Target clean-video quality. 'best' sorts by resolution first, then bitrate. Watermarked copies are single-resolution. |
downloadToKv | boolean | optional | Store watermarked video, audio, cover, and slideshow files in the run's Key-Value Store and return stable kvsUrl links. Clean video is always stored because its source URL is session-bound. Set false to return expiring CDN URLs only. |
maxFileSizeMb | integer | optional | Per-file size cap. Files above the cap produce a 'too_large' status row instead of a partial download. |
maxItems | integer | optional | Maximum number of unique posts to process. Inputs beyond the cap receive a 'limit_reached' status row. |
maxConcurrency | integer | optional | Number of posts processed in parallel (1-3). Embed requests are retried with backoff when TikTok rate-limits them. |
proxyConfiguration | object | optional | Optional. The actor uses a direct connection by default and does not require a proxy. Use this only if you want to route requests through Apify Proxy. |
3. Start an Actor run
Set APIFY_TOKEN in your environment. Python 3.10 or newer is sufficient; this recipe uses no third-party packages.
Execution may incur charges. Review current pricing on Apify. The request asks for a 120-second timeout and a charge limit; these settings are subject to Apify’s pricing and do not guarantee an all-inclusive spending cap.
import json
import os
import urllib.request
# Save the schema-derived example as input.json; review and edit it first.
with open("input.json", encoding="utf-8") as stream:
actor_input = json.load(stream)
token = os.environ["APIFY_TOKEN"]
request = urllib.request.Request(
"https://api.apify.com/v2/acts/dslkxaZlYGt90DdOe/runs?timeout=120&maxTotalChargeUsd=0.50",
data=json.dumps(actor_input).encode("utf-8"),
headers={"Authorization": "Bearer " + token, "Content-Type": "application/json"},
method="POST",
)
# This starts a potentially billable run. Do not automatically retry this POST.
with urllib.request.urlopen(request, timeout=40) as response:
run = json.load(response)["data"]
print("Run ID:", run["id"])
print("Status:", run["status"])
# Inspect and download results in Apify Console once the run succeeds.
4. Inspect the actual results
Open the run in Apify Console and wait for a successful completion. Use the published output schema to locate results and the dataset schema to understand declared views. Missing or optional record fields must not be treated as guaranteed values.
One dataset row per asset (video clean/watermarked, audio, cover, slideshow frame, metadata) plus explicit status rows for unavailable, private, region-blocked, age-gated, duplicate, over-limit, and too-large inputs. Each row carries post identity, variant, quality, MIME type, byte size, dimensions, duration, stable Key-Value Store link, original CDN URL, expiry, and status.
Questions before you run
Which inputs are required?
The published required fields are postUrls
What does this guide verify?
The fields, prefills, and schema links are rendered from the published build. This is a usage recipe, not a paid live extraction test. Source availability and collection results can vary.
What if the run request times out?
Check Apify Console before retrying. The first request may already have created a run. Do not automatically repeat a run-creation POST.
Generated from source build 0qqLJHUzNNtm8LCyD and its README and schemas. Source changes regenerate this guide; no third-party editorial claims are inferred.