# Instagram Posts Scraper (`easyapi/instagram-posts-scraper`) Actor

Effortlessly scrape Instagram posts data from multiple users. Extract comprehensive details including likes, comments, captions, hashtags, and more. Perfect for social media analysis, market research, and content monitoring.

- **URL**: https://apify.com/easyapi/instagram-posts-scraper.md
- **Developed by:** [EasyApi](https://apify.com/easyapi) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 347 total users, 6 monthly users, 94.1% runs succeeded, 7 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Instagram Posts Scraper 📸

### 🚀 Effortlessly scrape Instagram posts data

This powerful Actor allows you to extract detailed information from Instagram posts of specified users. Perfect for social media analysis, market research, and content monitoring.

### 🌟 Key Features

- 📊 Scrape posts data from multiple Instagram users
- 🔍 Extract comprehensive post details including likes, comments, captions, and more
- 🎥 Support for both image and video posts
- 👥 Identify sponsored content and collaborations
- 🏷️ Capture hashtags and user mentions
- 📅 Retrieve post timestamps and engagement metrics

### 💡 Use Cases

- 📈 Analyze influencer performance and engagement rates
- 🎯 Monitor brand mentions and hashtag campaigns
- 🔬 Conduct competitor research and content strategy analysis
- 🗂️ Archive and backup Instagram content

### 🛠️ Input Configuration

- `usernames`: Array of Instagram usernames to scrape
- `maxItems`: Maximum number of posts to scrape per user (default: Infinity)

### 📦 Output Data

The Actor provides rich, structured data for each post, including:

- Post URL and unique identifier
- Image/video URLs and dimensions
- Caption text and hashtags
- Like and comment counts
- User details (username, full name, verification status)
- Sponsored post indicators
- Collaboration information
- And much more!

### 🚀 Getting Started

1. Input the desired Instagram usernames
2. Set the maximum number of posts to scrape (optional)
3. Run the Actor and watch the data flow in!

Start extracting valuable Instagram insights today with this versatile and efficient scraping tool! 🎉

#### Input Example

A full explanation of an input example in JSON.

```
{
	"usernames": [
        "ronaldo"
	],
    "maxItems": 30
}
```

#### Output sample

The results will be wrapped into a dataset which you can always find in the **Storage** tab. Here's an excerpt from the data you'd get if you apply the input parameters above:

And here is the same data but in JSON. You can choose in which format to download your data: JSON, JSONL, Excel spreadsheet, HTML table, CSV, or XML.

```
[
	{
		"username": "https://www.instagram.com/p/DA9cFJ7RaaB/",
		"id": "3476057986957682305_5749522",
		"shortcode": "DA9cFJ7RaaB",
		"dimensions": {
			"height": 612,
			"width": 612
		},
		"displayUrl": "https://scontent-ams4-1.cdninstagram.com/v/t39.30808-6/462693629_18459987010053523_1464027671490770740_n.jpg?stp=dst-jpg_e15_s480x480&_nc_ht=scontent-ams4-1.cdninstagram.com&_nc_cat=107&_nc_ohc=xbAzWmQ0WjMQ7kNvgHoyKDP&_nc_gid=aaaf02fd65f049d7a52a819b098ff7bf&edm=AP4sbd4AAAAA&ccb=7-5&ig_cache_key=MzQ3NjA1Nzk3OTU2NzM0MDQ2OA%3D%3D.3-ccb7-5&oh=00_AYDvIR_vhj0W0_Tro9ye9N2cyB86AZvc2A4H4Wr7e8MYvQ&oe=67199120&_nc_sid=7a9f4b",
		"isVideo": false,
		"caption": "Rafa, ¡eres un verdadero fenómeno, dentro y fuera de la cancha! Tus 22 Grand Slams y 14 Roland Garros no solo hablan de tu talento, sino de tu corazón, tu lucha incansable y el ejemplo que das al mundo. Verte triunfar siempre ha sido un orgullo, y llamarte amigo, un honor. ¡Gracias por todo lo que representas, monstruo!",
		"commentsCount": 1722,
		"commentsDisabled": null,
		"timestamp": "2024-10-10T22:13:44.000Z",
		"likeCount": 634418,
		"owner": {
			"id": "5749522",
			"username": "ronaldo",
			"fullName": "Ronaldo",
			"isPrivate": false,
			"isVerified": true,
			"profilePicUrl": "https://scontent-ams4-1.cdninstagram.com/v/t51.2885-19/106251038_1135435290168116_7192578999918897247_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-ams4-1.cdninstagram.com&_nc_cat=1&_nc_ohc=vk2G0advwSkQ7kNvgFO0Grp&_nc_gid=aaaf02fd65f049d7a52a819b098ff7bf&edm=AP4sbd4BAAAA&ccb=7-5&oh=00_AYDNkATntIiqtnO9v8FjufPdtsBmWiY8HyakXT6OTmkqSA&oe=67198BB8&_nc_sid=7a9f4b"
		},
		"location": null,
		"hashtags": [],
		"mentions": [],
		"isSponsored": false,
		"videoUrl": null,
		"videoViewCount": null,
		"productType": "carousel_container",
		"isPinned": false,
		"coauthorProducers": []
	},
	{
		"username": "https://www.instagram.com/p/DA88nQ8STg7/",
		"id": "3475919593464739899_50985923682",
		"shortcode": "DA88nQ8STg7",
		"dimensions": {
			"height": 854,
			"width": 480
		},
		"displayUrl": "https://scontent-ams4-1.cdninstagram.com/v/t51.29350-15/462518989_858137523100762_1734064302796437549_n.jpg?stp=dst-jpg_e15&efg=eyJ2ZW5jb2RlX3RhZyI6ImltYWdlX3VybGdlbi40ODB4ODU0LnNkci5mMjkzNTAuZGVmYXVsdF9jb3Zlcl9mcmFtZSJ9&_nc_ht=scontent-ams4-1.cdninstagram.com&_nc_cat=110&_nc_ohc=MHYYrHBJAPkQ7kNvgHxpKUC&_nc_gid=aaaf02fd65f049d7a52a819b098ff7bf&edm=AP4sbd4BAAAA&ccb=7-5&ig_cache_key=MzQ3NTkxOTU5MzQ2NDczOTg5OQ%3D%3D.3-ccb7-5&oh=00_AYBWJJIr6XVLGgRsf6k-6rNrAWWFEQ4kDhkH9z7gslB4Rw&oe=67199CC4&_nc_sid=7a9f4b",
		"isVideo": true,
		"caption": "Vem conferir tudo o que rolou no primeiro dia de @brasilgameshow com a Ronaldo TV 🎮⚽️🔥",
		"commentsCount": 56,
		"commentsDisabled": null,
		"timestamp": "2024-10-10T17:40:24.000Z",
		"likeCount": 5640,
		"owner": {
			"id": "50985923682",
			"username": "ronaldotv",
			"fullName": "⚽️🎮 RonaldoTV Oficial",
			"isPrivate": false,
			"isVerified": true,
			"profilePicUrl": "https://scontent-ams4-1.cdninstagram.com/v/t51.2885-19/463262219_1273071380488317_4498503303601413384_n.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-ams4-1.cdninstagram.com&_nc_cat=109&_nc_ohc=PiYZRTt4zHcQ7kNvgGY5_vj&_nc_gid=aaaf02fd65f049d7a52a819b098ff7bf&edm=AP4sbd4BAAAA&ccb=7-5&oh=00_AYDTAzVz0oOIVi-MfG8Eb8H1Ye_dESvfxc8wRykYzHcRGQ&oe=67197F31&_nc_sid=7a9f4b"
		},
		"location": null,
		"hashtags": [],
		"mentions": [
			"@brasilgameshow"
		],
		"isSponsored": false,
		"videoUrl": "https://scontent-ams4-1.cdninstagram.com/o1/v/t16/f1/m86/2E4E85CD8EAC795BEDBF7A2F4FB6BEA5_video_dashinit.mp4?efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5JTlNUQUdSQU0uQ0xJUFMuQzMuNDgwLmRhc2hfYmFzZWxpbmVfMV92MSJ9&_nc_ht=scontent-ams4-1.cdninstagram.com&_nc_cat=105&vs=6c68e46a861fe260&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC8yRTRFODVDRDhFQUM3OTVCRURCRjdBMkY0RkI2QkVBNV92aWRlb19kYXNoaW5pdC5tcDQVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dPWVBqeHVVWXBDd3FSNERBTlVyNVZ6YzhUUXpicV9FQUFBRhUCAsgBACgAGAAbAogHdXNlX29pbAExEnByb2dyZXNzaXZlX3JlY2lwZQExFQAAJoLj5c-hxOMBFQIoAkMzLBdAS0AAAAAAABgSZGFzaF9iYXNlbGluZV8xX3YxEQB1_gcA&ccb=9-4&oh=00_AYCLIYwwgX5SijETq8Bf0Yn2R64RopcF7v0t1EdvbqSCuw&oe=6715984D&_nc_sid=1d576d",
		"videoViewCount": null,
		"productType": "clips",
		"isPinned": false,
		"coauthorProducers": [
			{
				"id": "5749522",
				"username": "ronaldo",
				"fullName": "Ronaldo",
				"isVerified": true
			}
		]
	},
    ...
]
```

### Related Actors

- 📸 [Instagram Profile Scraper](https://apify.com/easyapi/instagram-profile-scraper) - Extract comprehensive Instagram profile data including follower counts, bios, and post stats.
- 📸 [Instagram Comments Scraper](https://apify.com/easyapi/instagram-comments-scraper) - Effortlessly extract comments from Instagram posts with user details and engagement metrics.
- 📸 [Instagram Reels Scraper](https://apify.com/easyapi/instagram-reels-scraper) - Scrape Instagram Reels data from user profiles with comprehensive metadata.
- 📸 [Instagram Tagged Posts Scraper](https://apify.com/easyapi/instagram-tagged-posts-scraper) - Extract tagged posts from Instagram profiles with detailed post data.
- 📸 [Instagram Videos Downloader](https://apify.com/easyapi/instagram-videos-downloader) - Download videos from Instagram posts, reels, and stories in high quality.
- 📸 [Instagram Photos Downloader](https://apify.com/easyapi/instagram-photos-downloader) - Save high-quality images from Instagram posts effortlessly.
- 📸 [Instagram Story Downloader](https://apify.com/easyapi/instagram-story-downloader) - Download Instagram stories with photos and videos in original quality.
- 📸 [Instagram Reels Downloader](https://apify.com/easyapi/instagram-reels-downloader) - Download Instagram Reels videos in bulk with high quality.
- 📧 [Instagram Email Scraper](https://apify.com/easyapi/instagram-email-scraper) - Find Instagram users matching your keywords and extract their email addresses.
- 🔍 [Social Media Influencer Scraper](https://apify.com/easyapi/social-media-influencer-scraper) - Discover top influencers across TikTok, Instagram, and YouTube.
- 📱 [All-in-One Media Downloader](https://apify.com/easyapi/all-in-one-media-downloader) - Download videos and images from various platforms including Instagram.
- 📧 [All-in-One Social Media Email Scraper](https://apify.com/easyapi/all-in-one-social-media-email-scraper) - Extract email addresses from 30+ social platforms including Instagram.
- 📱 [All-in-One Social Media Phone Number Scraper](https://apify.com/easyapi/all-in-one-social-media-phone-number-scraper) - Discover phone numbers across 30+ social platforms including Instagram.
- 🏷️ [Social Media Hashtag Generator](https://apify.com/easyapi/social-media-hashtag-generator) - Generate trending hashtags for multiple social media platforms including Instagram.
- 🔍 [Keyword Discovery Tool](https://apify.com/easyapi/keyword-discovery-tool) - Discover new keyword ideas and search insights for social media optimization.

# Actor input Schema

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

List of Instagram usernames to scrape posts from

## `maxItems` (type: `integer`):

Maximum number of posts to scrape per user (default: Infinity)

## `dateFrom` (type: `string`):

Start date-time for filtering posts (ISO 8601 format, eg. 2024-01-01T08:00:00Z).

## `dateTo` (type: `string`):

End date-time for filtering posts (ISO 8601 format, eg. 2024-05-05T18:00:00Z).

## `skipPinnedPosts` (type: `boolean`):

Whether to skip pinned posts in the results.

## Actor input object example

```json
{
  "usernames": [
    "ronaldo"
  ],
  "maxItems": 30,
  "skipPinnedPosts": false
}
```

# 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("easyapi/instagram-posts-scraper").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("easyapi/instagram-posts-scraper").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 easyapi/instagram-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/fbA6MR81COZzol0gD/builds/zPAFexQm5zgAVke7G/openapi.json
