API Endpoints
Complete reference for all available API endpoints.
/api/playgroundPublic 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
| Method | Param | Description |
|---|---|---|
| GET | ?url=... | URL as query parameter |
| POST | {"url": "..."} | URL in JSON body |
Example (POST)
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
{
"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 }
}/api/v1Auth requiredMain download endpoint with higher rate limits. Requires API key in header.
Headers
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your API key (format: xtf_sk_xxxxx) |
| Content-Type | Yes | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | Social media URL |
| cookie | string | No | Platform cookie for private content |
| skipCache | boolean | No | Skip cached results |
Example
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
{
"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.
/api/v1/statusGet current service status and platform availability.
{
"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" }
}
}/api/v1/proxyProxy media URLs to bypass CORS restrictions.
Query Parameters
| Param | Type | Description |
|---|---|---|
| url | string | URL-encoded media URL |
| inline | 1 | 0 | Display inline (1) or download (0) |
โ ๏ธ Note: Proxy only works with whitelisted CDN domains for security.
/api/v1/chatChat with AI models. Supports Gemini (with image & web search) and external models (GPT-5, Copilot Smart).
Available Models
| Model | Features | Session |
|---|---|---|
| gemini-2.5-flash | Image, Web Search | โ |
| gemini-flash-latest | Image, Web Search | โ |
| gpt5 | Text only | โ |
| copilot-smart | Text only | โ |
Request Body
| Field | Type | Description |
|---|---|---|
| message | string | Chat message (max 4000 chars) |
| model | string | Model name (see table above) |
| sessionKey | string? | Session key (Gemini only) |
| image | object? | {mimeType, data} base64 |
| webSearch | boolean? | Enable web search |
Example
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 responseResponse
{
"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.