Unified Drama API

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

MethodPathDescriptionQuery
GET/providersEvery platform with its live status (active, maintenance, coming), the plan that includes it, and whether your plan does (included). —
GET/homeFeatured feed across all providers, or one provider.
provider (optional)
page (default 1)
GET/searchSearch all providers in parallel; results are merged.
q (required, 1–100 chars)
provider (optional)
page (default 1)
GET/trendingRanked 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}/episodesEpisode list for a drama. —
GET/drama/{id}/episodes/{num}/streamPlayable sources and subtitles for one episode. URLs may expire — request them just before playback and don’t store them. —
GET/healthLive 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:

Errors

HTTPCodeMeaning
400BAD_REQUESTInvalid or missing parameter.
401UNAUTHORIZEDMissing, invalid or revoked API key.
403FORBIDDENYour plan doesn’t include this platform. Upgrade to access it.
404NOT_FOUNDUnknown endpoint, provider, drama or episode.
429RATE_LIMITEDPer-minute limit exceeded. Wait Retry-After seconds.
429QUOTA_EXCEEDEDDaily quota used up. Resets 00:00 UTC.
502UPSTREAM_ERRORA content provider returned an error.
503PROVIDER_UNAVAILABLEProvider is in maintenance or not yet available.
503PROVIDER_BUSYProvider is at capacity right now. Retry after Retry-After seconds.
504UPSTREAM_TIMEOUTA content provider did not respond in time.
500INTERNAL_ERRORUnexpected 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);