# Instagram Downloader API (`maximedupre/instagram-downloader-api`) Actor

Download media URLs from public Instagram posts, reels, and TV links. Export direct media links, thumbnails, captions, engagement counts, source URLs, and scrape timestamps.

- **URL**: https://apify.com/maximedupre/instagram-downloader-api.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.50 / 1,000 instagram medias

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 downloader API for public media URLs

Instagram Downloader API downloads media URLs from public [Instagram](https://www.instagram.com/) posts, reels, and TV links. Paste one or more Instagram URLs and export direct media links, thumbnails, captions, engagement counts, source URLs, shortcodes, author usernames, timestamps, and scrape metadata to an Apify dataset.

Use this Instagram downloader API when you already have the Instagram post or reel URLs and need a repeatable way to collect media links for content review, research, reporting, archiving, social media operations, or an API workflow. The Actor works with public Instagram pages only. You do not need to provide Instagram cookies, a login, or an Instagram API key.

For a small first run, keep the prefilled public Instagram reel URL and start the Actor. Once the output shape looks right, paste your own list of public Instagram post, reel, or TV links, schedule the Actor, or call it through the Apify API.

### ✅ What this Actor does

- Accepts public Instagram post, reel, and TV URLs.
- Supports URL forms such as `https://www.instagram.com/p/SHORTCODE/` and `https://www.instagram.com/username/reel/SHORTCODE/`.
- Saves one dataset row per successfully found media item.
- Handles carousel posts by saving separate rows for the media items Instagram exposes.
- Adds direct media URLs, thumbnail URLs, captions, source links, shortcodes, author usernames, and scrape timestamps.
- Adds visible engagement counts such as likes, comments, and views when Instagram exposes them publicly.
- Can include a small preview of public comments when Instagram exposes preview comments on the page.
- Skips unsupported, private, deleted, unavailable, or temporarily unreachable URLs without saving failure rows.

This Actor is focused on downloading media links from known public Instagram URLs. It does not discover posts from profiles, hashtags, search results, locations, stories, highlights, comments, followers, or private accounts.

### 📦 Data you can export

Each output row represents one public Instagram media item. Core fields include:

- `status` with `success` for saved media rows
- `input_url` and `input_index`
- `canonical_url` and `source_url`
- `shortcode` and `raw_media_id`
- `media_type` with `photo` or `video`
- `media_index` and `carousel_count`
- `download_url` and `thumbnail_url`
- `username` and `caption`
- `like_count`, `comment_count`, and `view_count` when available
- `taken_at` and `taken_at_timestamp`
- `width`, `height`, and `file_extension`
- `comments_preview`
- `scraped_at`

You can open the dataset in Apify, export it as JSON, CSV, Excel, XML, RSS, or HTML, call it through the Apify API, schedule runs, or connect it to webhooks and integrations.

### 🚀 How to run

1. Paste one or more public Instagram URLs in **Instagram URLs**.
2. Keep **Comments preview limit** at `10`, lower it, or set it to `0` if you only need media links and post metadata.
3. Start the Actor.
4. Open the dataset and use `download_url` for the media link and `source_url` to trace the row back to Instagram.

For quick tests, use 1-2 public URLs. For larger batches, add up to 100 public post, reel, or TV URLs in one run.

### 🔧 Input

| Field | What to enter |
| ----- | ------------- |
| `urls` | Public Instagram post, reel, or TV URLs. |
| `commentsPreviewLimit` | Maximum number of preview comments to include when Instagram exposes them publicly. Use `0` to skip comment previews. |

Example input:

```json
{
	"urls": [
		"https://www.instagram.com/kyliejenner/reel/DRP7Cajkpn9/"
	],
	"commentsPreviewLimit": 10
}
````

### 📄 Output example

```json
{
	"status": "success",
	"input_url": "https://www.instagram.com/kyliejenner/reel/DRP7Cajkpn9/",
	"input_index": 0,
	"canonical_url": "https://www.instagram.com/p/DRP7Cajkpn9/",
	"source_url": "https://www.instagram.com/p/DRP7Cajkpn9/",
	"shortcode": "DRP7Cajkpn9",
	"media_type": "video",
	"media_index": 0,
	"carousel_count": null,
	"download_url": "https://scontent.cdninstagram.com/example.mp4",
	"thumbnail_url": "https://scontent.cdninstagram.com/example.jpg",
	"username": "kyliejenner",
	"caption": "obsessed @smashkitchen",
	"like_count": 865743,
	"comment_count": 7257,
	"view_count": null,
	"taken_at": "2025-11-19T18:54:29.000Z",
	"taken_at_timestamp": 1763578469,
	"width": 720,
	"height": 1280,
	"file_extension": "mp4",
	"comments_preview": [],
	"source": "instagram",
	"service": "instagram.com",
	"parent_shortcode": null,
	"raw_media_id": "3769491063829600765",
	"scraped_at": "2026-05-28T21:25:00.000Z"
}
```

Field availability depends on what Instagram exposes on the public page. Missing public values are saved as `null` or empty arrays instead of guessed.

### 💰 Pricing

This Actor uses pay-per-event pricing. You pay for each Instagram media item saved to the dataset, plus the standard small Actor start charge shown by Apify before you run it.

The media item event is set to `$4.50 per 1,000 media items`.

### ⚠️ Limits and access

Instagram Downloader API works with public Instagram post, reel, and TV pages. It does not use Instagram accounts, cookies, or API keys.

Private accounts, deleted posts, login-only pages, stories, highlights, profile feeds, hashtag feeds, search pages, and comment-only exports are not supported. If Instagram temporarily does not expose a URL, the Actor logs the issue and continues with the rest of your list.

Direct media URLs are source-provided URLs available at scrape time. They can expire or change later, so store or process important media soon after the run.

### ❓ FAQ

#### 🎞️ Can I download Instagram reels?

Yes. Add a public Instagram reel URL in **Instagram URLs**. The output includes a media `download_url` when Instagram exposes one publicly.

#### 🔐 Do I need Instagram cookies or an account?

No. This Actor is designed for public Instagram URLs and does not ask for user cookies, a login, or an Instagram API key.

#### 🖼️ Can this download carousel posts?

Yes, when Instagram exposes carousel media publicly. The Actor saves separate media rows and includes `media_index` plus `carousel_count` so you can keep the items grouped.

#### 🚧 Does it save private Instagram posts?

No. Private, deleted, login-only, or otherwise unavailable Instagram content is outside the Actor's contract.

#### 🔌 Can I use it through the Apify API?

Yes. The Actor output is a normal Apify dataset, so you can run it through the Apify API, export the results, schedule runs, or connect it to integrations and webhooks.

### 📝 Changelog

- 0.1: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~instagram-downloader-api/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [TikTok Video Downloader ↗](https://apify.com/maximedupre/tiktok-video-downloader) - Download public TikTok video or audio files with source metadata.
- [Telegram Media Downloader ↗](https://apify.com/maximedupre/telegram-media-downloader) - Export media links and post data from public Telegram channels and posts.
- [Social Media Stats Checker ↗](https://apify.com/maximedupre/social-media-stats-checker) - Check public profile stats across major social platforms.
- [TikTok Transcript Scraper ↗](https://apify.com/maximedupre/tiktok-transcript-scraper) - Extract public TikTok captions and transcript text.
- [YouTube Channel Scraper ↗](https://apify.com/maximedupre/youtube-channel-scraper) - Export public YouTube channel and recent video data.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

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

Public Instagram post, reel, or TV URLs to process. Use links like https://www.instagram.com/p/SHORTCODE/ or https://www.instagram.com/username/reel/SHORTCODE/.

## `commentsPreviewLimit` (type: `integer`):

Maximum number of preview comments to include when Instagram exposes comments on the public page. Use 0 if you only need media links and post metadata.

## Actor input object example

```json
{
  "urls": [
    "https://www.instagram.com/kyliejenner/reel/DRP7Cajkpn9/"
  ],
  "commentsPreviewLimit": 10
}
```

# Actor output Schema

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

Open the dataset with Instagram media URLs, thumbnails, captions, engagement counts, source links, and scrape timestamps.

# 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.instagram.com/kyliejenner/reel/DRP7Cajkpn9/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/instagram-downloader-api").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.instagram.com/kyliejenner/reel/DRP7Cajkpn9/"] }

# Run the Actor and wait for it to finish
run = client.actor("maximedupre/instagram-downloader-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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.instagram.com/kyliejenner/reel/DRP7Cajkpn9/"
  ]
}' |
apify call maximedupre/instagram-downloader-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/instagram-downloader-api",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Downloader API",
        "description": "Download media URLs from public Instagram posts, reels, and TV links. Export direct media links, thumbnails, captions, engagement counts, source URLs, and scrape timestamps.",
        "version": "0.1",
        "x-build-id": "XyfgdaIZMRDvHBk6X"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~instagram-downloader-api/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-instagram-downloader-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/maximedupre~instagram-downloader-api/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-instagram-downloader-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/maximedupre~instagram-downloader-api/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-instagram-downloader-api",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "urls"
                ],
                "properties": {
                    "urls": {
                        "title": "Instagram URLs",
                        "minItems": 1,
                        "maxItems": 100,
                        "type": "array",
                        "description": "Public Instagram post, reel, or TV URLs to process. Use links like https://www.instagram.com/p/SHORTCODE/ or https://www.instagram.com/username/reel/SHORTCODE/.",
                        "items": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "commentsPreviewLimit": {
                        "title": "Comments preview limit",
                        "minimum": 0,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of preview comments to include when Instagram exposes comments on the public page. Use 0 if you only need media links and post metadata.",
                        "default": 10
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
