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

The Instagram Post Scraper extracts detailed data from any valid post URL, including content, engagement metrics, user details, and media. It delivers structured output for social media analysis, monitoring, and research.

- **URL**: https://apify.com/pratikdani/instagram-posts-scraper.md
- **Developed by:** [Pratik Dani](https://apify.com/pratikdani) (community)
- **Categories:** Social media, Developer tools, Automation
- **Stats:** 730 total users, 16 monthly users, 27.1% runs succeeded, 24 bookmarks
- **User rating**: 2.00 out of 5 stars

## Pricing

from $2.00 / 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/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 Post Scraper

### Overview

The Instagram Post Scraper Actor is a powerful tool designed to extract comprehensive data from Instagram posts. It retrieves detailed information including post content, engagement metrics, user details, and media content from any valid Instagram post URL. This actor provides structured data output that can be used for social media analysis, monitoring, and research purposes.
Interested in using this scraper? Get it here: [Instagram Profile Scraper](https://apify.com/pratikdani/instagram-posts-scraper).

### Features

- Extracts complete post metadata and content details
- Retrieves engagement metrics (likes, comments, views)
- Captures media content URLs (photos and videos)
- Collects user profile information
- Gathers hashtags and tagged users
- Provides audio details for Reels
- Includes comment data with replies
- Supports both regular posts and Reels

### Output Fields

| Field Name | Type | Description |
|------------|------|-------------|
| url | String | The original Instagram post URL |
| user\_posted | String | Username of the post author |
| description | String | Full text content of the post |
| hashtags | Array\[String] | List of hashtags used in the post |
| num\_comments | Number | Total number of comments on the post |
| date\_posted | String | ISO timestamp of when the post was published |
| likes | Number | Number of likes received on the post |
| photos | Array\[String] | URLs of photos in the post |
| videos | Array\[String] | URLs of videos in the post |
| location | Object | Location information (if available) |
| latest\_comments | Array\[Object] | Recent comments with replies and engagement data |
| post\_id | String | Unique identifier for the post |
| content\_type | String | Type of post (e.g., "Reel", "Post") |
| video\_view\_count | String | Number of video views (for video content) |
| video\_play\_count | Number | Number of times the video was played |
| followers | Number | Follower count of the post author |
| posts\_count | Number | Total number of posts by the author |
| profile\_image\_link | String | URL of the author's profile picture |
| is\_verified | Boolean | Verification status of the author |
| is\_paid\_partnership | Boolean | Indicates if the post is a paid partnership |
| audio | Object | Audio details for Reels content |
| profile\_url | String | URL to the author's Instagram profile |

### Possible Usage

- Social media monitoring and analytics
- Influencer marketing research
- Content engagement analysis
- Competitor analysis
- Social media trend tracking
- Marketing campaign performance measurement
- User-generated content collection
- Hashtag performance analysis
- Audience engagement studies
- Content archiving and documentation

### Example Output

```json
{
    "url": "https://www.instagram.com/p/DEnrkoisS37/?__a=1&__d=dis&hl=en",
    "user_posted": "driziinha",
    "description": "Trabalhar por turnos faz com que os meus dias sejam sempre diferentes, mas aquela rotina boa quando chego a casa e que me ajuda a desligar do trabalho é (quase) sempre a mesma: tirar sapatos, tirar soutien, tirar make up* e, mais recentemente, pousar o telemóvel até, pelo menos, os miúdos irem para a cama. \n\n*desmaquilhante Take The Day Off Balm + Moisture Surge Overnight Mask da @cliniqueportugal deixam a pele um sonho, mega hidratada e cada embalagem dura imenso. Para quem já adora o hidrante Moisture Surge, imaginem a versão máscara de noite... 🤤 #cliniquewomen pub",
    "hashtags": [
      "#cliniquewomen"
    ],
    "num_comments": 25,
    "date_posted": "2025-01-09T21:33:29.000Z",
    "likes": 508,
    "photos": [
      "https://instagram.ftnr4-2.fna.fbcdn.net/v/t51.2885-15/472454364_18485451343003661_8301411466355177501_n.jpg?stp=dst-jpg_e35_p1080x1080_sh0.08_tt6&_nc_ht=instagram.ftnr4-2.fna.fbcdn.net&_nc_cat=105&_nc_ohc=JHJlPr0NAbgQ7kNvgHclbkY&_nc_gid=db5007280a72435cb6a7317237865270&edm=AABBvjUBAAAA&ccb=7-5&oh=00_AYDYyF-y-m6hw5IT8WY-dYjXbeFP4khX2E46aodRKguDdQ&oe=678F99EE&_nc_sid=4f4799"
    ],
    "videos": [
      "https://instagram.ftnr4-2.fna.fbcdn.net/o1/v/t16/f2/m86/AQPRRGyTB74Jmf9VXuLyHat7KkRM9VM_5QTHu2Axz5QjxT4av8_tjRSiBgQFMYRlpSqcKfMkHPXJ-RUl3OTtgBJp5IJAIDrH4h3goGI.mp4?stp=dst-mp4&efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2xpcHMuYzIuNzIwLmJhc2VsaW5lIn0&_nc_cat=104&vs=914725777449258_843979142&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9GODQwMjczRDlEMzg3OTY0Q0NEMTlGMzJEMUFCMjI4Ml92aWRlb19kYXNoaW5pdC5tcDQVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dPVjNJeHo4NVBnVUNXUURBSTBwQWRoUUg0SVFicV9FQUFBRhUCAsgBACgAGAAbABUAACaSrqeXx8qRQBUCKAJDMywXQDPP3ztkWh0YEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=db500829eb&ccb=9-4&oh=00_AYAdeouzzb2aN0jp5MrIdA-T8tLD6t-bY3psNQHpR-8amQ&oe=678BCAAA&_nc_sid=4f4799"
    ],
    "location": null,
    "latest_comments": [
      {
        "comments": "😍😍",
        "likes": 1,
        "replies": [
          {
            "comments": "@a.risca.concept ❤️",
            "likes": 0,
            "user_commenting": "driziinha"
          }
        ],
        "user_commenting": "a.risca.concept"
      },
      {
        "comments": "❤️❤️❤️❤️❤️",
        "likes": 1,
        "replies": [
          {
            "comments": "@maria.godinho.56 ❤️",
            "likes": 0,
            "user_commenting": "driziinha"
          }
        ],
        "user_commenting": "maria.godinho.56"
      },
      {
        "comments": "😍😍😍",
        "likes": 1,
        "replies": [
          {
            "comments": "@nene_i.j.a.m ❤️",
            "likes": 0,
            "user_commenting": "driziinha"
          }
        ],
        "user_commenting": "nene_i.j.a.m"
      },
      {
        "comments": "Parabéns Andreia. Que seja um dia bem feliz. ❤️",
        "likes": 1,
        "replies": [
          {
            "comments": "@mlle.rosinha obrigadaaaa, um grande beijinho ❤️",
            "likes": 1,
            "user_commenting": "driziinha"
          }
        ],
        "user_commenting": "mlle.rosinha"
      },
      {
        "comments": "❤️😍",
        "likes": 1,
        "replies": [
          {
            "comments": "@chvnge ❤️",
            "likes": 0,
            "user_commenting": "driziinha"
          }
        ],
        "user_commenting": "chvnge"
      }
    ],
    "post_id": "3541991265383034363",
    "discovery_input": null,
    "has_handshake": null,
    "display_url": "https://www.instagram.com/p/DEnrkoisS37/?__a=1&__d=dis&hl=en/media/?size=l",
    "shortcode": "DEnrkoisS37",
    "content_type": "Reel",
    "pk": "3541991265383034363",
    "content_id": "DEnrkoisS37",
    "engagement_score_view": 16384,
    "thumbnail": "https://instagram.ftnr4-2.fna.fbcdn.net/v/t51.2885-15/472454364_18485451343003661_8301411466355177501_n.jpg?stp=c0.459.1178.1178a_dst-jpg_e35_s640x640_sh0.08_tt6&_nc_ht=instagram.ftnr4-2.fna.fbcdn.net&_nc_cat=105&_nc_ohc=JHJlPr0NAbgQ7kNvgHclbkY&_nc_gid=db5007280a72435cb6a7317237865270&edm=AABBvjUBAAAA&ccb=7-5&oh=00_AYBA77GJDo2aq0H8iTE-aXlaXmOSqgW3zx-oPvvLjIqeLQ&oe=678F99EE&_nc_sid=4f4799",
    "video_view_count": "16384",
    "product_type": "clips",
    "coauthor_producers": null,
    "tagged_users": [
      {
        "full_name": "Clinique Portugal Market",
        "id": "1218941374",
        "is_verified": true,
        "profile_pic_url": "https://instagram.ftnr4-2.fna.fbcdn.net/v/t51.2885-19/275466473_1144882346334894_1753971632245538969_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=instagram.ftnr4-2.fna.fbcdn.net&_nc_cat=106&_nc_ohc=oz_f34nfTPQQ7kNvgEerpn_&_nc_gid=db5007280a72435cb6a7317237865270&edm=AABBvjUBAAAA&ccb=7-5&oh=00_AYDcBJt_xdPdiTb4wr8wiyBJpLooqkbFXxzXT6Gnodx-UA&oe=678FC23C&_nc_sid=4f4799",
        "username": "cliniqueportugal"
      }
    ],
    "video_play_count": 44299,
    "followers": 57876,
    "posts_count": 3852,
    "profile_image_link": "https://instagram.ftnr4-2.fna.fbcdn.net/v/t51.2885-19/336494325_718773926652151_3081931411584012305_n.jpg?stp=dst-jpg_s150x150_tt6&_nc_ht=instagram.ftnr4-2.fna.fbcdn.net&_nc_cat=107&_nc_ohc=m8SkA1rWjGgQ7kNvgEfq6rV&_nc_gid=db5007280a72435cb6a7317237865270&edm=AABBvjUBAAAA&ccb=7-5&oh=00_AYD1uUPVbxEJds3UTOPZUWgmULGAlFjiKHOAFVuILhq8VA&oe=678F9A6B&_nc_sid=4f4799",
    "is_verified": true,
    "is_paid_partnership": false,
    "partnership_details": {
      "profile_id": null,
      "profile_url": null,
      "username": null
    },
    "user_posted_id": "185219660",
    "post_content": [
      {
        "index": 0,
        "type": "Video",
        "url": "https://instagram.ftnr4-2.fna.fbcdn.net/o1/v/t16/f2/m86/AQPRRGyTB74Jmf9VXuLyHat7KkRM9VM_5QTHu2Axz5QjxT4av8_tjRSiBgQFMYRlpSqcKfMkHPXJ-RUl3OTtgBJp5IJAIDrH4h3goGI.mp4?stp=dst-mp4&efg=eyJxZV9ncm91cHMiOiJbXCJpZ193ZWJfZGVsaXZlcnlfdnRzX290ZlwiXSIsInZlbmNvZGVfdGFnIjoidnRzX3ZvZF91cmxnZW4uY2xpcHMuYzIuNzIwLmJhc2VsaW5lIn0&_nc_cat=104&vs=914725777449258_843979142&_nc_vs=HBksFQIYUmlnX3hwdl9yZWVsc19wZXJtYW5lbnRfc3JfcHJvZC9GODQwMjczRDlEMzg3OTY0Q0NEMTlGMzJEMUFCMjI4Ml92aWRlb19kYXNoaW5pdC5tcDQVAALIAQAVAhg6cGFzc3Rocm91Z2hfZXZlcnN0b3JlL0dPVjNJeHo4NVBnVUNXUURBSTBwQWRoUUg0SVFicV9FQUFBRhUCAsgBACgAGAAbABUAACaSrqeXx8qRQBUCKAJDMywXQDPP3ztkWh0YEmRhc2hfYmFzZWxpbmVfMV92MREAdf4HAA%3D%3D&_nc_rid=db500829eb&ccb=9-4&oh=00_AYAdeouzzb2aN0jp5MrIdA-T8tLD6t-bY3psNQHpR-8amQ&oe=678BCAAA&_nc_sid=4f4799"
      }
    ],
    "audio": {
      "audio_asset_id": "1424564281572156",
      "ig_artist_id": "maro.musica",
      "ig_artist_username": "maro.musica",
      "original_audio_title": "MARO - BIRDS OF A FEATHER (cover)"
    },
    "profile_url": "https://www.instagram.com/driziinha"
  }
```

# Actor input Schema

## `url` (type: `array`):

URL of the Instagram Post

## Actor input object example

```json
{
  "url": [
    "https://www.instagram.com/reel/C5Rdyj_q7YN/"
  ]
}
```

# 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 = {
    "url": [
        "https://www.instagram.com/reel/C5Rdyj_q7YN/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("pratikdani/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 = { "url": ["https://www.instagram.com/reel/C5Rdyj_q7YN/"] }

# Run the Actor and wait for it to finish
run = client.actor("pratikdani/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 '{
  "url": [
    "https://www.instagram.com/reel/C5Rdyj_q7YN/"
  ]
}' |
apify call pratikdani/instagram-posts-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

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