TikTok to MP4 converter API
Convert a TikTok video to MP4 with one POST. The response returns a retained storage URL, a direct play URL, and file metadata.
- One POST, One MP4
- Retained Storage URLs
- Direct Play URL Included
- TTL Control
- Idempotency Key Support
- Server-Side Key Required
Request examples
curl -X POST "https://api.agentbody.io/v1/tiktok/video/download" \
-H "Authorization: Bearer <YOUR_AGENTBODY_API_KEY>" \
-H "Content-Type: application/json" \
-d '{"ttl":"1d","url":"YOUR_URL"}'Response examples
Documented responses from the OpenAPI specification.
Downloaded TikTok media links with persistent storage.
{
"expires_at": "2026-01-08T00:00:00Z",
"file_size_mb": 15.2,
"play_url": "https://example.com/play.mp4",
"storage_url": "https://example.com/storage/video.mp4",
"ttl": "1w",
"video_id": "7050551461734042926"
}Features
The tiktok.video_download operation downloads the media file of one public TikTok video. Your server holds the API key; the endpoint returns a retained storage URL plus the direct play URL in a single call.
One POST, One MP4
Send POST /v1/tiktok/video/download with a TikTok video URL. A successful 200 returns video_id, play_url, storage_url, file_size_mb, ttl, and expires_at — everything a media pipeline needs in one response.
Retained Storage URLs
The storage_url points to a fully saved MP4 file, valid for the selected retention TTL — not an expiring CDN redirect. Hand it to a queue worker or fetch it hours later without re-running the conversion.
Direct Play URL Included
Alongside the retained file, the response carries play_url for immediate playback or streaming. Use play_url for previews and storage_url for downloads — both come back in the same call.
TTL Control
The optional ttl parameter selects how long the storage file is retained. The response echoes the TTL and the exact expires_at timestamp, so your pipeline always knows the download deadline.
Idempotency Key Support
Pass an Idempotency-Key header to safely retry failed requests without duplicate charges. The gateway deduplicates by key, so a network retry never triggers a second download for the same video.
Server-Side Key Required
The endpoint requires an AgentBody API key held on your server. Never expose the key in client-side code; route all calls through your backend to keep the key secure and your usage tracked.
How to use
Integrate TikTok to MP4 conversion in three steps with the API.
Get Your API Key
Create a free AgentBody account and generate an API key from the dashboard. The key authenticates every request and tracks usage against your balance.
POST The Video URL
Send a POST request to /v1/tiktok/video/download with the TikTok video URL in the request body. Optionally set ttl for the storage retention period, and include an Idempotency-Key header for safe retries.
Receive The Download Links
A successful 200 response returns storage_url and play_url plus the video ID, file size, and expiry timestamp. Download the MP4 from storage_url, or stream it directly from play_url.
Frequently asked questions
How does the TikTok to MP4 converter API work?
Send a POST request to /v1/tiktok/video/download with a TikTok video URL. The API downloads the video's media file, saves it as a tiktok mp4 in retained storage, and returns the storage URL, a direct play URL, the video ID, file size, and expiry timestamp — the same download tiktok mp4 workflow the free tool uses, automated.
What input formats are supported for the url parameter?
The url parameter takes a TikTok video link — a full tiktok.com video URL or a share link. The API resolves the link to the underlying public video. Private or deleted videos return a 400 or 502 error.
How long is the storage URL valid?
The storage_url stays valid for the retention period selected by the ttl parameter; the response echoes both ttl and the exact expires_at timestamp. Download the file before expiry, or re-run the conversion with a new idempotency key.
What error codes does the endpoint return?
400 for a malformed or unsupported URL, 401 for a missing or invalid API key, 409 for idempotency conflicts, and 502/503/504 for upstream failures. Failures are not billed; retry upstream errors with the same idempotency key.
Does the API remove watermarks or re-encode?
No. The API saves the media file as served by the platform and does not re-encode or guarantee watermark removal. The MP4 you receive matches the source stream; use downloaded content within TikTok's terms and the creator's rights.
Can I convert TikTok to MP4 in bulk?
Each call converts exactly one video. For bulk workflows, loop over your URL list with one POST per video and a unique idempotency key per call; per-call pricing is fixed and shown on the pricing page.