# PineDrama Drama Details & Episodes Scraper (`spider_studio/pinedrama-drama-details-scraper`) Actor

Extract PineDrama short-drama metadata, episode lists, creator IDs, and first-episode IDs in bulk.

- **URL**: https://apify.com/spider\_studio/pinedrama-drama-details-scraper.md
- **Developed by:** [NewLai](https://apify.com/spider_studio) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 50.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 successful collection ids

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## 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

### What does PineDrama Drama Detail do?

**PineDrama Drama Detail** exposes the PineDrama Spider business operation `GET /api/v1/dramas/{collection_id}` as an independently deployable Apify Actor. It calls PineDrama directly and does not require a running Spider API server. The normalized response fields match the local Spider implementation, with `success` and `error` added to every dataset record.

### Why use this PineDrama Actor?

Use this operation to build a short-drama catalog, inspect episode metadata, or connect the relevant results to your own data pipeline. Apify provides API access, scheduling, integrations, proxy configuration and run monitoring. Batch processing preserves input order, removes exact duplicate requests and limits concurrency. Failed requests produce individual error records, so a single unavailable item does not discard successful results from the same run.

### Explore more PineDrama Actors

| Actor | Use it for |
| --- | --- |
| [PineDrama Search Scraper](https://apify.com/spider_studio/pinedrama-drama-search) | Find short dramas and collection IDs by keyword. |
| [PineDrama Episodes Scraper](https://apify.com/spider_studio/pinedrama-drama-episodes) | Extract complete episode lists and video IDs. |
| [PineDrama Video URL Scraper](https://apify.com/spider_studio/pinedrama-episode-playback) | Resolve playable URLs and playback metadata for episodes. |
| [PineDrama Recommendations Scraper](https://apify.com/spider_studio/pinedrama-drama-recommendations) | Find similar short dramas for collection IDs. |

### How to run

1. Configure the environment using `.env.example` or the existing Apify secrets.
2. Supply one request using the example below, or provide a batch through `collection_ids`.
3. Run `apify run --input-file examples/input.json` locally, or run the deployed Actor from the Apify Console.
4. Inspect the default dataset and the final run status message.

Local execution requires Python 3.11 or later and dependencies from `requirements.txt`. Each Actor directory includes its own runtime and Dockerfile; it can be deployed with `apify push` from this directory.

### Input

See the Input tab for all fields. Use either the single-request fields or the batch field, never both. IDs must be decimal strings with 1–20 digits to preserve 64-bit precision. Batches accept up to 1,000 entries. A search keyword must contain 1–100 nonblank characters. Search accepts `max_pages` (default 1, range 1–1000); each upstream page requests a fixed 20 results. Each keyword starts at cursor 0 and automatically follows the returned cursor until the page limit, no more results, or an empty page after retries. The `cursor` and `count` inputs are no longer accepted.

```json
{
  "collection_id": "7675963864189735957"
}
```

The example IDs illustrate the input format and are not a guarantee that the corresponding drama remains available. Obtain current IDs from the search and episode-list Actors.

### Output

Every unique input produces one result row. Search merges pages into `items`, deduplicates by `collection_id` in first-seen order, and returns `pages_fetched` plus the final upstream `cursor` and `has_more`. A later-page failure or unusable continuation cursor marks the keyword failed while preserving collected items. Page retries do not count toward `max_pages`. Success rows contain the Spider response fields plus `"success": true` and `"error": null`. Failure rows contain the request fields, `"success": false` and a sanitized error message. You can download the dataset in various formats such as JSON, HTML, CSV, or Excel. Nested episode, recommendation and playback arrays are best preserved in JSON.

| Field | Type | Meaning |
| --- | --- | --- |
| success | boolean | Whether this operation succeeded |
| error | string or null | Failure description |
| collection\_id / video\_id | string | Precision-safe identifiers where applicable |
| items / episodes / variants | array | Operation-specific nested results where applicable |

Example failure record:

```json
{
  "collection_id": "7675963864189735957",
  "success": false,
  "error": "PineDrama upstream request failed"
}
```

### Cost

This implementation does not configure paid events or call charging APIs. Platform runtime and proxy usage depend on the account plan and deployment settings. Smaller batches and fewer retries reduce resource usage; no fixed per-result price is promised.

### Advanced configuration

Proxy and Upstash connection settings match the TikTok Actor: the same `@upstashRedisRestUrl` and `@upstashRedisRestToken` secrets, default residential Apify Proxy, custom HTTP(S) proxy precedence, country/group options, 5-second device cooldown, and bounded retries. The device pool is isolated with `PINEDRAMA_DEVICE_POOL_KEY=pinedrama:device`; `TIKTOK_DEVICE_POOL_KEY` is intentionally ignored. Other runtime switches retain their `TIKTOK_` names for configuration compatibility. Upstash requests go directly to Redis REST and never through the scraping proxy.

The search and specified-episode playback Actors lease devices. Search leases a PineDrama identity for each page and sends only `device_id` and `iid`; anonymous search can incorrectly report `has_more=false` even when later pages exist. Populate `pinedrama:device` using the Spider registration script with `--key pinedrama:device`. The Actor does not register or remove devices. Empty search pages have separate bounded retries and remain successful empty results if still empty. Set `TIKTOK_FAIL_ON_ERROR=true` to mark a run failed after writing its available results.

### FAQ and support

If search or playback reports that the pool is empty or cooling down, check PineDrama device registration and the pool key. If requests fail, inspect proxy availability and upstream access. CDN playback URLs expire; request fresh URLs before playback. This Actor resolves metadata and URLs and does not download video files. Use the data only where you have the necessary rights. Report reproducible issues with the input and sanitized run logs through the deployed Actor's Issues tab; use its API tab for programmatic execution.

# Actor input Schema

## `collection_id` (type: `string`):

Use single-request fields OR batch fields, not both. IDs must be strings. Search automatically fetches up to max\_pages pages per keyword.

## `collection_ids` (type: `array`):

Use single-request fields OR batch fields, not both. IDs must be strings. Search automatically fetches up to max\_pages pages per keyword.

## Actor input object example

```json
{}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("spider_studio/pinedrama-drama-details-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("spider_studio/pinedrama-drama-details-scraper").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 '{}' |
apify call spider_studio/pinedrama-drama-details-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,spider_studio/pinedrama-drama-details-scraper"
        }
    }
}

```

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/60k87oEMhZ6vGSLXI/builds/A0uODA2t4my2gdlTo/openapi.json
