# Instagram Latest Posts Scraper (`receptional_blender/instagram-recent-posts`) Actor

Hand it a list of Instagram handles and get back each profile's newest posts — caption, likes, comments, timestamp, media URLs and video views — one clean dataset row per post. No browser, just fast public-API requests.

- **URL**: https://apify.com/receptional\_blender/instagram-recent-posts.md
- **Developed by:** [Assia Fadli](https://apify.com/receptional_blender) (community)
- **Categories:** Social media
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 1,000 results

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.

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

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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 Latest Posts Scraper

Feed this actor a list of Instagram handles and it hands back each profile's
**newest posts** — captions, likes, comments, timestamps, media URLs and video
view counts. You get **one dataset row per post**, ready to drop into a sheet,
a database or the next step of your pipeline.

Under the hood it talks to Instagram's own public `web_profile_info` endpoint
(the same request the instagram.com website makes). There's no headless browser
involved, so runs are fast, light and cheap.

### What you can do with it

- Track what your competitors or favourite creators just posted.
- Pull recent captions and engagement for content research.
- Build a lightweight feed monitor across many accounts at once.
- Grab media URLs and video view counts for reporting.

### Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `usernames` | array of strings | yes | Handles to scrape (with or without `@`, plain handle or full profile URL). |
| `maxPosts` | integer | no | Cap on recent posts per profile. Omit to return everything available (~12). |
| `sessionCookie` | string (secret) | no | Value of your Instagram `sessionid` cookie. Boosts success rate and unlocks otherwise-blocked profiles. |
| `proxyCountry` | string | no | Two-letter country code for the residential proxy (e.g. `US`, `GB`, `DE`). |

The original `instagramUsernames`, `sessionId` and `proxyCountryCode` field names
are still accepted as aliases, so existing configs keep working unchanged.

#### Input example

```json
{
    "usernames": ["nasa", "instagram"],
    "maxPosts": 12
}
````

### Output

One row per post, each prefixed with the owning `username`:

| Field | Description |
| --- | --- |
| `username` | The profile the post belongs to. |
| `shortcode` | Instagram post shortcode. |
| `url` | Canonical post URL (`https://www.instagram.com/p/<shortcode>/`). |
| `caption` | Post caption text. |
| `likes` | Like count. |
| `comments` | Comment count. |
| `timestamp` | Post time as an ISO 8601 string. |
| `isVideo` | Whether the post is a video. |
| `videoViewCount` | View count (videos only, otherwise `null`). |
| `displayUrl` | Full-size media URL. |
| `thumbnailSrc` | Thumbnail media URL. |
| `isPinned` | Whether the post is pinned on the profile. |
| `accessibilityCaption` | Auto-generated alt-text describing the image. |

#### Output sample

```json
{
    "username": "nasa",
    "shortcode": "DABc123XyZ",
    "url": "https://www.instagram.com/p/DABc123XyZ/",
    "caption": "A stunning view of a distant galaxy captured by our telescope.",
    "likes": 482913,
    "comments": 1204,
    "timestamp": "2026-07-15T18:30:00.000Z",
    "isVideo": false,
    "videoViewCount": null,
    "displayUrl": "https://instagram.f...cdn.net/....jpg",
    "thumbnailSrc": "https://instagram.f...cdn.net/....jpg",
    "isPinned": false,
    "accessibilityCaption": "Photo by NASA on July 15, 2026."
}
```

If a handle can't be fetched (invalid handle, private/empty profile, or a
block), the actor writes a single `{ "username": "...", "error": "..." }` row for
that handle instead of crashing the whole run.

### Pricing — pay per event

This actor uses Apify's **pay-per-event** pricing. You're charged one
`post-scraped` event **per delivered post row**. Error and empty-profile rows are
never charged, and the run stops automatically once your event budget is reached
so you're never billed beyond it.

### Notes

- **Proxies:** Residential proxies are strongly recommended — Instagram
  aggressively rate-limits datacenter and cloud IPs. If proxies aren't available
  on your account, the actor gracefully falls back to a direct connection.
- **Session cookie:** Supplying your `sessionCookie` markedly increases
  reliability and reaches profiles that are otherwise blocked for anonymous
  requests.
- **Post count:** The `web_profile_info` endpoint returns roughly the 12 most
  recent posts per profile. `maxPosts` can only cap that set, not exceed it.
- **Private profiles:** Posts from private accounts are not returned.

# Actor input Schema

## `usernames` (type: `array`):

One or more Instagram handles (with or without @, or full profile URLs). For each, the actor returns the profile's most recent posts — one dataset row per post.

## `maxPosts` (type: `integer`):

Maximum number of recent posts to return per username. Leave empty to return every post the endpoint provides (typically ~12).

## `sessionCookie` (type: `string`):

Value of your Instagram 'sessionid' cookie. Optional, but it significantly increases success rates and unlocks profiles that are otherwise blocked.

## `proxyCountry` (type: `string`):

Two-letter country code for the residential proxy (e.g. US, GB, DE). Best matched to the country of the session/account you use.

## Actor input object example

```json
{
  "usernames": [
    "cristiano",
    "leomessi"
  ],
  "maxPosts": 12,
  "proxyCountry": "US"
}
```

# 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 = {
    "usernames": [
        "instagram",
        "nasa"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("receptional_blender/instagram-recent-posts").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 = { "usernames": [
        "instagram",
        "nasa",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("receptional_blender/instagram-recent-posts").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 '{
  "usernames": [
    "instagram",
    "nasa"
  ]
}' |
apify call receptional_blender/instagram-recent-posts --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Latest Posts Scraper",
        "description": "Hand it a list of Instagram handles and get back each profile's newest posts — caption, likes, comments, timestamp, media URLs and video views — one clean dataset row per post. No browser, just fast public-API requests.",
        "version": "1.0",
        "x-build-id": "0rpsSXpDFOOwudty4"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/receptional_blender~instagram-recent-posts/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-receptional_blender-instagram-recent-posts",
                "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/receptional_blender~instagram-recent-posts/runs": {
            "post": {
                "operationId": "runs-sync-receptional_blender-instagram-recent-posts",
                "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/receptional_blender~instagram-recent-posts/run-sync": {
            "post": {
                "operationId": "run-sync-receptional_blender-instagram-recent-posts",
                "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": [
                    "usernames"
                ],
                "properties": {
                    "usernames": {
                        "title": "Instagram usernames",
                        "type": "array",
                        "description": "One or more Instagram handles (with or without @, or full profile URLs). For each, the actor returns the profile's most recent posts — one dataset row per post.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "maxPosts": {
                        "title": "Max posts per profile (optional)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of recent posts to return per username. Leave empty to return every post the endpoint provides (typically ~12)."
                    },
                    "sessionCookie": {
                        "title": "Instagram session cookie (optional)",
                        "type": "string",
                        "description": "Value of your Instagram 'sessionid' cookie. Optional, but it significantly increases success rates and unlocks profiles that are otherwise blocked."
                    },
                    "proxyCountry": {
                        "title": "Proxy country (optional)",
                        "type": "string",
                        "description": "Two-letter country code for the residential proxy (e.g. US, GB, DE). Best matched to the country of the session/account you use."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
