API dokumintaasje

Foar API-prizen klikje hjir

De Tikt.com API wurdt host op Tikt.com .


Autentikaasje

Om tagong te krijen ta de Tikt.com API, moatte jo jo unike API-kaai ynfiere. Jo kinne in API-kaai krije troch jo oan te melden mei jo e-mailadres. Tink derom om jo API-kaai geheim te hâlden.

Autentikaasje mei de API wurdt behannele fia HTTP-headers. Alle oanfragen fereaskje in autorisaasjekoptekst mei jo API-kaai yn de opmaakkaai: YOUR_API_KEY , wêrby't YOUR_API_KEY de kaai is dy't beskikber is op jo akkountside.

Foar feiligens moatte alle oanfragen ferstjoerd wurde oer in fersifere HTTPS-ferbining om jo gegevens te beskermjen tidens de oerdracht.


Download Endpoint

Extract media from any supported URL with a single synchronous request. No polling required.

POST https://api.tikt.com/api/download

ParameterTypeDescription
urlstringThe URL to extract media from (JSON body)

Headers: Authorization: YOUR_API_KEY, Content-Type: application/json

import requests

headers = {
    "Authorization": "API_KEY",
    "Content-Type": "application/json"
}
r = requests.post(
    url="https://api.tikt.com/api/download",
    headers=headers,
    json={"url": "URL"}
)

if r.status_code == 200:
    data = r.json()
    for item in data.get("items", []):
        print(f"Type: {item['type']}, URL: {item['url']}")
else:
    print(f"Error: {r.status_code} - {r.text}")
const axios = require('axios');

async function download() {
    try {
        const response = await axios.post(
            'https://api.tikt.com/api/download',
            { url: "URL" },
            { headers: { "Authorization": "API_KEY", "Content-Type": "application/json" } }
        );

        for (const item of response.data.items) {
            console.log(`Type: ${item.type}, URL: ${item.url}`);
        }
    } catch (error) {
        console.error(`Error: ${error.response?.status} - ${error.response?.data}`);
    }
}

download();
<?php

$ch = curl_init("https://api.tikt.com/api/download");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: API_KEY",
    "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(["url" => "URL"]));

$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($statusCode === 200) {
    $data = json_decode($response, true);
    foreach ($data['items'] as $item) {
        echo "Type: {$item['type']}, URL: {$item['url']}\n";
    }
} else {
    echo "Error: $statusCode - $response\n";
}

?>
curl -X POST "https://api.tikt.com/api/download" \
  -H "Authorization: API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "URL"}'
Response
{
    "success": true,
    "items": [
        {
            "url": "https://...",
            "type": "video",
            "thumbnail": "https://...",
            "mime_type": "video/mp4",
            "site": "tiktok",
            "title": "Video title"
        }
    ]
}

Conversion Endpoints

Convert media to different formats. Returns a binary file stream.

EndpointOutput FormatContent-Type
POST /api/convert/mp3MP3 audioaudio/mpeg
POST /api/convert/mp4MP4 videovideo/mp4
POST /api/convert/wavWAV audioaudio/wav
POST /api/convert/gifGIF imageimage/gif

All conversion endpoints are at https://api.tikt.com.

Request body (JSON):

ParameterTypeRequiredDescription
urlstringYesThe media URL to convert
options.start_timenumberNoStart time in seconds
options.end_timenumberNoEnd time in seconds
options.audio_qualitystringNoAudio bitrate (e.g. "128", "192", "320")
options.video_qualitystringNoVideo quality (e.g. "720", "1080")
options.h264booleanNoForce H.264 codec for MP4
options.subtitlesbooleanNoEmbed subtitles if available
Example: Convert to MP3
import requests

headers = {
    "Authorization": "API_KEY",
    "Content-Type": "application/json"
}

r = requests.post(
    url="https://api.tikt.com/api/convert/mp3",
    headers=headers,
    json={
        "url": "URL",
        "options": {
            "audio_quality": "192",
            "start_time": 10,
            "end_time": 45
        }
    },
    stream=True
)

if r.status_code == 200:
    with open("output.mp3", "wb") as f:
        for chunk in r.iter_content(chunk_size=8192):
            f.write(chunk)
    print("Downloaded output.mp3")
else:
    print(f"Error: {r.status_code} - {r.text}")
curl -X POST "https://api.tikt.com/api/convert/mp3" \
  -H "Authorization: API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "URL", "options": {"audio_quality": "192"}}' \
  --output output.mp3

Error Handling

All errors return a JSON response with an error field:

// 400 Bad Request
{"error": "Missing URL"}

// 401 Unauthorized
{"error": "Invalid API token"}

// 402 Payment Required
{"error": "Insufficient credits"}
[Error: All translation engines failed for batch: MADLAD batch translation failed: CUDA out of memory. Tried to allocate 2.00 MiB. GPU 0 has a total capacity of 23.87 GiB of which 3.62 MiB is free. Process 3280094 has 228.00 MiB memory in use. Process 2050901 has 246.00 MiB memory in use. Process 3358747 has 336.00 MiB memory in use. Process 3364221 has 336.00 MiB memory in use. Process 3373233 has 2.10 GiB memory in use. Process 3380506 has 2.10 GiB memory in use. Process 3437459 has 1.31 GiB memory in use. Process 3437461 has 1.17 GiB memory in use. Process 3437456 has 1.23 GiB memory in use. Process 3437458 has 1.29 GiB memory in use. Process 3437454 has 1.31 GiB memory in use. Process 3437463 has 1.20 GiB memory in use. Process 3437467 has 1.19 GiB memory in use. Process 3437453 has 322.00 MiB memory in use. Including non-PyTorch memory, this process has 9.53 GiB memory in use. Of the allocated memory 9.26 GiB is allocated by PyTorch, and 105.40 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables)]

API Privacybelied Terms of Service Kontakt mei ús opnimme BlueSky Folgje ús op BlueSky

2026 Tikt LLC | Makke troch nadermx