Skip to main content
API Reference

API Endpoints

Complete reference for all available API endpoints.

POST/api/playground

Public API for downloading videos. No authentication required. Rate limited to 5 requests per 2 minutes.

๐ŸŒ Test in Browser:

https://xtfetch-api-production.up.railway.app/api/playground?url=https://www.facebook.com/share/p/1G8yBgJaPa/

Request

MethodParamDescription
GET?url=...URL as query parameter
POST{"url": "..."}URL in JSON body

Example (POST)

javascript
const response = await fetch('https://xtfetch-api-production.up.railway.app/api/v1/playground', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ 
    url: 'https://www.facebook.com/share/p/1G8yBgJaPa/'
  })
});

const { success, data, rateLimit } = await response.json();

if (success) {
  console.log('Remaining requests:', rateLimit.remaining);
  console.log('Download URLs:', data.formats);
}

Response

json
{
  "success": true,
  "platform": "facebook",
  "data": {
    "title": "Video title",
    "author": "Author name",
    "thumbnail": "https://...",
    "formats": [
      { "url": "https://...", "quality": "HD", "type": "video" },
      { "url": "https://...", "quality": "SD", "type": "video" }
    ],
    "responseTime": 1234
  },
  "rateLimit": { "remaining": 4, "limit": 5 }
}
POST/api/v1Auth required

Main download endpoint with higher rate limits. Requires API key in header.

Headers

HeaderRequiredDescription
X-API-KeyYesYour API key (format: xtf_sk_xxxxx)
Content-TypeYesapplication/json

Request Body

FieldTypeRequiredDescription
urlstringYesSocial media URL
cookiestringNoPlatform cookie for private content
skipCachebooleanNoSkip cached results

Example

javascript
const response = await fetch('https://xtfetch-api-production.up.railway.app/api/v1', {
  method: 'POST',
  headers: { 
    'Content-Type': 'application/json',
    'X-API-Key': 'demo_caf079daf479ceb1'
  },
  body: JSON.stringify({ 
    url: 'https://www.facebook.com/share/p/1G8yBgJaPa/'
  })
});

const { success, data } = await response.json();

if (success) {
  console.log('Download URLs:', data.formats);
}

๐Ÿงช Demo Key: Use demo_caf079daf479ceb1 for testing (limited to 3 requests/minute).

Response

json
{
  "success": true,
  "platform": "facebook",
  "data": {
    "title": "Video title",
    "author": "Author name", 
    "thumbnail": "https://...",
    "formats": [
      { "url": "https://...", "quality": "HD", "type": "video" },
      { "url": "https://...", "quality": "SD", "type": "video" }
    ],
    "responseTime": 856
  }
}

๐Ÿ’ก Get Your Own Key: Create an account and generate your API key from Settings โ†’ API Keys for higher limits.

GET/api/v1/status

Get current service status and platform availability.

json
{
  "success": true,
  "maintenance": false,
  "platforms": {
    "facebook": { "enabled": true, "status": "active" },
    "instagram": { "enabled": true, "status": "active" },
    "twitter": { "enabled": true, "status": "active" },
    "tiktok": { "enabled": true, "status": "active" },
    "weibo": { "enabled": true, "status": "active" }
  }
}
GET/api/v1/proxy

Proxy media URLs to bypass CORS restrictions.

Query Parameters

ParamTypeDescription
urlstringURL-encoded media URL
inline1 | 0Display inline (1) or download (0)

โš ๏ธ Note: Proxy only works with whitelisted CDN domains for security.

POST/api/v1/chat

Chat with AI models. Supports Gemini (with image & web search) and external models (GPT-5, Copilot Smart).

Available Models

ModelFeaturesSession
gemini-2.5-flashImage, Web Searchโœ“
gemini-flash-latestImage, Web Searchโœ“
gpt5Text onlyโœ—
copilot-smartText onlyโœ—

Request Body

FieldTypeDescription
messagestringChat message (max 4000 chars)
modelstringModel name (see table above)
sessionKeystring?Session key (Gemini only)
imageobject?{mimeType, data} base64
webSearchboolean?Enable web search

Example

javascript
const response = await fetch('https://xtfetch-api-production.up.railway.app/api/v1/chat', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ 
    message: 'Explain React hooks',
    model: 'gemini-2.5-flash',
    webSearch: false
  })
});

const { success, text, sessionKey, rateLimit } = await response.json();
console.log(text); // AI response

Response

json
{
  "success": true,
  "text": "React hooks are functions that...",
  "model": "gemini-2.5-flash",
  "sessionKey": "abc123...",
  "tokensUsed": 150,
  "rateLimit": { "remaining": 59, "limit": 60 }
}

โš ๏ธ Note: GPT-5 dan Copilot Smart tidak mendukung session. Setiap request adalah chat baru.