Getting Started

Welcome to the MediaDown API documentation. This API allows you to download media from various platforms without watermarks.

ℹ️
Base URL: https://zidanmutaqin.dev:9833
WebSocket: wss://zidanmutaqin.dev:9833

Supported Platforms

TikTok Instagram YouTube Facebook Twitter/X Spotify SoundCloud

Authentication

Currently, the API is open and does not require authentication. Rate limits apply per IP address.

REST Endpoints

GET /api/health

Check API health status

Response

{
  "status": "ok",
  "timestamp": "2025-01-23T10:30:00Z",
  "uptime": 86400
}
GET /api/supported-platforms

Get list of supported platforms

Response

{
  "platforms": [
    "TikTok",
    "Instagram", 
    "YouTube",
    "Facebook",
    "Twitter",
    "Spotify",
    "SoundCloud"
  ]
}

WebSocket Events

The API uses Socket.IO for real-time communication during downloads.

Connection

const socket = io('wss://zidanmutaqin.dev:9833', {
  transports: ['websocket', 'polling'],
  secure: true
});

Client Events (Emit)

download:start

Initiate a download request

socket.emit('download:start', {
  url: 'https://www.tiktok.com/@user/video/123',
  platform: 'TikTok',  // optional
  quality: 'auto'       // optional: 'auto', 'hd', 'sd'
});

Server Events (Listen)

download:status

Receive progress updates

socket.on('download:status', (data) => {
  console.log(data);
  // { status: 'processing', message: 'Analyzing video...' }
});

download:complete

Download completed successfully

socket.on('download:complete', (data) => {
  console.log(data);
  /* {
    status: 'success',
    platform: 'TikTok',
    data: {
      title: 'Video Title',
      author: 'username',
      thumbnail: 'https://...',
      downloads: [
        { quality: 'HD', url: 'https://...', size: '15.2 MB' },
        { quality: 'SD', url: 'https://...', size: '8.5 MB' }
      ]
    }
  } */
});

download:error

Download failed with error

socket.on('download:error', (data) => {
  console.error(data);
  // { message: 'Invalid URL', error: 'URL_INVALID' }
});

Code Examples

JavaScript Example

// Initialize Socket.IO
const socket = io('https://zidanmutaqin.dev:9833', {
  transports: ['websocket', 'polling'],
  secure: true
});

// Start download
function downloadVideo(url) {
  socket.emit('download:start', { url });
  
  socket.on('download:status', (data) => {
    console.log('Status:', data.message);
  });
  
  socket.on('download:complete', (data) => {
    console.log('Download ready!', data);
    // Display download options
    data.data.downloads.forEach(item => {
      console.log(`${item.quality}: ${item.url}`);
    });
  });
  
  socket.on('download:error', (error) => {
    console.error('Error:', error.message);
  });
}

// Usage
downloadVideo('https://www.tiktok.com/@user/video/123');

Python Example

import socketio

# Create Socket.IO client
sio = socketio.Client()

@sio.on('download:status')
def on_status(data):
    print(f"Status: {data['message']}")

@sio.on('download:complete')
def on_complete(data):
    print("Download ready!")
    for item in data['data']['downloads']:
        print(f"{item['quality']}: {item['url']}")

@sio.on('download:error')
def on_error(data):
    print(f"Error: {data['message']}")

# Connect and download
sio.connect('https://zidanmutaqin.dev:9833')
sio.emit('download:start', {
    'url': 'https://www.tiktok.com/@user/video/123'
})
sio.wait()

cURL Example

# Health check
curl https://zidanmutaqin.dev:9833/api/health

# Get supported platforms
curl https://zidanmutaqin.dev:9833/api/supported-platforms

Rate Limits

⚠️
Current Limits:
  • 100 requests per hour per IP
  • 10 concurrent connections per IP

Error Codes

Error Code Description
URL_INVALID The provided URL is invalid or malformed
PLATFORM_UNSUPPORTED The platform is not supported
VIDEO_UNAVAILABLE Video is private or no longer available
RATE_LIMIT_EXCEEDED Too many requests, please try again later
SERVER_ERROR Internal server error occurred

Live API Tester

Test the API directly from your browser

Response
Response will appear here...
Event Log