Downloads and jobs

Download the video or audio of a post from YouTube, TikTok, Instagram, Facebook, X, Reddit, Vimeo and over 1,000 other sites. Downloads run as background jobs: start one, poll it for free, and fetch the file when it is ready.

Start a download

POST /v1/downloads returns 202 right away with a jobId.

NameTypeDescription
urlrequiredstringThe post or video page URL, or a direct media URL.
quality240p | 360p | 480p | 720p | 1080p | 1440p | 2160pHighest quality to fetch. It is measured on the shorter side, so 1080p means 1080 by 1920 for a vertical video.Default: 720p
formatmp4 | webm | avi | m4a | mp3 | ogg | wav | opus | flacVideo container or audio format. Audio formats extract the soundtrack only.Default: mp4
maxDurationintegerIn seconds. Longer videos are rejected before anything is downloaded or charged.
saveToLibrarybooleanAlso add the file to the media library so you can post it. The ready job then includes the library item in result.media.Default: false
curl -X POST "https://postkea.com/api/v1/downloads" \
  -H "Authorization: Bearer $POSTKEA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "url": "https://www.tiktok.com/@studiolumen/video/7301234567890",
  "quality": "1080p",
  "format": "mp4"
}'
Response, 202
{
  "success": true,
  "data": {
    "jobId": "job_Qm3x8d1vT0aZ",
    "type": "download",
    "status": "queued",
    "progress": 0,
    "statusUrl": "/v1/jobs/job_Qm3x8d1vT0aZ"
  }
}

Poll for the result

GET /v1/downloads/{id} (or GET /v1/jobs/{id}) is free. Poll every few seconds until status is ready or failed; progress goes from 0 to 100 while it runs. Or skip polling and subscribe to the job.completed and job.failed webhook events.

curl https://postkea.com/api/v1/downloads/job_Qm3x8d1vT0aZ \
  -H "Authorization: Bearer $POSTKEA_API_KEY"
A ready download
{
  "success": true,
  "data": {
    "jobId": "job_Qm3x8d1vT0aZ",
    "type": "download",
    "platform": "tiktok",
    "status": "ready",
    "progress": 100,
    "creditsCost": 3,
    "billed": true,
    "error": null,
    "errorCode": null,
    "retryable": false,
    "createdAt": "2026-10-20T09:14:02.000Z",
    "finishedAt": "2026-10-20T09:14:19.000Z",
    "statusUrl": "/v1/jobs/job_Qm3x8d1vT0aZ",
    "result": {
      "title": "How we fire a kiln",
      "thumbnail": "https://p16-sign.tiktokcdn.com/...",
      "durationSec": 32,
      "platform": "TikTok",
      "author": "Studio Lumen",
      "authorHandle": "studiolumen",
      "quality": "1080p",
      "format": "mp4",
      "fileSize": 14680064,
      "fileSizeMB": "14.00 MB",
      "filename": "How we fire a kiln.mp4",
      "media": null,
      "downloadUrl": "https://postkea.com/files/downloads/...?expires=...",
      "expiresIn": 3600
    }
  }
}
  • downloadUrl is a signed link that works for one hour (expiresIn seconds). Polling again returns a fresh link at no cost.
  • The file itself is kept for 24 hours. After that downloadUrl is null and expired is true. Files saved to the library stay there.
  • GET /v1/downloads lists recent downloads, optionally filtered by status.

Quality and formats

  • If the source has no version at the quality you asked for, the best one below it is used, and result.quality tells you what you got.
  • mp4 and webm are merged video and audio. avi is re-encoded, which takes longer.
  • m4a, mp3, ogg, wav, opus and flac extract the audio.
  • Files can be up to 2 GB. Live streams can be downloaded after they end.

Costs

Downloads are charged per started minute of the video: 1 credit for audio or video up to 480p, 3 credits for 720p and above. The balance is checked before the download starts, and failed downloads are free.

Video lengthAudio or up to 480p720p and above
30 seconds13
1 minute13
5 minutes515
30 minutes3090
Use maxDuration when you take URLs from users, so a three hour video does not eat your credits.

Jobs

Downloads, batch scrapes, pipelines and repurposing all run as jobs with the same shape: jobId, type, status, progress, result, creditsCost, error, errorCode, retryable and timestamps.

ValueWhat it means
queuedWaiting for a worker.
processingRunning. Watch progress.
readyDone. The result is in result.
failedStopped with an error. Nothing was charged for the failed part.

Batch and pipeline jobs also list their children, one per URL, each with its own status, result and cost. List jobs with GET /v1/jobs, filtered by type (scrape, download, batch, pipeline, repurpose, export) and status.

curl "https://postkea.com/api/v1/jobs?type=download&status=failed&limit=20" \
  -H "Authorization: Bearer $POSTKEA_API_KEY"

Job errors

A failed job has a human readable error, a stable errorCode and retryable. When retryable is true, starting the same job again later may work.

CodeWhat it means
invalid_inputThe URL is not supported or the input is wrong.
content_unavailableThe content is private, deleted, age restricted, region locked or needs a login.
unsupportedThis kind of link cannot be downloaded.
media_not_readyThe video is live or not published yet. Try after it ends.
duration_limit_exceededThe video is longer than maxDuration. Nothing was charged.
file_too_largeThe file is over 2 GB.
rate_limitedThe site is limiting requests. Retry later.
not_configuredThe download engine is not available on this server.
insufficient_creditsThe workspace does not have enough credits for this video's length.
operation_failedSomething else went wrong. Usually retryable.