# LinkedIn Post Publisher - Text, Image & Video (`eanappi/linkedin-post-publisher-text-image-video`) Actor

Publish LinkedIn posts via API: text, up to 5 images, or an MP4 video, on your personal profile or company page. Pass an access token and go - no browser, no scraping, no OAuth setup in your code.

- **URL**: https://apify.com/eanappi/linkedin-post-publisher-text-image-video.md
- **Developed by:** [Alejandro Nappi](https://apify.com/eanappi) (community)
- **Categories:** Social media, Automation
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 published posts

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

## LinkedIn Post Publisher - Text, Image & Video

**Publish a post to LinkedIn with one API call.** Send text, up to 5 images, or an MP4 video to your personal profile or your company page, and get the URL of the published post back.

No headless browser, no scraping, no OAuth plumbing in your own code: you pass a LinkedIn access token, your text and your media URLs, and this Actor handles the whole upload flow of the official LinkedIn Posts API for you.

Use it to automate LinkedIn posting from Make, Zapier, n8n, a cron job, a CMS webhook, or your own backend — anywhere you can send an HTTP request.

### What it does

- Text-only posts, with hashtags and mentions.
- Up to 5 images in a single post (JPG, PNG, GIF).
- One MP4 video per post, up to 500 MB, multipart upload handled for you.
- Alt text per image, for accessibility.
- Personal profile (detected from your token) or company page.

### How to use it

#### 1. Get a LinkedIn access token

1. Create an app at [LinkedIn Developers](https://www.linkedin.com/developers/apps) and link it to a company page.
2. Under **Products**, add *Share on LinkedIn* and *Sign In with LinkedIn using OpenID Connect*. To post as a company, also add *Community Management API*.
3. Generate a token with the scopes you need:

| To post on… | Scopes |
| --- | --- |
| Your personal profile | `w_member_social`, `openid`, `profile` |
| A company page | `w_organization_social` |

LinkedIn tokens last 60 days — generate a new one when it expires.

#### 2. Run the Actor

Minimal input:

```json
{
  "accessToken": "AQV...",
  "text": "Hello LinkedIn 👋"
}
```

With images:

```json
{
  "accessToken": "AQV...",
  "text": "Three shots of the new dashboard #product",
  "mediaUrls": [
    "https://example.com/1.png",
    "https://example.com/2.png",
    "https://example.com/3.png"
  ],
  "altTexts": ["Overview", "Metrics detail", "Settings"]
}
```

With video:

```json
{
  "accessToken": "AQV...",
  "text": "How we built it",
  "mediaUrls": ["https://example.com/demo.mp4"]
}
```

To publish as your company page instead of your profile, add `organizationId` — it works the same with text, images, or video:

```json
{
  "accessToken": "AQV...",
  "text": "How we built it",
  "mediaUrls": ["https://example.com/demo.mp4"],
  "organizationId": "5515715"
}
```

#### 3. From your code

```bash
curl -X POST "https://api.apify.com/v2/acts/3_ralen~linkedin-publisher/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"accessToken":"AQV...","text":"New release 🚀 #apify"}'
```

The response comes back once the post is live.

### Input

| Field | Required | Description |
| --- | --- | --- |
| `accessToken` | ✅ | Your LinkedIn access token (see above). |
| `text` | — | The post text. Supports `#hashtags` and mentions like `@[Name](urn:li:organization:123)`. |
| `mediaUrls` | — | Public URLs: up to 5 images **or** a single MP4 video. |
| `altTexts` | — | Alt text, in the same order as `mediaUrls`. |
| `organizationId` | — | Numeric ID of the company page. Leave empty to post on your personal profile. |
| `visibility` | — | `PUBLIC` (default) or `CONNECTIONS` (your 1st-degree connections only, personal profile only). |

You need either `text` or `mediaUrls` — or both.

### Output

```json
{
  "postId": "urn:li:share:6844785523593134080",
  "url": "https://www.linkedin.com/feed/update/urn:li:share:6844785523593134080/",
  "author": "urn:li:person:abc123",
  "media": ["urn:li:image:C4E10AQFoyyAjHPMQuQ"]
}
```

Available in the dataset and under the `OUTPUT` key of the key-value store.

### Use cases

- **Auto-post new content** — publish to LinkedIn whenever your blog, YouTube channel, or newsletter goes out.
- **Schedule posts** — pair it with an Apify schedule to post at the best time, without a social media tool subscription.
- **Cross-post from another platform** — take the text and media you already published elsewhere and mirror it on LinkedIn.
- **Company page automation** — let your CRM, CMS, or internal tool post as your organization.
- **AI content pipelines** — have an LLM draft the copy and let this Actor publish it.

### FAQ

**Can I mix images and video?** No — LinkedIn doesn't allow it. Either several images or one video.

**How long does a video post take?** LinkedIn processes video asynchronously. The Actor retries publishing for up to ~4 minutes while processing finishes; a small MP4 usually goes through in under 30 seconds.

**I get a 403 error.** Your token is missing a scope (`w_member_social` or `w_organization_social`), or your user is not an admin of the company page.

**I get a 426 error.** The LinkedIn API version this Actor targets was retired. Open an issue and it will be bumped.

**Is my token stored?** No. It is only used during the run. Mark it as secret in the input so Apify keeps it encrypted.

### Not supported yet

Documents (PDF/carousel), polls, scheduled posts, group posts, and reshares.

# Actor input Schema

## `accessToken` (type: `string`):

Your LinkedIn access token. Needs the `w_member_social` scope to post on your profile, or `w_organization_social` to post on a company page. Add `openid profile` so your profile can be detected automatically.

## `text` (type: `string`):

The text of your post. Supports hashtags (`#apify`) and mentions (`@[Name](urn:li:organization:123)`).

## `mediaUrls` (type: `array`):

Public URLs of up to 5 images, or of a single MP4 video. Leave empty for a text-only post.

## `altTexts` (type: `array`):

Alt text for screen readers, in the same order as the media URLs. Optional but recommended.

## `organizationId` (type: `string`):

Leave empty to post on your personal profile. Set the numeric ID of your company page to post as the company.

## `visibility` (type: `string`):

Who can see the post. `Connections only` applies to personal profiles.

## Actor input object example

```json
{
  "text": "Posted from Apify 🚀",
  "mediaUrls": [],
  "altTexts": [],
  "visibility": "PUBLIC"
}
```

# Actor output Schema

## `post` (type: `string`):

The LinkedIn post URN and the URL where it is live.

# 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 = {
    "text": "Posted from Apify 🚀",
    "mediaUrls": [],
    "altTexts": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("eanappi/linkedin-post-publisher-text-image-video").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 = {
    "text": "Posted from Apify 🚀",
    "mediaUrls": [],
    "altTexts": [],
}

# Run the Actor and wait for it to finish
run = client.actor("eanappi/linkedin-post-publisher-text-image-video").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 '{
  "text": "Posted from Apify 🚀",
  "mediaUrls": [],
  "altTexts": []
}' |
apify call eanappi/linkedin-post-publisher-text-image-video --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=eanappi/linkedin-post-publisher-text-image-video",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/yyMF8HJ4QvyzElbZI/builds/akCsz8VkuIqeEx4BF/openapi.json
