# DramaBox API (`ezvidnet/dramabox-api`) Actor

DramaBox-only Apify Actor wrapping the Ezvid Movies API Gateway. Pull catalog, search, detail, episode lists and per-language feeds from DramaBox with a single, cursor-paginated interface. Built for streaming sites, content aggregators and SEO pipelines.

- **URL**: https://apify.com/ezvidnet/dramabox-api.md
- **Developed by:** [Ezvid.Net](https://apify.com/ezvidnet) (community)
- **Categories:** Videos, Social media, Other
- **Stats:** 10 total users, 4 monthly users, 82.4% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## DramaBox API Actor

A single-provider fork of [`ezvidnet/short-drama-api`](https://apify.com/ezvidnet/short-drama-api).
Wraps the [Ezvid Movies API Gateway](https://api.ezvid.net) and exposes **only the
DramaBox endpoints** behind a small, cursor-paginated interface.

> The upstream actor supports 15 providers. This Actor is hard-coded to DramaBox —
> simpler input schema, smaller surface area, easier to publish as a free/cheap
> public Actor.

### Endpoints

| Action        | Upstream                                       | Pagination  | Required input |
| ------------- | ---------------------------------------------- | ----------- | -------------- |
| `home`        | `GET /api/dramabox/home`                       | cursor      | —              |
| `categories`  | `GET /api/dramabox/categories`                 | cursor      | —              |
| `latest`      | `GET /api/dramabox/latest?page=N`              | page-based  | —              |
| `vip`         | `GET /api/dramabox/vip`                        | cursor      | —              |
| `search`      | `GET /api/dramabox/search?q=...`               | cursor      | `query`        |
| `detail`      | `GET /api/dramabox/detail/{id}`                | cursor      | `id`           |
| `episodes`    | `GET /api/dramabox/episodes/{id}`              | cursor      | `id`           |

All endpoints require an `X-API-Key` header.

### Output

Each upstream record is enriched with a `_meta` block:

```json
{
  "id": "abc123",
  "title": "Sample Drama",
  "poster": "https://cdn.ezvid.net/posters/abc123.jpg",
  "stream": "https://stream.ezvid.net/hls/abc123/master.m3u8",
  "_meta": {
    "provider": "dramabox",
    "action": "home",
    "page": 1,
    "url": "https://api.ezvid.net/api/dramabox/home?limit=20",
    "fetchedAt": "2026-08-21T07:40:01.123Z"
  }
}
```

A run summary is also written to the **OUTPUT** key-value store with counts
and timestamps.

### Quick examples

#### 1. Pull 50 latest home records

```json
{ "action": "home", "limit": 50, "maxPages": 1 }
```

#### 2. Search DramaBox for "revenge"

```json
{ "action": "search", "query": "revenge", "limit": 20, "maxPages": 1 }
```

#### 3. Detail for a specific drama

```json
{ "action": "detail", "id": "abc123" }
```

#### 4. Full episode list

```json
{ "action": "episodes", "id": "abc123" }
```

#### 5. Page-based latest feed (walk 5 pages)

```json
{ "action": "latest", "page": 1, "maxPages": 5 }
```

#### 6. VIP feed, Indonesian language

```json
{ "action": "vip", "language": "id", "limit": 20, "maxPages": 3 }
```

### Authentication

The Actor calls Ezvid's API with an `X-API-Key` header.

- **Bring your own key** — paste your Ezvid key into the `apiKey` input.
- **Built-in key (pay-per-result)** — leave `apiKey` blank and set
  `EZVID_API_KEY` in the Actor's **Settings → Environment variables**.
  When you publish on Apify Store, users without their own key can still run
  the Actor and the upstream cost comes out of your account.

Sign up for a key at <https://api.ezvid.net/>.

### Input

| Field      | Type    | Default | Notes                                              |
| ---------- | ------- | ------- | -------------------------------------------------- |
| `action`   | enum    | `home`  | One of: `home`, `categories`, `latest`, `vip`, `search`, `detail`, `episodes` |
| `query`    | string  | —       | Required for `search`                              |
| `id`       | string  | —       | Required for `detail`, `episodes`                  |
| `language` | string  | —       | Optional. See `/api/dramabox/langs`                |
| `category` | string  | —       | Optional category scope                            |
| `page`     | integer | `1`     | Starting page for `latest`                         |
| `limit`    | integer | `20`    | Page size, 1–100                                   |
| `maxPages` | integer | `1`     | Pages to walk, 1–50                                |
| `apiKey`   | string  | —       | Your Ezvid key (overrides built-in)                |

### Local development

Requirements: Node 20+, npm.

```bash
## Install
npm install

## Set your key
cp .env.example .env
## then edit .env and set EZVID_API_KEY

## Run with the bundled input fixture
npm start
```

The Actor reads input from `storage/key_value_store/INPUT.json` when run
locally via the [Apify CLI](https://docs.apify.com/cli):

```bash
## Optional: install the Apify CLI and run with its local runtime
npx apify run
```

### Deploying to Apify

```bash
## 1. Login (one-time)
npx apify login

## 2. Push — auto-creates the Actor on the platform using the name
##    in .actor/actor.json ("dramabox-api")
npx apify push

## 3. In the Apify Console (https://console.apify.com):
##    - Open "dramabox-api"
##    - Settings → Environment variables → add EZVID_API_KEY=<your key>
##      (skip if you want every run to bring its own key)
##    - Publication → "Publish" → fill the public listing from this README
```

> The CLI has no `apify actors create` command. `apify push` is the command
> that both creates the Actor (if it doesn't exist) and uploads the source.

### Pricing (suggestion)

On Apify Store you can set **pay-per-event** pricing so users pay only for
records they actually pull:

| Event           | Suggested price |
| --------------- | --------------- |
| Actor start     | $0.001          |
| Record returned | $0.0005 – 0.002 |

The built-in key is billed to the Actor, not to the end user.

### Limits & caveats

- Upstream API may rate-limit. The Actor retries 429 / 5xx up to 3 times with
  exponential backoff. If you still hit a limit, lower `maxPages` or run in
  smaller batches.
- The Ezvid API is not affiliated with the upstream drama providers — make
  sure your use case complies with their terms.
- The Actor returns metadata + HLS URLs only; playback is the consumer's job.

### Differences vs `ezvidnet/short-drama-api`

| Area           | Upstream                                    | This fork                              |
| -------------- | ------------------------------------------- | -------------------------------------- |
| Providers      | 15 (`dramawave`, `reelshort`, …)            | 1 (`dramabox`)                         |
| `provider` input | required enum                             | dropped                                |
| `ep` / `locale` | used by `watch`, `source` on other providers | unused (no `watch` / `source` actions) |
| Built-in key   | hard-coded master key for pay-per-result    | empty by default — bring your own      |
| Dependencies   | `apify` only                                | `apify` only                           |

### License

MIT.

# Actor input Schema

## `action` (type: `string`):

What to fetch from DramaBox. `search` requires `query`; `detail` / `episodes` require `id`; `latest` is page-based and ignores `maxPages` cursor logic.

## `query` (type: `string`):

Required when action = 'search'. Forwarded as ?q= to /api/dramabox/search.

## `id` (type: `string`):

Required when action = 'detail' or 'episodes'. Get IDs from a 'home', 'vip', 'categories' or 'search' run.

## `language` (type: `string`):

Provider-specific. See /api/dramabox/langs for the list of supported values.

## `category` (type: `string`):

Optional category scope. Forwarded as ?category= to the upstream endpoint.

## `page` (type: `integer`):

Starting page number for the page-based 'latest' endpoint. 1-based. Ignored for cursor-based actions.

## `limit` (type: `integer`):

Records per page. Upstream may cap.

## `maxPages` (type: `integer`):

How many pages to walk. 1 = single page only. Cursor-paginated actions follow the cursor until exhausted or this limit; the 'latest' action increments `page` from the input.

## `apiKey` (type: `string`):

Leave blank to use the Actor's built-in key (set via the EZVID\_API\_KEY env var). If you have your own Ezvid key, paste it here to use it for free.

## Actor input object example

```json
{
  "action": "home",
  "page": 1,
  "limit": 20,
  "maxPages": 1
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "action": "home",
    "page": 1,
    "limit": 20,
    "maxPages": 1
};

// Run the Actor and wait for it to finish
const run = await client.actor("ezvidnet/dramabox-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "action": "home",
    "page": 1,
    "limit": 20,
    "maxPages": 1,
}

# Run the Actor and wait for it to finish
run = client.actor("ezvidnet/dramabox-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "action": "home",
  "page": 1,
  "limit": 20,
  "maxPages": 1
}' |
apify call ezvidnet/dramabox-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ezvidnet/dramabox-api"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/FTABFgWkrvUSgxepW/builds/kCHONkEkYdlw8vohb/openapi.json
