Home Instagram TikTok Twitter Stories Pinterest Telegram Explore

API Documentation – Developer Guide | Social Media Downloader

🔌 API Documentation

Integrate our social media downloader into your applications

📖 Introduction

Our API allows developers to integrate social media downloading functionality into their own applications, websites, or services. Access Instagram, TikTok, Twitter, Pinterest, and Telegram content programmatically.

🚀 Fast & Reliable

High-speed servers with 99.9% uptime

🔒 Secure

HTTPS encryption and API key authentication

📊 Scalable

Handle thousands of requests per day

💰 Free Tier

1000 requests/day for free users

⚡ Quick Start

1. Get Your API Key

Contact us at [email protected] to request your free API key. Include:

  • Your name/company name
  • Use case description
  • Expected request volume

2. Base URL

https://yoursite.com/api/v1

3. Authentication

Include your API key in the request headers:

Authorization: Bearer YOUR_API_KEY

🔗 API Endpoints

📸 Instagram Download

POST
/download/instagram

Request Body:

{
  "url": "https://www.instagram.com/p/ABC123/",
  "type": "post" // Options: post, reel, story, igtv
}

Response:

{
  "success": true,
  "data": {
    "type": "image",
    "url": "https://cdn.instagram.com/...",
    "thumbnail": "https://...",
    "caption": "Post caption here",
    "username": "example_user",
    "timestamp": "2024-10-23T10:30:00Z",
    "downloads": [
      {
        "quality": "original",
        "url": "https://download.url/file.jpg",
        "size": 1024000
      }
    ]
  }
}

🎵 TikTok Download

POST
/download/tiktok

Request Body:

{
  "url": "https://www.tiktok.com/@user/video/123456",
  "watermark": false, // true for with watermark
  "audio_only": false // true for MP3 only
}

Response:

{
  "success": true,
  "data": {
    "video_url": "https://download.url/video.mp4",
    "audio_url": "https://download.url/audio.mp3",
    "thumbnail": "https://...",
    "title": "Video title",
    "author": "username",
    "duration": 15,
    "quality": "HD",
    "size": 5242880
  }
}

🐦 Twitter/X Download

POST
/download/twitter

Request Body:

{
  "url": "https://twitter.com/user/status/123456",
  "quality": "720p" // Options: 1080p, 720p, 480p, 360p
}

📱 Instagram Story

POST
/download/story

Request Body:

{
  "username": "example_user"
  // OR
  "url": "https://instagram.com/stories/..."
}

Response (by username):

{
  "success": true,
  "data": {
    "username": "example_user",
    "stories": [
      {
        "id": "story123",
        "type": "image",
        "url": "https://download.url/story1.jpg",
        "timestamp": "2024-10-23T08:00:00Z",
        "expires_at": "2024-10-24T08:00:00Z"
      },
      {
        "id": "story124",
        "type": "video",
        "url": "https://download.url/story2.mp4",
        "thumbnail": "https://...",
        "duration": 10
      }
    ]
  }
}

⏱️ Rate Limits

Plan Requests/Day Requests/Hour Price
Free 1,000 100 $0
Basic 10,000 500 $29/month
Pro 100,000 2,000 $99/month
Enterprise Unlimited Custom Contact us

Note: Rate limit headers are included in all responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1698073200

❌ Error Codes

Code Message Description
400 Bad Request Invalid URL or missing parameters
401 Unauthorized Invalid or missing API key
403 Forbidden API key suspended or rate limit exceeded
404 Not Found Content not found or private/deleted
429 Too Many Requests Rate limit exceeded – slow down
500 Internal Server Error Something went wrong on our end

Error Response Format:

{
  "success": false,
  "error": {
    "code": 404,
    "message": "Content not found",
    "details": "The requested post may be private or deleted"
  }
}

💻 Code Examples

JavaScript (Node.js)

const axios = require('axios');

async function downloadInstagram(url) {
  try {
    const response = await axios.post(
      'https://yoursite.com/api/v1/download/instagram',
      { url: url, type: 'post' },
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    
    console.log(response.data);
    return response.data.data.downloads[0].url;
  } catch (error) {
    console.error('Error:', error.response.data);
  }
}

downloadInstagram('https://www.instagram.com/p/ABC123/');

Python

import requests

API_KEY = 'YOUR_API_KEY'
API_URL = 'https://yoursite.com/api/v1'

def download_tiktok(url, watermark=False):
    headers = {'Authorization': f'Bearer {API_KEY}'}
    data = {'url': url, 'watermark': watermark}
    
    response = requests.post(
        f'{API_URL}/download/tiktok',
        json=data,
        headers=headers
    )
    
    if response.status_code == 200:
        result = response.json()
        return result['data']['video_url']
    else:
        print(f"Error: {response.json()}")

video_url = download_tiktok('https://www.tiktok.com/@user/video/123')

PHP

<?php
 = 'YOUR_API_KEY';
 = 'https://twitter.com/user/status/123456';

 = curl_init('https://yoursite.com/api/v1/download/twitter');
curl_setopt(, CURLOPT_RETURNTRANSFER, true);
curl_setopt(, CURLOPT_POST, true);
curl_setopt(, CURLOPT_POSTFIELDS, json_encode([
    'url' => ,
    'quality' => '720p'
]));
curl_setopt(, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer ' . ,
    'Content-Type: application/json'
]);

 = curl_exec();
 = json_decode(, true);

if ($data['success']) {
    echo $data['data']['video_url'];
}
?>

✅ Best Practices

  • Cache Results: Cache downloaded URLs to avoid redundant API calls
  • Handle Errors: Always implement proper error handling
  • Respect Rate Limits: Implement exponential backoff on 429 errors
  • Validate URLs: Check URL format before sending to API
  • Use HTTPS: Always use secure connections
  • Monitor Usage: Track your API usage to avoid hitting limits

📧 API Support

Need help with the API? We’re here to assist!

  • Email: [email protected]
  • Documentation: This page (bookmark it!)
  • Status: Check API status at status.yoursite.com
  • Response Time: Usually within 24 hours

Ready to Get Started?

Request your free API key and start integrating today!