v1
Unified Drama API
One API for many short-drama catalogues. Every provider returns the same shapes: providers, dramas, episodes and streams.
Authentication
Send your key in the x-api-key header on every request. Create a free account to get one. Keys are secret. Call the API from your server, never from browser code.
curl -H "x-api-key: YOUR_KEY" \ "https://dramaflix.sbs/api/v1/search?q=ceo&page=1"
Base URL: https://dramaflix.sbs/api/v1
Response format
// success
{ "success": true, "data": { ... }, "meta": { ... } }
// error
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "..." } }
Multi-provider endpoints (/home, /search, /trending) return partial results if a provider fails. Those providers are listed in meta.failed.
Endpoints
| Method | Path | Description | Query |
|---|---|---|---|
GET | /providers | Every platform with its live status (active, maintenance, coming), the plan that includes it, and whether your plan does (included). |
— |
GET | /home | Featured feed across all providers, or one provider. | provider (optional)page (default 1) |
GET | /search | Search all providers in parallel; results are merged. | q (required, 1–100 chars)provider (optional)page (default 1) |
GET | /trending | Ranked trending dramas across your platforms (or one): most-viewed first, each with a rank (1 = top). Use it for a hero banner or a Top 10 row. |
provider (optional)limit (1–50, default 10) |
GET | /drama/{id} | Drama details. id is provider:originalId as returned by other endpoints. |
— |
GET | /drama/{id}/episodes | Episode list for a drama. | — |
GET | /drama/{id}/episodes/{num}/stream | Playable sources and subtitles for one episode. URLs may expire — request them just before playback and don’t store them. | — |
GET | /health | Live per-provider availability and latency. | — |
GET | /logos/{providerId} | Provider logo image (the logo URL from /providers). No API key needed, so it works in <img>. |
— |
Data model
Provider { id, name, logo, status: "active" | "maintenance" | "coming",
plan: "free" | "basic" | "pro", included: boolean, note? }
Drama { id: "provider:originalId", provider, title, cover, description,
tags: string[], totalEpisodes, language?, views? }
Episode { number, title?, duration? /* seconds */, isFree, thumbnail? }
Stream { sources: [{ url, quality, type: "mp4" | "hls" }],
subtitles: [{ lang, url }] }
Paged<T> { items: T[], page, hasMore }
Trending { items: (Drama & { rank })[], limit }Optional fields are omitted when a provider doesn’t supply them.
Rate limits
Each key has a per-minute limit and a daily quota set by its plan. Every response includes:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset(seconds)X-Quota-Limit,X-Quota-Remaining(daily, UTC)Retry-Afteron 429 responses
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | BAD_REQUEST | Invalid or missing parameter. |
| 401 | UNAUTHORIZED | Missing, invalid or revoked API key. |
| 403 | FORBIDDEN | Your plan doesn’t include this platform. Upgrade to access it. |
| 404 | NOT_FOUND | Unknown endpoint, provider, drama or episode. |
| 429 | RATE_LIMITED | Per-minute limit exceeded. Wait Retry-After seconds. |
| 429 | QUOTA_EXCEEDED | Daily quota used up. Resets 00:00 UTC. |
| 502 | UPSTREAM_ERROR | A content provider returned an error. |
| 503 | PROVIDER_UNAVAILABLE | Provider is in maintenance or not yet available. |
| 503 | PROVIDER_BUSY | Provider is at capacity right now. Retry after Retry-After seconds. |
| 504 | UPSTREAM_TIMEOUT | A content provider did not respond in time. |
| 500 | INTERNAL_ERROR | Unexpected error. Include X-Request-Id when contacting support. |
Example (PHP)
$ch = curl_init("https://dramaflix.sbs/api/v1/home?page=1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['x-api-key: ' . getenv('DRAMA_API_KEY')],
]);
$body = json_decode(curl_exec($ch), true);
if (!$body['success']) throw new Exception($body['error']['code']);
foreach ($body['data']['items'] as $drama) echo $drama['id'], ' ', $drama['title'], PHP_EOL;Example (JavaScript)
const res = await fetch("https://dramaflix.sbs/api/v1/home?page=1", {
headers: { "x-api-key": process.env.DRAMA_API_KEY },
});
const body = await res.json();
if (!body.success) throw new Error(body.error.code);
for (const drama of body.data.items) console.log(drama.id, drama.title);