API documentation
v1Export drama data, prepare episode files and build reports through the same operations as the ShortDramaKit tools.
- Choose your inputs
- Read capabilities without a key, then choose a supported title link or discovery source. Supporting reads do not run a tool.
- Work with your account
- Every new tool run requires a signed-in session or a scoped API key and uses the shared credit balance. The dashboard holds your tasks, files, keys and usage.
This reference describes the implemented API. Check GET /api/v1/capabilities on your base URL before choosing a runtime-dependent operation.
Your first export
Create an account, copy an API key with live:write and jobs:read, then follow these three steps. New accounts receive 10 credits once; the export uses credits.
Replace the example with your original title link. Keep data.id from the created task.
BASE_URL="<your preview origin>"
# Set SHORTDRAMAKIT_API_KEY securely in your environment.
curl --fail -X POST "$BASE_URL/api/v1/live/jobs" \
-H "Authorization: Bearer $SHORTDRAMAKIT_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: replace-with-a-unique-request-key' \
-d '{
"inputs": [
"https://netshort.com/episode/the-mafia-bosses-max-level-nanny-2108386528632586241-ep-2"
],
"format": "csv",
"fields": [
"platform",
"platformId",
"title",
"metadataLocale",
"reportedEpisodeCount",
"sourceUrl",
"observedAt"
]
}'Advance this same task while data.canAdvance is true and its status is queued or running. Stop on completion, cancellation or needs_attention. A read-only status check uses GET /api/v1/live/jobs/:id.
BASE_URL="<your preview origin>"
# Set SHORTDRAMAKIT_API_KEY securely in your environment.
JOB_ID="replace-with-data.id"
curl --fail -X POST "$BASE_URL/api/v1/live/jobs/$JOB_ID/advance" \
-H "Authorization: Bearer $SHORTDRAMAKIT_API_KEY"Copy data.downloadPath including its revision into DOWNLOAD_PATH. Download once data.resultCount is greater than zero.
BASE_URL="<your preview origin>"
# Set SHORTDRAMAKIT_API_KEY securely in your environment.
DOWNLOAD_PATH="replace-with-data.downloadPath"
curl --fail --remote-name --remote-header-name \
-H "Authorization: Bearer $SHORTDRAMAKIT_API_KEY" \
"$BASE_URL$DOWNLOAD_PATH"After this page loads, the examples use this preview’s origin. For another environment, set BASE_URL to its actual address. This example fetches current title data. Advance requests can require several passes; they reuse the same task and reservation.
This one-title example reserves up to 0.7 credits. Advancing the same task and downloading its saved result do not add another task charge. View pricing.
Reuse the Idempotency-Key with the same payload. Changing inputs, fields or format requires a new key; a conflicting payload returns 409.
Authentication and scopes
Create a key in the dashboard, copy its secret once and keep it in server-side secret storage. Send a bearer key only to endpoints that accept its scope.
BASE_URL="<your preview origin>"
# Set SHORTDRAMAKIT_API_KEY securely in your environment.
curl "$BASE_URL/api/v1/live/jobs" \
-H "Authorization: Bearer $SHORTDRAMAKIT_API_KEY"jobs:read- Read owned tasks, files and manifests. Does not run tools or start acquisition.
jobs:write- Prepare episode tables from completed metadata exports; this scope does not grant source acquisition or media writes.
live:write- Create and control current metadata, candidate-discovery and platform-download tasks. Source execution still requires an enabled runtime and its configured allowance.
media:write- Delete owned delivered video files. It does not grant source acquisition.
- Key limits
- Up to 5 active keys. Each key permits 600 requests per UTC minute, with no daily request cap. Usage is recorded even if an admitted operation later fails.
Use both the relevant write scope and jobs:read for a script that creates a task and downloads its result. A key’s permissions apply only to its owner’s resources.
Public capability and pricing reads do not authenticate API keys. Omit Authorization; if supplied, it is ignored and does not consume the key’s request allowance. Account settings, key management and billing require browser sign-in. Session mutations must be same-origin. Do not combine a session cookie with a bearer key.
Choose an operation
Open the outcome you need for its routes, input contract and access rules. Each listed key scope is an alternative to a signed-in owner session unless the route is marked public.
Export current title and episode dataSupported title links → a durable task and versioned files
Current reads require an enabled source runtime. Episode tables use source results from a completed task; they do not start a new acquisition.
/api/v1/live/jobsSession or live:write
Send inputs, fields and format (csv/json), with Idempotency-Key. Returns an owned task.
/api/v1/live/jobs/api/v1/live/jobs/:idSession or jobs:read
List recent owned tasks or read one task, including status, items, progress, canAdvance, canResume and downloadPath. Reading does not advance work.
/api/v1/live/jobs/:id/advance/api/v1/live/jobs/:id/cancelSession or live:write
Advance one persisted step or cancel unfinished work, with no request body. Cancelled paid exports cannot resume; start a new task with a new Idempotency-Key. Follow the returned action flags.
/api/v1/live/jobs/:id/download?revision=NSession or jobs:read
Download the immutable revision in the returned downloadPath. Keep this full path to retrieve the same bytes later.
/api/v1/live/jobs/:id/episodesSession or jobs:write · Idempotency-Key
Prepare or continue an episode table from completed source results. No body or Content-Type header is required. A non-empty body is rejected. Reuse the same Idempotency-Key for continuation; one table uses credits once. Inspect canContinue and per-input coverage; reported counts do not create episode rows.
/api/v1/live/jobs/:id/episodes/api/v1/live/jobs/:id/episodes?format=csv/api/v1/live/jobs/:id/episodes?format=jsonSession or jobs:read
Read the stored table envelope, or request a CSV/JSON attachment after preparation finishes. Missing fields and coverage remain explicit.
Find drama candidatesA supported keyword or category source → bounded title candidates
Discovery is a supporting step of drama-list collection. NetShort and DramaBox use category sources; ReelShort uses a bounded keyword source. Each mode requires an enabled runtime. A returned candidate is not enriched metadata or proof of full-catalog coverage.
/api/v1/discovery/jobsSession or live:write
Send platform, limit (1–20) and exactly one of keyword or category, with Idempotency-Key. Keyword accepts ReelShort only: {platform: 'reelshort', keyword: 'mafia', limit: 3}. Category accepts NetShort or DramaBox. NetShort categories: Modern Romance, Feel-Good, Revenge, Sweet Romance, Werewolf. DramaBox: Romance, Revenge, Billionaire, CEO, Strong Female Lead, Werewolf. Discovery and metadata enrichment have separate upfront quotes.
/api/v1/discovery/jobs/api/v1/discovery/jobs/:idSession or jobs:read
Read existing batches or a batch’s candidates, coverage, expiresAt and canAdvance. Each candidate includes its original sourceUrl; collection containers and entries without a valid title identity are omitted and can produce partial coverage. Reading makes no source request.
/api/v1/discovery/jobs/:id/advance/api/v1/discovery/jobs/:id/cancelSession or live:write
Advance one step or cancel the batch, with no request body. Select returned sourceUrl values as inputs to a metadata export. Batches expire after one hour.
Download selected available episodesA supported title, episode link or PineDrama series ID → private episode ZIP
Bounded NetShort, ReelShort and DramaBox delivery requires enabled source and media runtimes. Locked, unknown and unsupported episodes are excluded. Availability is separate from the catalog’s reported episode count.
/api/v1/downloadsSession or live:write
Send {sourceUrl} and Idempotency-Key for an original link. PineDrama accepts {platform: "pinedrama", titleId: "native-series-id", episodeNumber: 1}; its task returns sourceUrl=null and sourceTitleId, without an invented page URL. TikTok supports original /shortdrama/episode/<series>/<number> links and retains preview scope. Supported public episode/share links create mode=episode, reserve one episode_download and advance directly to one file without a check fee or selection. Title links create mode=title and reserve the episode_check price for one owned availability report before acquisition. A verified report is charged even if zero episodes are selectable; a source failure with no report releases the reservation. Reusing the same key recovers the same task.
/api/v1/downloads/api/v1/downloads/:idSession or jobs:read
Read tasks or one task’s stage, episode availability, expiry and mediaJob. Reading does not acquire or transfer episodes.
/api/v1/downloads/:id/advance/api/v1/downloads/:id/cancelSession or live:write
Advance one bounded acquisition or delivery step, or cancel further work.
/api/v1/downloads/:id/quoteSession or jobs:read
Send {requestedUnits: N} for the number of available episodes you intend to select. Returns {data: {operation, platform, downloadTaskId, maximumCredits, ...}, requestId}. Platform and source retrieval cost come from your owned, unexpired task; no source call, reservation or charge occurs. Do not send platform or source IDs. Availability checks cost at most 1.3 credits for NetShort and 0.7 for ReelShort or DramaBox under current rates.
/api/v1/downloads/:id/deliverSession or live:write
For mode=title only, send episodeNumbers after checking availability. mode=episode starts at creation; read/advance the same task instead. Reserve the separate episode_download price for the selected count, then settle only delivered episodes. The selected episode set becomes immutable. Request /api/v1/downloads/:id/quote first. GET /api/v1/pricing publishes NetShort reference rates, task minimum and rounding; other platform delivery prices depend on the owned availability report. The dashboard shows both quotes before submission.
/api/v1/downloads/:id/manifestSession or jobs:read
Download the provenance and coverage report. Retrieve the completed ZIP through /api/v1/media/files/:id using mediaJob.file.id.
Download episode result filesA completed episode delivery → its private ZIP
Use the mediaJob.file.id returned by the download task. Files are private and expire at their displayed expiresAt.
/api/v1/media/files/:id/api/v1/media/files/:id/manifestSession or jobs:read
Download the episode ZIP or inspect its delivery manifest. File metadata includes byteLength and sha256. Reading existing files adds no new task charge.
/api/v1/media/files/:idSession or media:write
Delete an owned delivered video file. Returns {data: {deleted: true}, requestId}.
Account, keys and balanceSupporting account management for both workflows
Public capability and pricing reads need no authentication; supplied Authorization is ignored, so omit it. Account management requires a signed-in browser session; API keys cannot manage other keys or billing.
/api/v1/capabilities/api/v1/pricingPublic · omit Authorization
Read current operation availability, supported inputs, limits and prices before creating a task. Pricing includes downloadCheckQuotes for title-based platforms and downloadDirectQuotes for single public episode platforms; rates marks NetShort download references. For delivery, quote the owned task and selected count.
/api/v1/workspace/overview/api/v1/workspace/tasks/api/v1/workspace/billing/api/v1/workspace/billing/historySigned-in session
Read account overview, task history, available credits and credit changes.
/api/v1/workspace/api-keysSigned-in session
List your API keys without exposing their secrets.
/api/v1/workspace/api-keysSigned-in session
Create a key with a name and selected scopes. Copy its secret from this one response.
/api/v1/workspace/api-keys/:idSigned-in session
Revoke your key.
Follow a task to its result
Drama-list collection and episode-download workflows retain private tasks that you can return to. A task ID is an owned resource, not a public share link.
- Create once. Save the returned task ID. Task-creation endpoints for current exports, discovery and platform downloads require
Idempotency-Key. - Read status. Use the task’s
GETroute. A read does not initiate source acquisition. Inspect per-input outcomes and available action flags before continuing. - Advance the supported workflow. Current exports, candidate batches and platform downloads expose
advance. - Download the returned output. Use the exact
downloadPathor media file ID, and retain revision and expiry information. Partial results may include a usable file with missing items recorded.
Cancellation, recovery and expiry
Cancellation stops future processing; it cannot undo a source request already accepted. Cancelled paid exports are final: canResume is false and resume returns 409 billing_task_finished. Existing completed records remain downloadable. Start a new task with a new Idempotency-Key to run again.
Current exports can report needs_attention; use their message and canAdvance flag to decide whether to retry. Source tasks expose their own actions. Follow each resource’s expiresAt, sourceExpiresAt or file expiry rather than treating task retention as permanent storage.
Handle errors and retries
Read the HTTP status together with error.code, error.message and error.requestId. Preserve the request ID when reporting a failure.
| Status | What to do |
|---|---|
| 400 / 413 / 415 | Correct the payload, request size, query parameters or content type before retrying. |
| 401 | Check for a missing, invalid or revoked key, or an expired session. |
| 403 | Check the required scope, whether the endpoint accepts keys, and same-origin rules for sessions. |
| 404 / 410 | Check the resource ID, owner and expiry. Missing or expired output cannot be recovered by repeated downloads. |
| 409 | Read the code: an idempotency conflict needs the original payload or a new key; incomplete, busy or empty tasks need their stated recovery action. |
| 429 | Key rate limits include Retry-After. Wait for that interval. Resource and queue limits may instead require finishing work or waiting for expiry. |
| 5xx | Check the message and runtime availability. Retry transient failures with bounded backoff; an environment with a disabled capability needs configuration before execution can proceed. |
After a connection failure, read a known task before sending another action. Retry idempotent creation with its original key and payload. Keys of 8–128 letters, digits, underscores or hyphens work across the task-creation endpoints.
Fields and responses
Metadata exports share these selectable fields. IDs remain strings, missing values remain unknown, and language editions remain separate records.
| Field | Type | Meaning |
|---|---|---|
platform | string | Original platform: reelshort, dramabox, netshort, shortmax, goodshort or flextv. |
platformId | string | Original platform’s title ID; preserve it as a string. |
title | string | Title in the record’s metadata language. |
metadataLocale | string | Metadata language; does not establish audio or subtitle availability. |
reportedEpisodeCount | number | null | Reported episode count; does not establish playable or unlocked episodes. |
regularEpisodeCount | number | null | Known count of regular episodes, when supplied. |
trailerCount | number | null | Known trailer count, separate from regular episodes. |
cast | string[] | null | Recorded cast names, when supplied. |
sourceUrl | string | Public original-platform title URL. |
observedAt | string | Timestamp of this record’s observation. |
JSON preserves ID strings exactly. CSV prefixes numeric IDs with an apostrophe to prevent spreadsheet rounding.
Input outcomes and task status
Each current export reports successful, duplicate, unsupported, pending and failed inputs. Inspect each input and the task’s progress/action flags. A partial result remains downloadable when resultCount is positive; incomplete inputs do not become fabricated rows.
Response envelopes and files
{ "data": ..., "requestId": "..." }{ "error": { "code": "...", "message": "...", "requestId": "..." } }Media management JSON uses { "data": { "job": ... }, "requestId": "..." }, with jobs, files, artifact or deleted as appropriate. For example, deletion returns { "data": { "deleted": true }, "requestId": "..." }. Platform downloads use { download, requestId } or { downloads, requestId }. Manifests have their own document shape. CSV, JSON and ZIP downloads are attachment responses, not JSON envelopes.
Availability and preview limits
Availability belongs to the environment you call. A documented endpoint or a granted scope does not enable its source or processing runtime.
- Drama-list inputs
- Current exports accept up to 20 supported title links. Discovery returns bounded candidates; metadata enrichment is a separate priced step.
- Capability values
localmeans processing already acquired source data;livemeans source execution is enabled;unavailablemeans that operation is disabled in this environment. API processing marked local runs on the service.- Source coverage
- Current metadata supports bounded title reads. Keyword/category discovery and episode delivery have narrower platform coverage in the operation reference. None implies an exhaustive catalog or complete playable series.
- Access and cost
- Every successful new run costs at least 0.1 credit, rounded up once per task. New accounts receive 10 credits once. Website and API share one prepaid balance. Status checks and existing-result downloads add no charge; unavailable rates cannot start a task.
- Release status
- This reference includes local implementation. The public preview may expose fewer capabilities. Production availability at
api.shortdramakit.comhas not been announced.