# Instagram Video Downloader (`scrapers-hub/instagram-video-downloader`) Actor

Instagram Video Downloader saves Reels and video posts from public URLs at your chosen resolution, returning the original URL and download status. 🎬 Handy for content archiving, repurposing and social media research.

- **URL**: https://apify.com/scrapers-hub/instagram-video-downloader.md
- **Developed by:** [Scrapers Hub](https://apify.com/scrapers-hub) (community)
- **Categories:** Videos, Social media, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

### 📹 Instagram Video Downloader – Extract Reel & Video Download Links, Formats and Metadata

The **Instagram Video Downloader** resolves public Instagram video and Reel URLs into direct media links plus the metadata that surrounds them — title, uploader, thumbnail, duration, and the exact video and audio format details behind each stream. You supply a list of post URLs and a target resolution; the Actor returns structured rows containing separate video, audio and merged download links wherever those variants exist.

Instagram serves video through adaptive streaming, which means a single Reel is not one file but a family of renditions at different resolutions and bitrates, frequently with the audio track stored separately from the video track. This Instagram video downloader inspects that format list, picks the rendition closest to the resolution you asked for, and reports both what you requested and what it actually found — so the output is honest about quality rather than silently handing back whatever was cheapest to fetch.

The Actor is built on `yt-dlp` for extraction and runs each URL independently. If one post is private, deleted or geo-restricted, that URL alone produces a failure row while the rest of the batch continues.

***

### 📊 What Data Can You Extract with This Instagram Video Downloader?

Every dataset row corresponds to one Instagram video URL you submitted, grouped here by what the fields are for.

| Category | Fields | What it gives you |
| --- | --- | --- |
| **Source and request** | `original_url`, `requested_resolution`, `source` | The URL you submitted, the resolution you asked for, and the platform tag for the record. |
| **Post metadata** | `title`, `author`, `thumbnail`, `duration` | Post title, uploader handle, poster image URL, and video length in seconds. |
| **Classification** | `video_type` | Whether the post was treated as a `reel` (under 60 seconds) or a `long video`. |
| **Quality resolution** | `found_resolution`, `note` | The rendition actually selected, plus a plain-English note stating whether your requested quality was available. |
| **Download links** | `download_links` | An object with up to three keys: `video_without_audio`, `audio` and `merged_video`. |
| **Technical format detail** | `video_format_details`, `audio_format_details` | Codec-level specifics — format ID, extension, dimensions, bitrate, FPS, audio bitrate and sample rate. |
| **Failure diagnostics** | `error`, `status` | Populated only on failed rows, carrying the reason and a `FAILED` status marker. |

The pairing of `requested_resolution` and `found_resolution` is the field combination worth watching. Instagram does not guarantee that a 1080p rendition exists for every post, and older or heavily compressed uploads often top out lower. Because both values are recorded on every row alongside the explanatory `note`, you can audit an entire batch for quality shortfalls in one filter rather than discovering the gap after download.

***

### 🌟 Key Features of the Instagram Video Downloader

| Feature | Description |
| --- | --- |
| 🎯 **Resolution targeting** | Request 1080p, 720p, 480p or 360p and the Actor selects the closest available rendition at or above your target. |
| 🔊 **Separate audio and video streams** | `download_links` exposes `video_without_audio` and `audio` independently, which matches how Instagram actually serves adaptive media. |
| 🎬 **Merged stream when available** | When a combined audio-and-video rendition meets your requested quality, it is returned as `merged_video`. |
| 📐 **Reel-aware dimension logic** | Vertical Reels are matched on width and longer landscape videos on height, so portrait content is not mis-ranked. |
| 🧾 **Codec-level format details** | `video_format_details` and `audio_format_details` report format ID, extension, dimensions, bitrate, FPS and sample rate. |
| 🖼️ **Thumbnail and metadata capture** | Each row carries `title`, `author`, `thumbnail` and `duration` without a second lookup. |
| 🛡️ **Per-URL error isolation** | A private, deleted or restricted post writes an `error` row and the batch continues uninterrupted. |
| 🌍 **Residential proxy support** | Proxy settings are supplied through the input, so extraction can be routed through residential IPs where that improves reliability. |
| 📦 **Batch URL processing** | Submit many post URLs in one run and receive one structured row per video. |

***

### 🚀 Why Choose This Instagram Video Downloader?

**Honest quality reporting rather than silent substitution.** Most download tools give you a file and leave you to discover the resolution afterwards. This Actor records `requested_resolution`, `found_resolution` and a human-readable `note` on every row, so a batch of a hundred URLs can be audited for quality in a single pass.

**Format-level detail for real production workflows.** Video teams need to know the container, the codec, the bitrate and the frame rate before ingesting media into an editing or archive pipeline. The `video_format_details` and `audio_format_details` objects carry that information, which turns the output into something an automated ingest step can actually reason about.

**Separate streams reflect how Instagram serves video.** Because adaptive streaming stores audio and video apart, a tool that only ever returns a single merged link is hiding a constraint rather than solving it. Returning `video_without_audio`, `audio` and — where genuinely available — `merged_video` lets your pipeline decide whether to mux locally.

**Batch-safe failure handling.** Instagram content disappears, goes private, or is regionally blocked without warning. Each URL is processed independently, and a failure produces a compact row with `original_url`, `error` and `status` rather than aborting the run.

***

### 📥 Input

```json
{
  "video_urls": [
    { "url": "https://www.instagram.com/reel/ABC123XYZ/" },
    { "url": "https://www.instagram.com/p/DEF456UVW/" }
  ],
  "desired_resolution": "1080p",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

#### 🔧 Instagram Video Downloader Input Fields

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `video_urls` | array | ✅ Yes | — | List of public Instagram video, Reel or post URLs to process. Entries may be plain URL strings or objects with a `url` key. |
| `desired_resolution` | string | No | `1080p` | Target video quality. Accepted values are `1080p`, `720p`, `480p` and `360p`; any other value causes that item to fail. |
| `proxy` | object | ✅ Yes | — | Apify proxy configuration used for extraction. Residential groups are recommended for Instagram. The run fails if this is omitted. |

#### 💡 Input Examples

**Single Reel at maximum quality**

```json
{
  "video_urls": ["https://www.instagram.com/reel/ABC123XYZ/"],
  "desired_resolution": "1080p",
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

**Batch of posts at a lighter resolution**

```json
{
  "video_urls": [
    { "url": "https://www.instagram.com/reel/AAA111/" },
    { "url": "https://www.instagram.com/reel/BBB222/" },
    { "url": "https://www.instagram.com/p/CCC333/" }
  ],
  "desired_resolution": "720p",
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

**Low-bandwidth extraction for previews**

```json
{
  "video_urls": ["https://www.instagram.com/reel/DDD444/"],
  "desired_resolution": "360p",
  "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

***

### 📤 Output

A successful row looks like this:

```json
{
  "original_url": "https://www.instagram.com/reel/ABC123XYZ/",
  "requested_resolution": "1080p",
  "title": "Behind the scenes of the summer shoot",
  "author": "examplecreator",
  "thumbnail": "https://scontent.cdninstagram.com/v/t51.../thumbnail.jpg",
  "duration": 27,
  "video_type": "reel",
  "source": "instagram",
  "found_resolution": "1080p",
  "note": "Congrats, your requested resolution was found.",
  "download_links": {
    "video_without_audio": "https://scontent.cdninstagram.com/v/...",
    "audio": "https://scontent.cdninstagram.com/v/...",
    "merged_video": "https://scontent.cdninstagram.com/v/..."
  },
  "video_format_details": {
    "formatId": "dash-video",
    "Extension": "mp4",
    "Width": 1080,
    "Height": 1920,
    "Bitrate": 2450.5,
    "FPS": 30,
    "Quality": "1080p"
  },
  "audio_format_details": {
    "formatId": "dash-audio",
    "Extension": "m4a",
    "AudioQuality": 128,
    "AudioSampleRate": 44100
  }
}
```

#### 🧾 Instagram Video Output Fields (Successful Rows)

| Field | Type | Description |
| --- | --- | --- |
| `original_url` | string | null | The Instagram URL that was submitted for this item. |
| `requested_resolution` | string | The resolution you asked for, echoed back as e.g. `1080p`. |
| `title` | string | Post title as reported by the extractor. |
| `author` | string | Uploader handle for the post. |
| `thumbnail` | string | URL of the post's poster image. |
| `duration` | number | Video length in seconds. |
| `video_type` | string | `reel` for videos under 60 seconds, `long video` otherwise. |
| `source` | string | Platform tag; always `instagram`. |
| `found_resolution` | string | The resolution of the rendition actually selected. |
| `note` | string | Plain-English statement of whether the requested resolution was found. |
| `download_links` | object | Media links keyed as `video_without_audio`, `audio` and `merged_video` where available. |
| `video_format_details` | object | Selected video rendition details: `formatId`, `Label`, `Extension`, `Width`, `Height`, `Bitrate`, `FPS`, `MimeType`, `Quality`. |
| `audio_format_details` | object | Selected audio rendition details: `formatId`, `Label`, `Extension`, `AudioQuality`, `AudioSampleRate`, `MimeType`, `Duration`. |

#### 🧾 Instagram Video Output Fields (Failed Rows)

When a URL cannot be resolved, a compact failure record is written instead:

```json
{
  "original_url": "https://www.instagram.com/reel/PRIVATE99/",
  "error": "Unable to extract media: the post is private or unavailable",
  "status": "FAILED"
}
```

| Field | Type | Description |
| --- | --- | --- |
| `original_url` | string | null | The URL that failed to process. |
| `error` | string | null | The reason extraction failed for this specific URL. |
| `status` | string | null | Set to `FAILED` on error rows. |

***

### 💻 How to Use the Instagram Video Downloader (Step by Step)

#### Step 1: Collect the Instagram URLs You Need

Gather the public post, Reel or video URLs you want to process and place them in `video_urls`. Both plain strings and `{ "url": "..." }` objects are accepted, which makes it easy to paste output from another Actor or a spreadsheet column without reshaping it. Only publicly visible content can be resolved — private accounts, story-only content and posts that have been removed will return failure rows rather than links.

#### Step 2: Choose Your Target Resolution

Set `desired_resolution` to one of the four supported values: `1080p`, `720p`, `480p` or `360p`. Anything outside that list will cause the item to fail with a validation error, so avoid free-form values such as `4K` or `best`. Pick the quality you actually need — requesting 1080p for thumbnail generation wastes bandwidth, and requesting 360p for archival work loses detail you cannot recover later.

#### Step 3: Configure the Proxy

The `proxy` input is required; the run stops immediately if it is missing. Instagram is aggressive about datacentre traffic, so a residential proxy group is the sensible default. Supply a standard Apify proxy configuration object with `useApifyProxy` set to true and the group you intend to use. This single setting has more effect on success rate than any other input.

#### Step 4: Run the Actor

Start the run from the Apify Console or through the API. Each URL is processed in turn, and the log reports which post is currently being handled along with the proxy URL in use. Runtime scales with the number of URLs, since every post requires its own extraction pass against Instagram's media endpoints.

#### Step 5: Check Resolution Outcomes

Before touching the download links, filter the dataset on `found_resolution` and read the `note` field. Where a post has no rendition at your requested quality, the Actor selects the highest available and says so explicitly. This is the step that prevents a batch of "1080p" downloads quietly turning out to be 640-pixel-wide originals.

#### Step 6: Fetch the Media

Take the URLs from `download_links` and download them with your own client. If `merged_video` is present, that single file already contains both tracks. If only `video_without_audio` and `audio` are present, download both and mux them with a tool such as FFmpeg — the `Extension` values in the format detail objects tell you which containers you are combining.

#### Step 7: Handle Failures and Retry

Filter the dataset for rows where `status` equals `FAILED` and read the accompanying `error` message. Transient network or blocking issues are worth retrying with a different proxy group; messages indicating a private, deleted or region-locked post are permanent and should be removed from your URL list.

***

### 🔌 API Access & Integrations

Run the Instagram video downloader and get the resolved links back in a single call:

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapers-hub~instagram-video-downloader/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "video_urls": [{ "url": "https://www.instagram.com/reel/ABC123XYZ/" }],
    "desired_resolution": "1080p",
    "proxy": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
  }'
```

The same call from Python with the official client:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")

run_input = {
    "video_urls": [
        {"url": "https://www.instagram.com/reel/ABC123XYZ/"},
        {"url": "https://www.instagram.com/reel/DEF456UVW/"},
    ],
    "desired_resolution": "720p",
    "proxy": {"useApifyProxy": True, "apifyProxyGroups": ["RESIDENTIAL"]},
}

run = client.actor("scrapers-hub/instagram-video-downloader").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item.get("status") == "FAILED":
        print("failed:", item["original_url"], item["error"])
    else:
        print(item["author"], item["found_resolution"], item["download_links"])
```

Results can also be forwarded to Zapier, Make, Google Sheets or Slack, or pushed to your own endpoint through Apify webhooks when a run completes.

***

### 💡 Best Use Cases for Instagram Video Data

#### 🎞️ Creator Content Archiving

Creators and agencies who need an offline copy of their own published Reels can batch every post URL through the Actor and use `download_links` together with `title`, `author` and `duration` to build a properly labelled archive. The `video_format_details` object records exactly what was captured, so archive quality is documented rather than assumed.

#### 📈 Social Media Analytics Pipelines

Analytics teams tracking video performance often need the media itself for frame analysis, thumbnail testing or automated captioning. Pairing `thumbnail`, `duration` and `video_type` with the resolved video link gives an ingest pipeline everything it needs to route content to the right processing step.

#### ✂️ Repurposing Content Across Platforms

Marketing teams repurposing Reels for other channels need specific renditions rather than whatever the app exports. Setting `desired_resolution` per destination and reading `found_resolution` back confirms the source quality is adequate before the edit begins.

#### 🔊 Audio Extraction for Transcription

Because `download_links.audio` is exposed separately, you can pull just the audio track for transcription or keyword analysis without downloading the full video. `audio_format_details` reports the sample rate and bitrate, which most speech-to-text services want declared upfront.

#### 🕵️ Brand and Campaign Monitoring

Brand teams monitoring how their products appear in creator content can resolve a list of tagged post URLs into media plus `author` and `title` metadata, building an evidence trail for campaign reporting or rights clearance conversations.

#### 🧪 Machine Learning Dataset Construction

Teams assembling video datasets for computer vision or multimodal models need consistent resolutions and known codecs. `found_resolution`, `video_format_details` and `duration` allow you to filter a batch down to a homogeneous training set before any file is downloaded.

#### 📚 Research and Media Studies

Researchers studying short-form video formats can use `video_type` and `duration` to segment a corpus by length, then use the thumbnail and metadata fields to code content without downloading every file in full.

***

### ⚙️ Tips for Better Instagram Video Extraction Results

- **Always use residential proxies.** Instagram blocks datacentre IP ranges aggressively. The `proxy` input is required for a reason, and residential groups materially improve success rates.
- **Stick to the four supported resolutions.** `1080p`, `720p`, `480p` and `360p` are the only accepted values; anything else fails validation for that item.
- **Download links expire.** Instagram CDN URLs are time-limited and signed. Fetch the media promptly after the run rather than storing links for later use.
- **Expect separate audio and video.** Adaptive streaming often means no merged rendition exists at your target quality. Plan for an FFmpeg mux step in your pipeline.
- **Batch in reasonable chunks.** Very large URL lists in one run make partial failures harder to retry. Several medium runs are easier to manage than one enormous one.
- **Verify posts are public first.** Private accounts and removed posts cannot be resolved and will only consume run time producing failure rows.

***

### 🛠️ Troubleshooting

**Why does the run fail immediately with a proxy error?**
The `proxy` input is mandatory. If it is missing or empty, the Actor logs an error and stops before processing any URL. Supply a valid Apify proxy configuration object, ideally with a residential group.

**Why did every URL come back with `status: "FAILED"`?**
This usually points at blocking rather than at the URLs. Switch to a residential proxy group, reduce batch size, and confirm the posts are genuinely public by opening one in a logged-out browser session.

**Why is `found_resolution` lower than what I requested?**
Instagram does not host every rendition for every post. When no stream meets your requested quality, the Actor selects the highest available and records that explicitly in the `note` field.

**Why is there no `merged_video` link in `download_links`?**
A merged link is only included when a combined audio-and-video rendition exists at or above your requested resolution. Otherwise you get `video_without_audio` and `audio` separately and mux them yourself.

**Why did an item fail with an invalid resolution message?**
`desired_resolution` accepts only `1080p`, `720p`, `480p` and `360p`. Values such as `best`, `1440p` or a bare number will be rejected for that item.

***

### ❓ Frequently Asked Questions About Instagram Video Downloading

**What does the Instagram Video Downloader do?**
It resolves public Instagram video, Reel and post URLs into direct media download links, along with metadata such as title, uploader, thumbnail, duration and detailed codec information.

**Do I need an Instagram account or login?**
No. Only publicly accessible posts can be processed, and no credentials are used or required.

**Can it download private posts or stories?**
No. Private accounts, follower-only content and stories are outside what this Instagram video downloader can reach. Those URLs return failure rows.

**What resolutions are supported?**
Four: `1080p`, `720p`, `480p` and `360p`. The Actor picks the smallest available rendition at or above your target, or the highest available if none reaches it.

**Why are audio and video returned as separate links?**
Instagram delivers video through adaptive streaming, where the audio track is frequently stored independently of the video track. The Actor surfaces both so you can combine them as needed.

**How do I merge the audio and video files?**
Download both links and combine them with FFmpeg or an equivalent tool. The `Extension` values inside `video_format_details` and `audio_format_details` tell you which containers you are working with.

**How long do the download links stay valid?**
Instagram CDN links are signed and expire after a short window. Treat them as immediately consumable rather than as durable references.

**Does the Actor store the video files for me?**
No. It returns links and metadata to the dataset. Downloading and storing the media is done by your own client or pipeline.

**Can I process many URLs in one run?**
Yes. `video_urls` accepts a list and each entry is handled independently, producing one dataset row per URL.

**What happens if one URL fails?**
Only that URL is affected. A failure record with `original_url`, `error` and `status` is written and the run continues with the next item.

**Does it handle carousel posts with multiple videos?**
The extractor inspects post entries, so multi-item posts are traversed. Output reflects what the extraction returns for that URL.

**Is a proxy really required?**
Yes. The run stops with an error if `proxy` is not supplied. Residential proxy groups are strongly recommended for Instagram traffic.

**Can I schedule recurring downloads?**
Yes. Apify's scheduler can run the Actor on a cron expression, and webhooks can push each finished dataset to your own service automatically.

**Is downloading Instagram videos legal?**
Accessing public content is one question; what you do with it is another. Videos are protected by copyright held by their creators, and reuse generally requires permission. You are responsible for compliance with Instagram's terms of service and applicable copyright law.

**What export formats are available for the results?**
Datasets can be exported as JSON, JSONL, CSV, Excel, XML or HTML from the Apify Console, or read directly through the API.

***

### 🆘 Support & Feedback

If you encounter a bug, a URL that should resolve but does not, or an unexpected extraction error, open a ticket in the **Issues** tab of this Actor on Apify. Issues filed there are tracked and answered directly.

Need a custom variant — different platforms, a different output shape, or an automated download-and-store pipeline built around this Actor? Get in touch at **scraperhubapi@gmail.com** describing what you are trying to achieve.

If the Instagram Video Downloader proves useful, please consider leaving a review on its Apify page. Ratings and written feedback shape what gets improved next.

***

### ⚖️ Disclaimer

This Instagram video downloader processes only publicly accessible Instagram content at URLs you explicitly supply. It does not log in, does not access private accounts or follower-restricted material, and does not circumvent authentication or technical access controls.

Instagram videos, Reels, thumbnails and captions are protected by copyright held by the creators who published them. Downloading content does not grant you any right to republish, redistribute, monetise or train on it. Obtain permission from the rights holder before reusing material, and review Instagram's terms of service before running this Actor at scale.

Where the data you collect includes personal information — uploader handles, faces appearing in video, or identifiable audio — you act as the data controller under the GDPR, the UK GDPR, the CCPA and other applicable privacy laws, with the corresponding obligations around lawful basis, retention limits and data-subject rights.

For questions about data handling, or to request removal of data associated with your runs, contact **scraperhubapi@gmail.com**.

# Actor input Schema

## `video_urls` (type: `array`):

List of Instagram video URLs to process.

## `desired_resolution` (type: `string`):

Select the desired resolution: 1080p, 720p, 480p, or 360p.

## `proxy` (type: `object`):

Configure proxies for this Actor. Only Residential proxies are available.

## Actor input object example

```json
{
  "video_urls": [
    {
      "url": "https://www.instagram.com/reel/DHCcTryOTlc/?igsh=NWp1YXg1azE4bm11"
    }
  ],
  "desired_resolution": "1080p",
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Records scraped by Instagram Video Downloader, stored in the run's default dataset.

# 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 = {
    "video_urls": [
        {
            "url": "https://www.instagram.com/reel/DHCcTryOTlc/?igsh=NWp1YXg1azE4bm11"
        }
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapers-hub/instagram-video-downloader").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 = {
    "video_urls": [{ "url": "https://www.instagram.com/reel/DHCcTryOTlc/?igsh=NWp1YXg1azE4bm11" }],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("scrapers-hub/instagram-video-downloader").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 '{
  "video_urls": [
    {
      "url": "https://www.instagram.com/reel/DHCcTryOTlc/?igsh=NWp1YXg1azE4bm11"
    }
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call scrapers-hub/instagram-video-downloader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapers-hub/instagram-video-downloader"
        }
    }
}

```

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/mv3gd9Dsd7l9YaGK7/builds/0aD1dzNHU2dUcXzQ0/openapi.json
