# Instagram Posts Timeline (`opspilot.cc/instagram-posts-timeline`) Actor

🗂️ Instagram Posts Timeline | The whole timeline, not just the Reels Give it numeric Instagram user ids and get every post as a row — video, image and carousel — with play counts on the video rows, carousel slide counts, tagged users and the format mix per account.

- **URL**: https://apify.com/opspilot.cc/instagram-posts-timeline.md
- **Developed by:** [wang wei](https://apify.com/opspilot.cc) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.005 / actor start

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

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

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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

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

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

# README

## 🗂️ Instagram Posts Timeline

> The whole timeline, not just the Reels — video, image and carousel posts in one run, with play counts where they exist.

### ✨ What you get

One dataset row per post:

| Field | What it is |
|---|---|
| **`contentType`** | `video`, `image` or `carousel` — Instagram's own `media_type`, read directly |
| `mediaTypeCode` | the raw code (1 / 2 / 8) |
| `playCount` / `playsAvailable` | plays, when this source reports them. **Not every video row has one** — measured both ways, so check `playsAvailable` per row rather than assuming |
| `likeCount` / `commentCount` / `likeToPlayRatio` | engagement; the ratio is video-only |
| `countsHidden` | `true` when the author hides like/view counts |
| `carouselCount` / `carouselVideoSlides` | slide count and how many of those slides are video — a mixed carousel is not a single photo |
| `taggedUsers` / `taggedUserCount` | accounts tagged in the post |
| `caption` / `hasCaption` | caption text and whether there was one |
| `musicTitle` / `durationSeconds` | audio and length (video rows) |
| `userId` / `username` / `authorFollowers` / `isVerified` | the account |
| `shortcode` / `url` / `publishedAt` / `position` | id, link, time, order |

The run summary gives, per account: posts collected, video/image/carousel split and `videoShare`, **`medianPlayCountVideoOnly`**, median likes and comments, how many rows actually carried a play count (`postsWithPlayCount`), how many posts used tagging, caption coverage, the 5 most-liked posts, and a `playsNote` explaining the play-count absence on photo posts.

### 💼 Use cases

- **Judging an account's content strategy rather than its Reels** — `contentType` is read straight from Instagram's own `media_type`, so a video post with no play count is still a video. `videoShare` next to `medianPlayCountVideoOnly` is what separates a video-heavy account that underperforms from a photo-led account whose likes carry it.
- **Seeing how much a brand collaboration actually is** — `taggedUsers` and `taggedUserCount` on each post, plus `postsWithTagging` in the summary, are how Instagram itself records creator partnerships. A post with a brand tagged in it is evidence, not a caption keyword.
- **Checking whether a carousel is really a photo** — `carouselCount` and `carouselVideoSlides` distinguish a 10-slide album from a single image, so a mixed carousel never gets counted as one static post in your format mix.
- **Measuring how a creator uses audio** — `musicTitle` and `durationSeconds` on the video rows let you brief the next Reel against what the account has already used, instead of guessing.

### ✅ Who this is for

- **Content strategists auditing format mix**— who need the video / image / carousel split of up to 20 accounts in one dataset, including the carousels a Reels-only view hides.
- **Brand and partnerships teams**— looking for how a creator tags other accounts, which is the platform's own record of a collaboration.
- **Video and Reels teams** checking play counts honestly — `postsWithPlayCount` tells you how many rows actually carried one before you quote a reach figure internally.
- **Agencies building creator comparison tables**— who need per-post rows with types and timestamps that can be joined with the Reels Actor on shared `shortcode` values.

### ❌ Who this is NOT for

- **Handles or profile URLs** — this Actor takes **numeric user ids only** and refuses handles up front with an explanation. Use the Instagram Posts by User Actor if you only have `@natgeo` and a profile link.
- **Reels-only analysis** — the Reels Actor in this family returns short-form video. This one returns the whole timeline, which is the point, but it also means a video-only question is better served by the dedicated Reels dataset.
- **Treating every video row as having a play count** — not every video post exposes one; in testing the same account returned video rows with counts and without in a single run. Filter on `playsAvailable: true` and read `postsWithPlayCount`, because a row without a count reports `playCount: null`, never 0.
- **Reading a filtered format mix as the account's real mix** — if you pass `contentTypes: ["video"]`, the summary warns how many rows were dropped and the reported mix is only the mix you asked for. Filtering silently would have changed the number you came for.
- **A follower or audience dataset** — these are posts, not people. `authorFollowers` is the account's own count carried on the row; it tells you nothing about who follows them, and this Actor is Instagram-only.

### 🚀 Quick start

1. Open the Actor and press **Start** (defaults to `787132`).
2. Add numeric user ids — one per line, up to 20.
3. Read `videoShare` next to `medianPlayCountVideoOnly`. A high video share with a low play median is a different content strategy from a photo-led account with strong likes.

### 📥 Input parameters

| Parameter | Type | Default | What it does |
|---|---|---|---|
| `userIds` | list | one public account | **Numeric** Instagram user ids, one per line, up to 20 per run. |
| `contentTypes` | list | empty (all) | Keep only `video`, `image` and/or `carousel`. Empty keeps every format. |
| `maxPostsPerAccount` | number | `60` | 1–200 posts per account. A run-wide request budget (12 free / 40 paid) also caps total upstream calls; see Billing. |

### 📤 Output

- **Dataset** — one row per post (or a notice when nothing was collected)
- **SUMMARY** — per-account format mix, reach distribution, top posts, warnings

### ⚙️ How it works

1. Each input must be a numeric user id; handles are refused up front **with an explanation**, because this source does not accept them.
2. Posts are paged with Instagram's `next_max_id`, de-duplicated by shortcode, and the loop stops when a page adds nothing new or the cursor does not advance.
3. `contentType` comes from Instagram's own `media_type` rather than being inferred from whether a play count exists, so a video post with no plays is still labelled `video`.
4. If `contentTypes` filters rows out, the summary warns how many were dropped — filtering silently would change the format mix you came to measure.

### 💰 Billing

**Billed per run.** A single `apify-actor-start` charge applies when the run begins, at the price shown on this Actor's page. A run that returns 300 rows costs the same as one that returns 3. There is no daily run cap.

**Free plan limit.** One run collects **5 accounts over 3 pages, 60 posts each**. That is a hard ceiling on the upstream cost, so it cannot be raised from the input form. A capped run still succeeds: it writes a `notice` row to the dataset, sets `appliedLimits.capped: true` in `SUMMARY`, and logs why. Any paid Apify plan lifts the cap to 20 accounts over 15 pages and 200 posts each.

**Run-wide request budget.** On top of the per-item caps, every run has a fixed ceiling on upstream requests in total — **12 on the free plan, 40 on paid Apify plans** — shared by all accounts, keywords, hashtags or posts in that run, and counting retries. A single item can still walk all of its pages; only wide multi-item runs are compressed. Hitting the ceiling is reported, not hidden: the run still succeeds, delivers everything fetched so far, writes a `type: "notice"` row, and sets `SUMMARY.budgetExhausted: true` alongside `SUMMARY.maxRequestsPerRun` and `SUMMARY.upstreamRequests`.

The per-item figures above are upper bounds, not a promise for every run: when a run supplies the maximum number of items, the shared budget is reached first and fewer items are completed. `SUMMARY.upstreamRequests` reports exactly how many upstream requests were used.

### ❓ FAQ

**How is this different from your Instagram Reels Actor?**
The Reels Actor returns short-form video only. This one returns the account's whole timeline — image posts and carousels included, which is often where the real content strategy shows. The two datasets share the same `shortcode` values, so they can be joined.

**Which rows have a play count?**
Only video posts can have one, and **not every video post does** — in testing the same account returned video rows with counts and video rows without, in the same run. Image and carousel posts never do. So filter on `playsAvailable: true` before computing reach, and read `postsWithPlayCount` in the summary to see how many rows that left. A row without a count reports `playCount: null`, never 0, because "not reported" and "zero plays" are different claims.

**What is a carousel vs an image post?**
A carousel (album) is a multi-slide post — `carouselCount` gives the slide count and `carouselVideoSlides` how many of those are video. A single image post has `carouselCount: null`.

**What does `taggedUsers` give me?**
The accounts tagged in a post, which is how Instagram tracks brand collaborations and UGC. `postsWithTagging` in the summary shows how often an account uses it.

**The format filter dropped rows I expected to keep.**
Check `warnings`: it reports how many rows were removed. A filter that keeps only `video` will of course produce no image or carousel rows, and the mix reported is then only the mix you asked for.

**How deep does it go?**
As far as `maxPostsPerAccount` allows, following Instagram's own cursor.

### 📚 Resources

- Instagram public timeline data (no login required)
- Apify free plan: monthly credit covers usage, no separate daily cap

# Changelog

This Actor's version history is a separate document: https://apify.com/opspilot.cc/instagram-posts-timeline/changelog.md

# Actor input Schema

## `userIds` (type: `array`):

One per line, up to 20 per run. This data source needs the numeric id, not the handle — open a profile in a browser and the id is in the page source.

## `contentTypes` (type: `array`):

Leave empty for all formats, or list video, image and/or carousel to keep only those.

## `maxPostsPerAccount` (type: `integer`):

Cap on posts collected per account. A run-wide request budget (12 free / 40 paid) also caps total upstream calls; see Billing.

## Actor input object example

```json
{
  "userIds": [
    "787132"
  ],
  "contentTypes": [],
  "maxPostsPerAccount": 60
}
```

# Actor output Schema

## `dataset` (type: `string`):

One row per post, or a single notice when nothing was collected.

## `summary` (type: `string`):

Per-account format mix, reach distribution, top posts and warnings.

# 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("opspilot.cc/instagram-posts-timeline").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("opspilot.cc/instagram-posts-timeline").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 '{}' |
apify call opspilot.cc/instagram-posts-timeline --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,opspilot.cc/instagram-posts-timeline"
        }
    }
}
```

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/l1Nu5PAKCPGDmPiKV/builds/U3wl9pc4LLj8km5aV/openapi.json
