How to Download TikTok Videos with an API (2026 Guide)
Need to download TikTok videos from code? Whether you're archiving content, building a trend monitor, or piping videos into a transcription job, doing it through an API is the cleanest path. No app, no watermark hack, no scraper to maintain.
This guide walks through it with the TikTok Video Download API. It uses the same request shape as our YouTube Download API, so if you've already integrated that one you can copy your code and change one word.
What you can do
The TikTok Video Download API lets you:
- Download videos in MP4, AVI, or WebM with quality from 240p to 1080p
- Pull audio only in MP3, M4A, OGG, or WAV
- Get metadata back. Title, duration, thumbnail.
- Hand off a temporary, pre-signed download URL hosted on our servers. Valid for 1 hour.
- Hit our S3 cache on repeat downloads. Same
(videoId, format, quality)comes back in under 2 seconds.
Why use the API instead of yt-dlp or scraping
A few practical reasons:
- No yt-dlp binary to ship, no FFmpeg infra, no S3 buckets to provision
- 7 output formats with built-in conversion
- Short share links work too. Paste
vm.tiktok.com/...orvt.tiktok.com/...and you're done - Same request shape as
/youtube/download. If you're already calling that one, you change the word "youtube" to "tiktok" and you're shipped
API Endpoint
POST https://api.socialkit.dev/tiktok/download
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | TikTok video URL. Regular and short share links both work. |
access_key | string | Yes | Your API access key |
format | string | No | Output format: mp4, mp3, avi, webm, m4a, ogg, wav. Default mp4. |
quality | string | No | Video quality: 240p, 360p, 480p, 720p, 1080p. Default 720p. |
Example request
POST https://api.socialkit.dev/tiktok/download
Content-Type: application/json
{
"access_key": "your-access-key",
"url": "https://www.tiktok.com/@thepeteffect/video/7522711492140059912",
"format": "mp4",
"quality": "720p"
}
Example response
{
"success": true,
"data": {
"url": "https://www.tiktok.com/@thepeteffect/video/7522711492140059912",
"title": "Why Do Cats Attack You Randomly? 🫠",
"duration": "0:49",
"durationSeconds": 49,
"thumbnail": "https://p19-common-sign.tiktokcdn.com/...",
"downloadUrl": "https://socialkit-downloads.s3.amazonaws.com/cache/tiktok_7522711492140059912_720p.mp4?...",
"fileSize": 5210953,
"fileSizeMB": "4.97 MB",
"format": "mp4",
"quality": "720p",
"expiresIn": "1 hour"
}
}
The downloadUrl is a pre-signed S3 link, valid for an hour. Use it directly to fetch the file or redirect your user to it.
Code examples
JavaScript / Node.js
const axios = require('axios');
async function downloadTikTokVideo(videoUrl, accessKey, format = 'mp4', quality = '720p') {
try {
const response = await axios.post('https://api.socialkit.dev/tiktok/download', {
access_key: accessKey,
url: videoUrl,
format,
quality,
});
return response.data;
} catch (error) {
console.error('Error downloading TikTok video:', error.response?.data || error.message);
throw error;
}
}
// Usage
const videoUrl = 'https://www.tiktok.com/@thepeteffect/video/7522711492140059912';
const accessKey = 'your-access-key';
downloadTikTokVideo(videoUrl, accessKey, 'mp4', '720p')
.then((data) => {
console.log('Title:', data.data.title);
console.log('Size:', data.data.fileSizeMB);
console.log('Download URL:', data.data.downloadUrl);
});
Python
import requests
def download_tiktok_video(video_url, access_key, format='mp4', quality='720p'):
endpoint = 'https://api.socialkit.dev/tiktok/download'
payload = {
'access_key': access_key,
'url': video_url,
'format': format,
'quality': quality,
}
response = requests.post(endpoint, json=payload)
response.raise_for_status()
return response.json()
# Usage
video_url = 'https://www.tiktok.com/@thepeteffect/video/7522711492140059912'
access_key = 'your-access-key'
data = download_tiktok_video(video_url, access_key, format='mp4', quality='720p')
print(f"Title: {data['data']['title']}")
print(f"Size: {data['data']['fileSizeMB']}")
print(f"Download URL: {data['data']['downloadUrl']}")
Save the file locally (Python)
import requests
def download_and_save(video_url, access_key, output_path, format='mp4', quality='720p'):
# Step 1: Get the download URL
result = download_tiktok_video(video_url, access_key, format, quality)
download_url = result['data']['downloadUrl']
title = result['data']['title']
# Step 2: Download the file
print(f'Downloading "{title}"...')
file_response = requests.get(download_url)
with open(output_path, 'wb') as f:
f.write(file_response.content)
print(f'Saved to {output_path} ({result["data"]["fileSizeMB"]})')
# Usage
download_and_save(
'https://www.tiktok.com/@thepeteffect/video/7522711492140059912',
'your-access-key',
'video.mp4',
format='mp4',
quality='720p',
)
PHP
<?php
function downloadTikTokVideo($videoUrl, $accessKey, $format = 'mp4', $quality = '720p') {
$endpoint = 'https://api.socialkit.dev/tiktok/download';
$payload = json_encode([
'access_key' => $accessKey,
'url' => $videoUrl,
'format' => $format,
'quality' => $quality,
]);
$ch = curl_init($endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Usage
$videoUrl = 'https://www.tiktok.com/@thepeteffect/video/7522711492140059912';
$accessKey = 'your-access-key';
$data = downloadTikTokVideo($videoUrl, $accessKey, 'mp4', '720p');
echo "Title: " . $data['data']['title'] . "\n";
echo "Size: " . $data['data']['fileSizeMB'] . "\n";
echo "Download URL: " . $data['data']['downloadUrl'] . "\n";
?>
cURL
curl -X POST "https://api.socialkit.dev/tiktok/download" \
-H "Content-Type: application/json" \
-d '{
"access_key": "your-access-key",
"url": "https://www.tiktok.com/@thepeteffect/video/7522711492140059912",
"format": "mp4",
"quality": "720p"
}'
Supported formats
Video
| Format | Extension | Notes |
|---|---|---|
| MP4 | .mp4 | Default. Use this unless you have a reason not to. |
| AVI | .avi | Older container. Useful for legacy editing tools. |
| WebM | .webm | Open format with VP8/VP9. |
Audio
| Format | Extension | Notes |
|---|---|---|
| MP3 | .mp3 | Standard. Good for podcast clips and TTS pipelines. |
| M4A | .m4a | AAC. Closest to TikTok's native audio stream, highest fidelity. |
| OGG | .ogg | Open format with Vorbis. |
| WAV | .wav | Uncompressed. Biggest file, no quality loss. |
Quality options
For video formats (MP4, AVI, WebM):
| Quality | Resolution | When to pick it |
|---|---|---|
| 240p | 426 × 240 | Tiny files for dataset building or previews |
| 360p | 640 × 360 | Light mobile, low bandwidth |
| 480p | 854 × 480 | Standard mobile |
| 720p | 1280 × 720 | HD, TikTok's normal export. Default. |
| 1080p | 1920 × 1080 | Full HD when the source actually has it |
Most TikToks land at 720p so the default usually matches the source. Drop lower for dataset work, push to 1080p only when the original supports it.
Common use cases
Bulk archiving
Keep copies of trending TikToks before they get deleted. A nightly script pulls top videos for a hashtag, calls the download API, and writes the metadata to a database.
Audio extraction into transcription
Pull MP3 from TikTok, send through Whisper or another speech-to-text engine, and you've got a searchable transcript layer. Useful for brand monitoring, trend research, or fact-checking. (Or skip the audio step entirely and use the TikTok Transcript API directly.)
Cross-platform repurposing
Download a high-performing TikTok in MP4, re-cut for YouTube Shorts and Instagram Reels. Same source, three platforms, one API call.
AI and RAG pipelines
Feed the raw MP4 to multi-modal models for object detection, scene classification, or training-data generation. The 30 MB cap covers nearly every standard TikTok upload we tested.
Competitor monitoring
Auto-download competitor TikToks daily, pair with the Comments API for sentiment, build an internal trend dashboard.
Error handling
Standard HTTP status codes. The cases you'll actually see:
| Status | What it means | What to do |
|---|---|---|
| 200 | Success | Use data.downloadUrl to fetch the file |
| 400 | Bad URL or format | Check the URL is a real TikTok link and format/quality are in the allowed list |
| 401 | Access key missing | Add access_key to the query, body, or x-access-key header |
| 403 | Access key invalid or monthly quota exhausted | Verify the key or upgrade your plan |
| 404 | Could not download | Video may be private, deleted, or region-locked |
| 429 | Per-tier rate limit hit | Wait for the window to reset, or upgrade for a higher per-minute cap |
The response also includes an X-Credits-Remaining header so you can track your quota client-side.
Pricing
The TikTok Download API runs on the same credit pool as the rest of SocialKit:
- Free, 20 requests/month, no card
- Starter, $13/mo, 2,000 requests
- Higher tiers up to 1,000,000 requests/mo, see pricing
1 successful download = 1 credit. Failed requests don't count. Cache hits still count as 1 credit because you're still calling the API.
Pair it with the other TikTok APIs
The TikTok Download API is one piece of SocialKit. The same access key also gets you:
- TikTok Transcript API. Spoken text with timestamps.
- TikTok Summarizer API. AI summary of the video.
- TikTok Stats API. Views, likes, shares, comment count.
- TikTok Comments API. Comments with author and likes.
- TikTok Channel Stats API. Channel-level metrics.
- TikTok Search API. Find videos by keyword.
Same shape, different platform? How to Download YouTube Videos with an API.
Get started
The free TikTok Video Downloader needs no code. 20 credits a month, sign-up takes a minute. For the API itself, see the docs.