API Documentation

Everything you need to pull video downloads into your own app, WhatsApp bot, or Telegram bot.

TikTok Instagram Facebook Twitter/X 900 req/day free
Get Started
Quick Start Platforms
Endpoints
Download Stream Proxy Register
Reference
Error Codes Rate Limits
Bot Examples
WhatsApp Bot Telegram Bot
Quick Start
1

Get your API key

Register with your email on the home page. You'll get a key starting with yzb_ instantly — 900 requests/day, free.

2

Send a request

Hit /api/download.php with your key and a video URL to get metadata, then pass the original post URL to /api/stream.php to get the actual video file.

3

Use the result

The stream proxy handles all CDN authentication (TikTok 403s, Facebook blocks, etc.) using yt-dlp under the hood, returning a clean MP4 buffer you can send anywhere.

Supported Platforms

Paste any public video link from these four platforms. The API auto-detects the platform — you don't need to specify it.

TikTok

Videos, all formats

Instagram

Reels & video posts

Facebook

Videos & Reels

Twitter/X

Videos & GIFs

GETPOST /api/download.php
Fetch video metadata (title, uploader, duration, thumbnail) from any supported platform link. Returns JSON. Note: The download_url in the response is a direct CDN link that may expire quickly or get blocked by the platform. For reliable file downloads, always use /api/stream.php.
Parameters
ParameterTypeRequiredDescription
api_keystringREQUIREDYour YoungzeeBot API key, e.g. yzb_a1b2c3d4e5
urlstringREQUIREDFull URL of the video post. TikTok, Instagram, Facebook, or Twitter/X.
Example Request
cURL
# GET request
curl "https://lecay.youngzeebot.name.ng/api/download.php?api_key=yzb_YOUR_KEY&url=https://www.tiktok.com/@user/video/123456"

# POST request
curl -X POST "https://lecay.youngzeebot.name.ng/api/download.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "api_key=yzb_YOUR_KEY&url=https://www.tiktok.com/@user/video/123456"
Node.js
const axios = require('axios');

async function getVideoInfo(url) {
  const { data } = await axios.get('https://lecay.youngzeebot.name.ng/api/download.php', {
    params: { api_key: 'yzb_YOUR_KEY', url }
  });
  if (!data.ok) throw new Error(data.error);
  return data; // data.title, data.platform, data.thumbnail...
}
Python
import requests

res = requests.get("https://lecay.youngzeebot.name.ng/api/download.php",
    params={"api_key": "yzb_YOUR_KEY", "url": "https://www.tiktok.com/@user/video/123456"})
data = res.json()
if data["ok"]:
    print(data["title"], data["platform"])
PHP
$res = file_get_contents(
    "https://lecay.youngzeebot.name.ng/api/download.php?api_key=yzb_YOUR_KEY&url=" . urlencode($url)
);
$data = json_decode($res, true);
if ($data['ok']) {
    echo $data['title'];
}
Response
200 Success
{
  "ok": true,
  "platform": "tiktok",
  "title": "Amazing cooking hack #viral",
  "download_url": "https://v16-webapp.tiktok.com/...",
  "duration_seconds": 34,
  "uploader": "chef_mike",
  "requests_remaining_today": 899
}
Error Response
{
  "ok": false,
  "error": "Invalid or expired API key.",
  "error_code": "INVALID_KEY"
}
Response Fields
FieldTypeDescription
okbooleantrue if the request succeeded
platformstringtiktok, instagram, facebook, or twitter
titlestringCaption or title of the video post
download_urlstringDirect CDN URL (may expire fast or return 403 — use stream.php instead)
duration_secondsnumberVideo length in seconds (may be null)
uploaderstringUsername of the original poster (may be null)
requests_remaining_todaynumberAPI calls left today on your key
GET /api/stream.php
Downloads the video through YoungzeeBot's server using yt-dlp and returns a clean MP4 file buffer. This is the recommended way to get the actual video file — it bypasses CDN 403 blocks from TikTok, Facebook, etc. Always pass the original post URL, not the CDN link.
Parameters
ParameterTypeRequiredDescription
api_keystringREQUIREDYour YoungzeeBot API key
video_urlstringREQUIREDThe original post URL (e.g. https://www.tiktok.com/@user/video/123), NOT the CDN download_url
filenamestringOPTIONALDesired filename without extension, e.g. my_video (gets .mp4 added automatically)
Example
cURL
# Download video to a file — always pass the ORIGINAL post URL
curl -L -o "video.mp4" \
  "https://lecay.youngzeebot.name.ng/api/stream.php?api_key=yzb_YOUR_KEY&video_url=https://www.tiktok.com/@user/video/123456&filename=tiktok_video"
Important: Always pass the original social media post URL to video_url, NOT the download_url from the download endpoint. The stream proxy uses yt-dlp internally which needs the original URL to properly authenticate and bypass platform anti-bot protections (TikTok 403s, etc.).
Timeout: This endpoint takes longer than download.php because it downloads the full video server-side. Set your HTTP client timeout to at least 180 seconds (3 minutes).
POST /api/register.php
Generate a new API key. One key per email — registering again with the same email returns the existing key instead of a duplicate.
Parameters
ParameterTypeRequiredDescription
emailstringREQUIREDA valid email, used to link and track your key
Example
cURL
curl -X POST "https://lecay.youngzeebot.name.ng/api/register.php" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "email=you@example.com"
Response
200 Success
{
  "ok": true,
  "api_key": "yzb_a1b2c3...",
  "daily_limit": 900,
  "requests_remaining_today": 900
}
Error
{
  "ok": false,
  "error": "Please provide a valid email address.",
  "error_code": "INVALID_EMAIL"
}

Error Codes

Every error response includes an error_code for programmatic handling, plus a human-readable error message.

INVALID_KEY
API key is missing, malformed, or doesn't exist.
KEY_DISABLED
The key has been revoked. Generate a new one.
QUOTA_EXCEEDED
All 900 daily requests used. Resets at midnight UTC.
INVALID_URL
Not a valid link, or from an unsupported platform.
NO_VIDEO
The link doesn't contain a downloadable video.
YTDLP_FAILED
yt-dlp couldn't download the video — private, deleted, or region-locked.
INVALID_EMAIL
Email format is invalid on the register endpoint.

Rate Limits & Quota

Sized to comfortably run a live bot, not just single-page testing.

Limit TypeValueDetails
daily_quota900 requests/dayResets at midnight UTC. Each call — success or failure — counts as one request.
per_second3 requests/secBurst limit. Exceeding it returns RATE_LIMITED with a retry_after field.
concurrent5 connectionsMax simultaneous connections per key.
Running a bot with lots of users? If 900/day isn't enough for your bot's traffic, email youngzeebot@gmail.com and we'll set up a higher limit.

WhatsApp Bot Integration

Example command handler using Baileys. A user sends a link, the bot fetches metadata via download.php, then downloads the actual video file via stream.php (which uses yt-dlp to bypass 403 blocks) and sends it into the chat.

Node.js — Baileys command
const axios = require('axios');

const YZBOT_API_KEY = 'yzb_YOUR_KEY';
const YZBOT_BASE   = 'https://lecay.youngzeebot.name.ng/api';
const PLATFORM_REGEX = /(tiktok\.com|instagram\.com|facebook\.com|fb\.watch|twitter\.com|x\.com)/i;

// Drop this inside your existing command handler / message listener
async function handleVideoLink(sock, msg, text) {
  if (!PLATFORM_REGEX.test(text)) return; // not a supported link, ignore

  const jid = msg.key.remoteJid;
  await sock.sendMessage(jid, { text: '⏳ Fetching your video...' });

  try {
    // Step 1: Get video metadata (title, uploader, etc.)
    const { data } = await axios.get(`${YZBOT_BASE}/download.php`, {
      params: { api_key: YZBOT_API_KEY, url: text }
    });

    if (!data.ok) {
      return sock.sendMessage(jid, { text: `❌ ${data.error}` });
    }

    // Step 2: Download actual video file via stream.php (uses yt-dlp)
    // IMPORTANT: Pass the ORIGINAL post URL, not data.download_url
    const videoRes = await axios.get(`${YZBOT_BASE}/stream.php`, {
      params: {
        api_key: YZBOT_API_KEY,
        video_url: text, // original URL, not CDN link
        filename: (data.title || 'video').replace(/[^a-zA-Z0-9 ]/g, '').substring(0, 50)
      },
      responseType: 'arraybuffer',
      timeout: 180000 // 3 minutes — yt-dlp needs time
    });

    // Check if stream.php returned an error JSON instead of video
    const contentType = videoRes.headers['content-type'] || '';
    if (contentType.includes('application/json')) {
      const err = JSON.parse(Buffer.from(videoRes.data).toString());
      return sock.sendMessage(jid, { text: `❌ ${err.error || 'Download failed'}` });
    }

    // Step 3: Send the video into the WhatsApp chat
    await sock.sendMessage(jid, {
      video: Buffer.from(videoRes.data),
      caption: `🎬 *${data.title || 'Video'}*\nPlatform: ${data.platform}`,
      mimetype: 'video/mp4'
    });
  } catch (err) {
    console.error('YoungzeeBot fetch failed:', err.message);
    await sock.sendMessage(jid, { text: '❌ Something went wrong fetching that video. Try again.' });
  }
}

module.exports = { handleVideoLink };
Why use stream.php instead of download_url directly? WhatsApp media messages need an actual file buffer. The CDN download_url from TikTok/Facebook will return 403 Forbidden when requested from a server because it lacks browser session tokens. The stream.php endpoint uses yt-dlp server-side to handle all authentication and returns a clean MP4 buffer that always works.

Telegram Bot Integration

Example using node-telegram-bot-api. Listens for a supported link in any message, downloads the video via stream.php (to avoid 403 blocks), and replies with the video file.

Node.js — node-telegram-bot-api
const TelegramBot = require('node-telegram-bot-api');
const axios = require('axios');
const fs = require('fs');
const path = require('path');

const bot = new TelegramBot('YOUR_TELEGRAM_BOT_TOKEN', { polling: true });
const YZBOT_API_KEY = 'yzb_YOUR_KEY';
const YZBOT_BASE   = 'https://lecay.youngzeebot.name.ng/api';
const PLATFORM_REGEX = /(tiktok\.com|instagram\.com|facebook\.com|fb\.watch|twitter\.com|x\.com)/i;

bot.on('message', async (msg) => {
  const text = msg.text || '';
  if (!PLATFORM_REGEX.test(text)) return;

  const chatId = msg.chat.id;
  const statusMsg = await bot.sendMessage(chatId, '⏳ Downloading video...');

  try {
    // Step 1: Get metadata
    const { data } = await axios.get(`${YZBOT_BASE}/download.php`, {
      params: { api_key: YZBOT_API_KEY, url: text }
    });
    if (!data.ok) return bot.sendMessage(chatId, `❌ ${data.error}`);

    // Step 2: Download video via stream.php (yt-dlp proxy)
    // Save to temp file since Telegram sendVideo needs a file path or buffer
    const videoRes = await axios.get(`${YZBOT_BASE}/stream.php`, {
      params: {
        api_key: YZBOT_API_KEY,
        video_url: text, // original URL, not CDN link
        filename: 'telegram_video'
      },
      responseType: 'arraybuffer',
      timeout: 180000
    });

    // Check for errors
    const ct = videoRes.headers['content-type'] || '';
    if (ct.includes('application/json')) {
      const err = JSON.parse(Buffer.from(videoRes.data).toString());
      return bot.sendMessage(chatId, `❌ ${err.error || 'Download failed'}`);
    }

    // Step 3: Send video — Telegram accepts buffers directly
    await bot.sendVideo(chatId, Buffer.from(videoRes.data), {
      caption: `🎬 ${data.title || 'Video'} — ${data.platform}`
    });

    // Clean up the status message
    bot.deleteMessage(chatId, statusMsg.message_id).catch(() => {});
  } catch (err) {
    console.error('YoungzeeBot fetch failed:', err.message);
    bot.sendMessage(chatId, '❌ Could not fetch that video. Try again.');
  }
});
Don't pass download_url to Telegram's sendVideo: While Telegram's API technically accepts remote URLs, TikTok and Facebook CDN links return 403 when Telegram's servers try to fetch them. Always use stream.php to get a buffer first, then send the buffer.