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

Easily scrape public Instagram posts with Instagram Posts Scraper! Extract data for market research, sentiment analysis, and more. Download in formats like CSV, JSON, and Excel. Ideal for gaining valuable insights and enhancing your marketing strategy. 📸🚀

- **URL**: https://apify.com/powerful_bachelor/instagram-posts-scraper.md
- **Developed by:** [Powerful Bachelor](https://apify.com/powerful_bachelor) (community)
- **Categories:** Social media
- **Stats:** 143 total users, 1 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: 1.00 out of 5 stars

## Pricing

from $1.75 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Scraper

[![Actor status](https://apify.com/actor-badge?actor=powerful_bachelor/Instagram-Posts-Scraper)](https://apify.com/powerful_bachelor/Instagram-Posts-Scraper)

Instagram Posts Scraper allows you to scrape public posts from any Instagram user. Just enter one or more Instagram usernames and you can extract and download all their posts in Excel, HTML, XML, CSV, or JSON to use in reports, data visualizations, spreadsheets, and other applications.

### 🤔 Why scrape Instagram posts?

Instagram post data can provide valuable insights for:

- 📊 Improving market research
- 🎯 Optimizing your marketing and PR
- 💬 Conducting sentiment analysis
- 📈 Understanding audience engagement
- 🤖 Training your AI models
- 📰 Monitoring fake news

### 🚀 Main Features

Instagram Posts Scraper is packed with powerful features to help you extract valuable Instagram Posts data:

- **Post Caption**: Extract detailed captions from each post.
- **Video URL**: Retrieve URLs for any video content included in the posts.
- **Comments Count**: Get the number of comments for each post.
- **Like Count**: See how many likes each post has received.
- **Video View Count**: View count metrics for video posts.
- **Post Date**: The date when the post was published.
- **Is Paid Partnership**: Identify posts that are part of paid partnerships, essential for marketers to analyze sponsored content.
- **Is Affiliate**: Determine if posts are affiliated, helping marketers track and evaluate affiliate marketing efforts.

### 🛠️ How to scrape Instagram posts

Instagram Posts Scraper is designed to be fast and easy to use, with minimal parameters or settings. Just follow these steps:

1. 🔑 Create a free Apify account.
2. 🔍 Open Instagram Posts Scraper.
3. ✏️ Add one or more Instagram usernames to scrape.
4. 🚀 Click "Save & Start" and wait for the datasets to be extracted.
5. 💾 Download your data in JSON, XML, CSV, Excel, or HTML.

### 📈 How many results can you scrape with Instagram Posts Scraper?

Instagram Posts Scraper can return thousands of results on average, depending on the number of posts available and other factors. The best way to know for sure for your particular use case is to run a test scrape.

### ⚖️ Is it legal to scrape personal data?

Our Instagram scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. However, be aware that your results could contain personal data protected by regulations like GDPR. Do not scrape personal data unless you have a legitimate reason.

### 📝 Input parameters

There are just two fields to fill out: an Instagram username (one or multiple) and the number of results you'd like to receive.

#### Example input:

```json
{
  "usernames": ["google"],
  "maxResults": 15
}
```

### Output example

Each item will be a separate entry in the dataset. You can view the extracted data as an overview table or see all fields in different formats. Export them from the platform onto your computer or integrate with other apps directly.

```json
{
"user_id": "1067259270",
"post_id": "3368012288618763443",
"short_code": "C69lVT-RZSz",
"typename": "GraphImage",
"is_paid_partnership": false,
"is_affiliate": false,
"likes_count": 15951,
"comment_count": 1331,
"video_view_count": 0,
"post_date": "2024-05-14T20:26:13.000Z",
"is_video": false,
"has_audio": false,
"display_url": "https://scontent-atl3-2.cdninstagram.com/v/t51.29350-15/436566132_754771200111026_8495874532985308359_n.jpg?stp=dst-jpg_e15_fr_p1080x1080&_nc_ht=scontent-atl3-2.cdninstagram.com&_nc_cat=102&_nc_ohc=L5bFcJ1i1GgQ7kNvgFHK8b6&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_AYBfg7a3T1pStIL1VLydHFBLkNvsb0IK--TJKw8-kz6QPQ&oe=666A07DF&_nc_sid=8b3546",
"thumbnail_src": "https://scontent-atl3-2.cdninstagram.com/v/t51.29350-15/436566132_754771200111026_8495874532985308359_n.jpg?stp=c0.135.1080.1080a_dst-jpg_e35_s640x640_sh0.08&_nc_ht=scontent-atl3-2.cdninstagram.com&_nc_cat=102&_nc_ohc=L5bFcJ1i1GgQ7kNvgFHK8b6&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_AYCYPScRasYUiub0dd1qkAXjgVX2dVgCwtgo3bco5-Sh2w&oe=666A07DF&_nc_sid=8b3546",
"accessibility_caption": "A photo of Sundar Pichai on the I/O main stage at Shoreline. Text underneath says \"Google I/O 2024: An I/O for a new generation #GoogleIO.\"",
"caption": "“We’ve been AI-first in our approach for a long time. Our decades of research leadership have pioneered many of the modern breakthroughs that power AI progress, for us and for the industry. On top of that we have:\n\nWorld-leading infrastructure built for the AI era \nCutting-edge innovation in Search, now powered by Gemini\nProducts that help at extraordinary scale — including 15 products with half a billion users\nAnd platforms that enable everyone — partners, customers, creators — and all of you — to invent the future. \n\nThis progress is only possible because of our incredible developer community. You are making it real, through the experiences and applications you build every day. So, to everyone here in Shoreline and the millions more watching around the world, here’s to the possibilities ahead and creating them together.” - @sundarpichai\n\nRead Sundar’s remarks from #GoogleIO at the link in bio.",
"video_url": "",
"audio_info": {},
"child_posts": null,
"owner": {
"id": "1067259270",
"username": "google"
},
"coauthor_producer": [],
"tagged_users": [
{
"node": {
"user": {
"full_name": "Sundar Pichai",
"followed_by_viewer": false,
"id": "857021616",
"is_verified": true,
"profile_pic_url": "https://scontent-atl3-1.cdninstagram.com/v/t51.2885-19/18444526_1939440572957195_3903952120457461760_a.jpg?stp=dst-jpg_s150x150&_nc_ht=scontent-atl3-1.cdninstagram.com&_nc_cat=1&_nc_ohc=Oueqvp2Rtl0Q7kNvgHVMQzd&edm=AOQ1c0wBAAAA&ccb=7-5&oh=00_AYAXMafZQzoSkEg-hWYs9NTyoDInuAnTD-u06dRQliFXNw&oe=666A14F9&_nc_sid=8b3546",
"username": "sundarpichai"
},
"x": 0.7412868633,
"y": 0.44325481800000005
}
}
]
}...
```

### 🚀 Transform Your Data Insights

Instagram Posts Scraper is a powerful tool for extracting valuable Instagram posts data. Whether you need insights for market research, sentiment analysis, or audience engagement, this scraper provides a straightforward and efficient solution. If you have any feedback or encounter any issues, please reach out through the Actor’s Issues tab in Apify Console. Happy scraping!🎉

# Actor input Schema

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

Enter the Instagram usernames of the accounts you want to scrape.

## `maxResults` (type: `integer`):

Specify the maximum number of posts to scrape from each username. If not specified, the default is 15 posts..

## Actor input object example

```json
{
  "usernames": [
    "google"
  ],
  "maxResults": 15
}
```

# Actor output Schema

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

No description

# 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": [
        "google"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerful_bachelor/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 = { "usernames": ["google"] }

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

```

## MCP server setup

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

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/n30rzBrx9hXEuLSae/builds/21ELDWPWw3uvsEBkx/openapi.json
