# Importly Download (`importly/importly-download`) Actor

Turn video and audio links into downloadable MP4, WebM or MP3 files: YouTube, TikTok, X, Instagram, podcasts and 1,000+ other sites. Works from servers where downloads usually get blocked. Free to try, no card required.

- **URL**: https://apify.com/importly/importly-download.md
- **Developed by:** [Importly](https://apify.com/importly) (community)
- **Categories:** Videos, Social media, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## 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/store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Importly Download

Turn video and audio links into files you can use. Paste YouTube, TikTok, X, Instagram or podcast links and get a download link to each MP4, WebM or MP3, plus its title, duration and size.

### Why use it

Downloading media from a server is where most pipelines break. Sites block requests from cloud and datacenter servers, so a script that works on your laptop fails on Apify, in CI or in production, and the fix you find this month stops working next month. Importly Download handles that for you: you send a link and get the file back, from YouTube, TikTok, X, Instagram, podcasts and 1,000+ other sites.

[Importly](https://www.importly.io) is free to try, no card required. [Get your API key](https://www.importly.io/?utm_source=apify\&utm_medium=store\&utm_campaign=apify-actors), paste it into the input, and run.

### What you can do with it

- Save videos your users link to into your own storage, a Google Drive or an S3 bucket (chain it to an Apify integration)
- Pull audio-only MP3s from YouTube or podcast links for transcription, clipping or analysis
- Archive TikTok, Instagram and X videos for a research or monitoring dataset
- Get the file and its transcript in one step with **Also get the transcript**

### Input

| Field | What it does |
| --- | --- |
| **Links** | One or more video or audio page links |
| **Importly API key** | Your key from [importly.io](https://www.importly.io/?utm_source=apify\&utm_medium=store\&utm_campaign=apify-actors). Stored as a secret |
| **What to download** | Video with audio, audio only, or video without audio |
| **Video quality** | Highest resolution, from `144p` to `2160p`, or `best`. Default `720p` |
| **Audio quality** | `low` (up to 64 kbps) to `best`. Default `medium` (up to 128 kbps) |
| **Plays everywhere (H.264 / AAC)** | Prefer files that play in Safari, iOS, QuickTime and video editors |
| **Also get the transcript** | Adds a timestamped transcript to each item |
| **Max cost per link** | Optional cap in dollars. A link that would cost more fails before anything is downloaded |
| **Timeout per link**, **Links at once** | Run settings |

Example input:

```json
{
	"urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"],
	"apiKey": "imp_live_...",
	"mediaType": "audio",
	"audioQuality": "medium"
}
```

### Output

One dataset item per link. `mediaUrl` is a direct download link that stays valid for 7 days (`mediaUrlExpiresAt`), so copy the file somewhere permanent if you need it longer.

```json
{
	"url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
	"status": "completed",
	"jobId": "a824760e-ece1-4415-8838-ce2a7785ea6b",
	"title": "Me at the zoo",
	"mediaUrl": "https://...Me%20at%20the%20zoo.mp3?X-Amz-Expires=604800&...",
	"mediaUrlExpiresAt": "2026-12-04T10:00:00.000Z",
	"filename": "Me at the zoo.mp3",
	"fileSizeBytes": 120621,
	"duration": 19,
	"audioCodec": "mp3",
	"thumbnailUrl": "https://i.ytimg.com/vi/jNQXAC9IVRw/hqdefault.jpg",
	"costInDollars": 0.01,
	"totalCostInDollars": 0.01
}
```

A link that can't be downloaded (removed, private, a live stream that hasn't ended) gets an item with `"status": "failed"`, an `errorCode` such as `VIDEO_UNAVAILABLE`, a plain-English `error` and a `documentationUrl`. The other links still run. A wrong API key or an empty balance stops the run with a message saying what to fix. Run it without a key and you get one item with `"status": "api_key_required"` and a link to get one.

### Pricing

The Actor is free. Downloads are billed to your Importly credits at $0.002 per MB (about $2 per GB, $0.01 minimum per file). Apify bills only the small platform usage of the run. See [Importly pricing](https://www.importly.io/pricing?utm_source=apify\&utm_medium=store\&utm_campaign=apify-actors).

### Building an app?

The same API key works with the [Importly REST API](https://www.importly.io/docs?utm_source=apify\&utm_medium=store\&utm_campaign=apify-actors), so your backend can import from a URL directly, with webhooks when each file is ready. The other Importly Actors: [Importly Transcript](https://apify.com/importly/importly-transcript) and [Importly Metadata](https://apify.com/importly/importly-metadata).

Source: [github.com/importly-io/importly-integrations](https://github.com/importly-io/importly-integrations/tree/main/apify). Questions: support@importly.io.

# Actor input Schema

## `urls` (type: `array`):

Video or audio page links, one per line: YouTube, TikTok, X, Instagram, podcast episodes and 1,000+ other sites. You get one dataset item per link with a download link to the file.

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

Your Importly API key (starts with imp_live\_), needed to run. No key yet? <a href="https://www.importly.io/?utm_source=apify&utm_medium=store&utm_campaign=apify-actors" target="_blank">Sign up at importly.io</a>, free to try with no card required, then copy the key from <a href="https://www.importly.io/dashboard/api-key" target="_blank">the API key page</a>. Usage is billed to your Importly credits.

## `mediaType` (type: `string`):

Video with audio (MP4/WebM), audio only, or the video track alone.

## `videoQuality` (type: `string`):

Highest resolution to download, on the shorter side of the frame. You get the best stream at or below it.

## `audioQuality` (type: `string`):

Highest audio bitrate to download.

## `compatibleCodecs` (type: `boolean`):

Prefer H.264 video and AAC audio, which play in Safari, iOS, QuickTime and editors. Files are usually larger.

## `includeTranscript` (type: `boolean`):

Add a timestamped transcript from the captions to each item. Billed like a transcript.

## `transcriptLanguage` (type: `string`):

Two-letter language code for the transcript, e.g. en or es. English when empty.

## `maxCostDollars` (type: `string`):

Optional cap in dollars for each link, e.g. 0.50. A link that would cost more fails with MAX_COST_EXCEEDED before anything is downloaded.

## `fitQualityToBalance` (type: `boolean`):

When your balance doesn't cover the chosen quality, download at the highest quality it covers instead of failing.

## `timeoutSecs` (type: `integer`):

How long to wait for each link. A job that runs longer keeps going on Importly; the item gets its jobId so you can read the result later.

## `maxConcurrency` (type: `integer`):

How many links to process in parallel.

## Actor input object example

```json
{
  "urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ],
  "mediaType": "video",
  "videoQuality": "720p",
  "audioQuality": "medium",
  "compatibleCodecs": false,
  "includeTranscript": false,
  "fitQualityToBalance": false,
  "timeoutSecs": 900,
  "maxConcurrency": 3
}
```

# Actor output Schema

## `results` (type: `string`):

One item per link, in the order they finished.

# 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 = {
    "urls": [
        "https://www.youtube.com/watch?v=jNQXAC9IVRw"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("importly/importly-download").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 = { "urls": ["https://www.youtube.com/watch?v=jNQXAC9IVRw"] }

# Run the Actor and wait for it to finish
run = client.actor("importly/importly-download").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 '{
  "urls": [
    "https://www.youtube.com/watch?v=jNQXAC9IVRw"
  ]
}' |
apify call importly/importly-download --silent --output-dataset

```

## MCP server setup

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

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/Vmbd5qR2c0BbXAsCh/builds/VdNyLlJDfM5qjAauJ/openapi.json
