If you build a TikTok downloader, a Telegram bot or a content archive, you hit the same three problems quickly: the file has a TikTok logo and @username burned into it, the media links expire within minutes, and a link that worked once gives an error the next time. This guide shows how to solve all three with a single API call.
Download only content you have the right to use, and credit creators. Read the Acceptable Use Policy before you build a public tool.
Why the usual download has a watermark
When you tap Save video in the TikTok app, TikTok adds its logo and the creator’s @username to the file. The video you watch on the TikTok website is played from a different stream that has no overlay. The TikTok Downloader API fetches that playback stream, so the file you receive does not carry TikTok’s watermark.
Text that the creator put into the video themselves, such as captions or a name label, is part of the picture and stays. Only TikTok’s own overlay is missing.
Why a plain link does not work
Links to TikTok video files expire after a short time. They also only work for a client that first loaded the video page: send the same link from a script or a browser tab and the server answers with 403 Forbidden. That is why a link copied from a video page or a browser tool breaks in production, and why the video data endpoint does not hand such links out.
The Downloader API does the page load and the fetch for you, stores a copy of the file and returns a link that works anywhere until it expires.
The one-call flow
Send the video URL, or the short link a user copied from the app, and choose what you want:
curl -X POST "https://api.igramapi.com/v1/tiktok/downloads" \
-H "Authorization: Bearer $IGRAMAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"type": "video", "url": "https://vm.tiktok.com/ZMabc123/", "filename": "my-clip"}'
The response contains the download link:
{
"download_url": "https://download.example.com/files/my-clip.mp4?signature=example",
"expires_at": "2026-11-08T12:00:00Z",
"filename": "my-clip.mp4",
"content_type": "video/mp4",
"size_bytes": 15553308
}
Download the file from download_url. No API key is needed for that link, and it works for about an hour. Request a new one after expires_at.
Python example
import os
import requests
API = "https://api.igramapi.com"
HEADERS = {"Authorization": f"Bearer {os.environ['IGRAMAPI_KEY']}"}
def prepare(url, kind="video", **options):
body = {"type": kind, "url": url, **options}
response = requests.post(f"{API}/v1/tiktok/downloads", json=body, headers=HEADERS, timeout=120)
if not response.ok:
raise RuntimeError(response.json()["error"]["message"])
return response.json()
def save(link, path):
with requests.get(link["download_url"], stream=True, timeout=120) as r:
r.raise_for_status()
with open(path, "wb") as f:
for chunk in r.iter_content(1 << 16):
f.write(chunk)
clip = prepare("https://vm.tiktok.com/ZMabc123/", filename="my-clip")
save(clip, clip["filename"])
Node.js example
const API = "https://api.igramapi.com";
async function prepare(url, type = "video", options = {}) {
const response = await fetch(`${API}/v1/tiktok/downloads`, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.IGRAMAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ type, url, ...options }),
});
if (!response.ok) throw new Error((await response.json()).error.message);
return response.json();
}
const clip = await prepare("https://vm.tiktok.com/ZMabc123/", "video", { filename: "my-clip" });
console.log(clip.download_url);
Choosing the quality
By default ("quality": "best") you get the highest-quality H.264 file, which plays on every phone and browser. Some videos also have a higher resolution in H.265, which is smaller at the same quality but not supported everywhere. Ask for it by height:
{"type": "video", "url": "https://www.tiktok.com/@example_creator/video/7401234567890123456", "quality": "1080p"}
If that quality does not exist, you get HTTP 400 with quality_unavailable and a list of what does, and the request is not charged:
{
"error": {
"code": "quality_unavailable",
"message": "Quality '720p' is not available for this video.",
"details": { "available": ["1080p", "576p"] }
}
}
To show your users the choices before they download, call the TikTok Video Data API and read formats.
Sound and photos
"type": "audio"returns the sound used in the video as an MP3."type": "image"with"index": 0returns the first photo of a photo slideshow,"index": 1the second, and so on. For a normal video it returns the cover image.- Asking for a slideshow as
videoreturnsnot_a_video, so checktypein the video data if you are unsure.
Errors you should handle
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_target |
The URL is not a TikTok video link or id. |
| 400 | quality_unavailable, invalid_quality, not_a_video |
The request does not fit this video. |
| 404 | video_unavailable |
Deleted, private, or restricted by TikTok by region or age. |
| 429 | rate_limit_exceeded |
Wait for Retry-After seconds. |
| 502 | upstream_error |
TikTok could not be reached. Retry shortly; this is refunded. |
Failures on our side and invalid requests are refunded. See error handling and credits and rate limits.
What it costs
A video is 2 credits, a sound 1 credit and a photo 1 credit, and you do not have to call another endpoint first. Repeated requests for the same file reuse the stored copy, so popular videos are fast.
Checklist for a public downloader
- Accept whatever the user pastes: the endpoint resolves
vm.tiktok.comandvt.tiktok.comshort links and plain video ids. - Show the creator’s name and link back to the original video.
- Tell users to save only content they have the right to use, and remove content when a rights holder asks.
- Store the file on your side if you need it for more than an hour.