Async tasks

Create a background download task and poll for status. Best for long-running downloads or when you don't want to hold a long HTTP connection.

POST/downloader/tasks

Creates a new download task. Returns task_id and polling URLs. Credits are charged immediately.

Parameters

urlrequiredstring

Media URL to download.

modeoptionalselectauto | audio | video

Preferred download mode. 'auto' picks video for video URLs, audio for audio URLs.

qualityoptionalselectmax | 2160 | 1440 | 1080 | 720 | 480 | 360

Preferred video quality. 'max' picks the highest available.

use_cookiesoptionalboolean

Use authenticated cookies for private content (premium feature).

max_file_size_mboptionalnumber

Maximum file size in megabytes. Files larger than this will be rejected or truncated.

Code examples

curl
curl -X POST 'https://api.anysave.click/downloader/tasks' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://youtu.be/dQw4w9WgXcQ",
  "mode": "auto",
  "quality": "max",
  "use_cookies": false,
  "max_file_size_mb": 1990
}'

Response example

json
{
  "status": "ok",
  "data": {
    "task_id": "018f9b4e-...",
    "status": "queued",
    "created_at": "2025-01-15T12:00:00Z",
    "status_url": "https://api.example.com/downloader/tasks/018f9b4e-...",
    "result_url": "https://api.example.com/downloader/tasks/018f9b4e-.../result"
  }
}
GET/downloader/tasks/{task_id}

Returns the current lifecycle status of a task: queued, processing, or finished.

Parameters

task_idrequiredstring

The task ID returned by POST /downloader/tasks.

Code examples

curl
curl -X GET 'https://api.anysave.click/downloader/tasks/018f9b4e-...' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response example

json
{
  "status": "ok",
  "data": {
    "task_id": "018f9b4e-...",
    "status": "processing",
    "result_status": null,
    "created_at": "2025-01-15T12:00:00Z",
    "started_at": "2025-01-15T12:00:01Z",
    "finished_at": null,
    "expires_at": "2025-01-15T12:15:00Z",
    "poll_after_ms": 1000
  }
}
GET/downloader/tasks/{task_id}/result

Returns the download result. Returns 202 if the task is still processing. The result envelope matches the sync endpoint.

Parameters

task_idrequiredstring

The task ID returned by POST /downloader/tasks.

Code examples

curl
curl -X GET 'https://api.anysave.click/downloader/tasks/018f9b4e-.../result' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Response example

json
{
  "status": "ok",
  "data": {
    "source_url": "https://youtu.be/dQw4w9WgXcQ",
    "service": "youtube",
    "is_truncated": false,
    "status": "tunnel",
    "file": {
      "type": "video",
      "url": "https://api.example.com/media/abc123.mp4",
      "filename": "abc123.mp4",
      "file_size_bytes": 15728640
    }
  }
}