# Instagram Reel Uploader (`dami_studio/instagram-reel-uploader`) Actor

Upload a Reel to your own Instagram account from a URL, with a caption and hashtags. You bring your own exported session cookies (Cookie-Editor), so your login stays yours and nothing is shared. For creators automating their own Reels posting.

- **URL**: https://apify.com/dami\_studio/instagram-reel-uploader.md
- **Developed by:** [Dami's Studio](https://apify.com/dami_studio) (community)
- **Categories:** Social media, For creators, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Reel Uploader

Posts a Reel to your own Instagram account from a URL. You give it the video, a caption, and your own exported session cookies, and it drives a headless browser through Instagram's web composer to publish the Reel. It's built to be the publish step of a faceless-content or scheduling pipeline.

### How it works

It downloads your video, launches a headless Chromium routed through your proxy, loads your exported Instagram cookies into the session, opens the Create composer on instagram.com, sets the file, advances through the crop and edit steps, writes the caption, and shares. There is no shared login. You bring your own session each run, exported from a browser where you're already signed in.

### Try it with no login (demo / sample mode)

Run it with **no cookies** (or set `demoMode: true`) and it returns one clearly-labeled **sample row** and uploads nothing — a try-before-you-export preview. The sample row carries `_demo: true` and a `_notice` explaining that no credentials were supplied. To post for real, supply your own session (below).

### Input

| Field | Required | Notes |
|---|---|---|
| `videoUrl` | for real posts | Public **https** direct URL to the `.mp4` to post as a Reel. You host it. Max 600 MB. |
| `cookies` | for real posts | **Your own** Instagram session, exported as Cookie-Editor JSON from a browser where you're logged in. Must include `sessionid` and `ds_user_id`. Stored as a secret. |
| `caption` | no | The Reel caption. Put your `#hashtags` here. |
| `proxyConfiguration` | no | A residential proxy in your country is recommended; Instagram is suspicious of datacenter IPs. |
| `demoMode` | no | Return a labeled sample row without uploading. Auto-enabled when no `cookies` are given. |

#### How to export your Instagram cookies

1. Log in to **instagram.com** in Chrome/Edge.
2. Install the **Cookie-Editor** extension and open it on the Instagram tab.
3. Click **Export → Export as JSON** (this copies a cookies array including `sessionid` and `ds_user_id`).
4. Paste that JSON into the `cookies` field. It is automating **your own** logged-in session — nothing is shared.

### Output

One dataset record.
- **Demo run:** `{ _demo: true, _notice, ok: true, demo: true, reelUrl: ".../reel/SAMPLE/", ... }` — nothing uploaded.
- **Real success:** `{ ok: true, platform, caption, posted: true, confirmed: true, reelUrl, finalUrl }` — `confirmed` is only `true` after Instagram's "has been shared" toast is actually seen, and `reelUrl` is the real permalink when it can be read.
- **Failure:** `{ ok: false, error }` with a customer-actionable message, plus a debug **screenshot + page HTML** saved in the run's key-value store and named in the error.

### Method & reliability

This is a **best-effort browser-automation** method: it drives Instagram's real web "Create" composer (there is no official Reels upload API). It selects Reel where offered, advances through the crop/cover/edit steps with explicit waits and resilient role/text selectors, verifies the file registered and the caption took, and only reports success after the share confirmation. Because it depends on Instagram's live UI, a layout change on their side can break a step — in which case you get a clear "layout may have changed; this actor needs an update" error and a screenshot, not a silent wrong result.

### Example

```json
{
  "videoUrl": "https://cdn.example.com/reel.mp4",
  "caption": "behind the scenes #reels",
  "cookies": "[{\"name\":\"sessionid\",\"value\":\"...\",\"domain\":\".instagram.com\",\"path\":\"/\"}]"
}
````

### Pricing

$0.10 per successful upload. Failed runs are free. You supply your own cookies and proxy.

### Notes

This automates your logged-in Instagram session, which Meta's terms discourage, so run it on your own account at your own discretion. Automating a session from a new device/IP is a pattern Instagram may flag with a temporary action-block or checkpoint — a residential proxy in your own country reduces (but does not eliminate) this. Cookies expire, so re-export them when you see a "not logged in" error. Because it drives Instagram's actual web UI, a layout change on their side can break a selector and need an update — failures are surfaced clearly with a saved screenshot, never as a silent success.

# Actor input Schema

## `videoUrl` (type: `string`):

Public direct URL to the video (.mp4) to upload as a Reel.

## `caption` (type: `string`):

The Reel caption (include #hashtags here).

## `cookies` (type: `string`):

Your Instagram session cookies, from a browser where YOU are logged in. Paste either a Cookie-Editor JSON export (recommended) or the raw 'Cookie:' header string from DevTools. Automates your own session. Kept private.

## `proxyConfiguration` (type: `object`):

Apify proxy. RESIDENTIAL in your country recommended.

## `demoMode` (type: `boolean`):

Run without credentials and return one clearly-labeled SAMPLE row without uploading anything. Also auto-enabled when no cookies are supplied (e.g. a keyless try-it run).

## Actor input object example

```json
{
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  },
  "demoMode": false
}
```

# Actor output Schema

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

Result rows / metadata are stored in the default dataset (one row per item).

## `files` (type: `string`):

Generated media/files (video, audio, images, captions) are stored in the default key-value store.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dami_studio/instagram-reel-uploader").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("dami_studio/instagram-reel-uploader").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 '{}' |
apify call dami_studio/instagram-reel-uploader --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Reel Uploader",
        "description": "Upload a Reel to your own Instagram account from a URL, with a caption and hashtags. You bring your own exported session cookies (Cookie-Editor), so your login stays yours and nothing is shared. For creators automating their own Reels posting.",
        "version": "0.1",
        "x-build-id": "ShG2LqMT5qBJEkuNt"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dami_studio~instagram-reel-uploader/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dami_studio-instagram-reel-uploader",
                "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/dami_studio~instagram-reel-uploader/runs": {
            "post": {
                "operationId": "runs-sync-dami_studio-instagram-reel-uploader",
                "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/dami_studio~instagram-reel-uploader/run-sync": {
            "post": {
                "operationId": "run-sync-dami_studio-instagram-reel-uploader",
                "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",
                "properties": {
                    "videoUrl": {
                        "title": "Video URL",
                        "type": "string",
                        "description": "Public direct URL to the video (.mp4) to upload as a Reel."
                    },
                    "caption": {
                        "title": "Caption",
                        "type": "string",
                        "description": "The Reel caption (include #hashtags here)."
                    },
                    "cookies": {
                        "title": "Instagram session cookies (BYO)",
                        "type": "string",
                        "description": "Your Instagram session cookies, from a browser where YOU are logged in. Paste either a Cookie-Editor JSON export (recommended) or the raw 'Cookie:' header string from DevTools. Automates your own session. Kept private."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy",
                        "type": "object",
                        "description": "Apify proxy. RESIDENTIAL in your country recommended.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    },
                    "demoMode": {
                        "title": "Demo / sample mode",
                        "type": "boolean",
                        "description": "Run without credentials and return one clearly-labeled SAMPLE row without uploading anything. Also auto-enabled when no cookies are supplied (e.g. a keyless try-it run).",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
