# Instagram Post Caption & Description Scraper (`instagramapi/instagram-post-caption-description-scraper`) Actor

Extract clean Instagram post captions, descriptions, hashtags, and metadata instantly via post URLs. Fully optimized for data analysis, content research, AI agents, and MCP integrations with structured, zero-friction JSON output.

- **URL**: https://apify.com/instagramapi/instagram-post-caption-description-scraper.md
- **Developed by:** [InstagramApi](https://apify.com/instagramapi) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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.

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 Post Scraper: Extract Captions, Hashtags, Mentions & Likes 📝

Extract captions, hashtags, mentions, likes, comments and timestamps from any public Instagram post URL. Paste a list of post links and get clean, structured JSON back. No profile crawling, no login, no heavy feeds. Built for content marketers, researchers, developers and AI agents that need fast Instagram post metadata.

**Best for:** caption extraction, hashtag research, engagement tracking, competitor content analysis, and feeding Instagram post data into LLMs, RAG pipelines and AI agents.

### 🚀 What does Instagram Post Scraper do?

This micro-actor takes a list of Instagram post URLs and returns only the essential text and engagement data for each post:

- **Captions & descriptions:** clean text with emojis and line breaks preserved.
- **Hashtags & mentions:** parsed into separate arrays, ready for analysis.
- **Engagement stats:** likes count and comments count.
- **Post metadata:** owner username, timestamp, shortcode and media type.

### 💡 Why use this Instagram caption scraper?

- **Laser-focused:** does one job, post-level text extraction, instead of bundling profile, reel and story scrapers into one slow, expensive tool.
- **Fast and cheap:** scraping direct post URLs is lighter than crawling whole accounts, so runs finish quickly and cost less.
- **Reliable:** direct URL scraping triggers fewer rate limits and blocks than broad account crawlers.
- **Structured output:** consistent JSON fields, exportable to CSV, Excel, XML or HTML from the Apify dataset.
- **AI agent and MCP ready:** predictable input and output schemas that Claude, LangChain and other agents can call without manual setup.

### 📥 Input

| Field | Type | Required | Description |
|---|---|---|---|
| `postUrls` | array of strings | Yes | Public Instagram post URLs, for example `https://www.instagram.com/p/DZxvMgyH8yR/` |

#### Input example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/DZxvMgyH8yR/"
  ]
}
```

### 📤 Output

Each post URL returns one JSON object.

| Field | Type | Description |
|---|---|---|
| `url` | string | The Instagram post URL you submitted |
| `shortcode` | string | Unique post ID from the URL |
| `ownerUsername` | string | Username of the account that posted |
| `caption` | string | Full caption text |
| `hashtags` | array | Hashtags found in the caption, without the `#` symbol |
| `mentions` | array | Accounts tagged or mentioned in the caption |
| `likesCount` | number | Number of likes |
| `commentsCount` | number | Number of comments |
| `mediaType` | string | Post type, such as image, video or carousel |
| `timestamp` | string | Publish time in ISO 8601 format (UTC) |

#### Output example

```json
[
  {
    "url": "https://www.instagram.com/p/DZxvMgyH8yR/",
    "shortcode": "DZxvMgyH8yR",
    "ownerUsername": "shayagrams",
    "caption": "Warli has always told big stories with the simplest shapes. Now your ring does too. 💚\n\n#ShayaByCaratLane #WarliKala",
    "hashtags": ["ShayaByCaratLane", "WarliKala", "Shaya", "Warli"],
    "mentions": [],
    "likesCount": 151,
    "commentsCount": 1,
    "mediaType": "image",
    "timestamp": "2026-10-13T12:44:01.000Z"
  }
]
```

### 🛠 How to scrape Instagram captions and hashtags

1. Open the Actor on Apify and click **Try for free**.
2. Paste your Instagram post URLs into the `postUrls` field.
3. Click **Start** and wait for the run to finish.
4. Download results as JSON, CSV, Excel, XML or HTML from the **Output** tab.

### 🤖 AI agent and MCP integration

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI assistants and agents can find and run it autonomously.

**Actor ID:** `YOUR_USERNAME/YOUR_ACTOR_SLUG`

**Connect via MCP (remote server URL):**

```
https://mcp.apify.com?actors=YOUR_USERNAME/YOUR_ACTOR_SLUG
```

**Example Claude Desktop config:**

```json
{
  "mcpServers": {
    "apify-instagram-post-scraper": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.apify.com/?actors=YOUR_USERNAME/YOUR_ACTOR_SLUG",
        "--header",
        "Authorization: Bearer YOUR_APIFY_API_TOKEN"
      ]
    }
  }
}
```

**Example agent prompt:** "Get the caption, hashtags and like count for this Instagram post: https://www.instagram.com/p/DZxvMgyH8yR/"

The input and output schemas above are stable and fully typed, so agents can call the Actor without manual configuration.

### 💻 Run it with the Apify API

**Python**

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_API_TOKEN")

run = client.actor("YOUR_USERNAME/YOUR_ACTOR_SLUG").call(
    run_input={"postUrls": ["https://www.instagram.com/p/DZxvMgyH8yR/"]}
)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["caption"], item["hashtags"])
```

**JavaScript**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_API_TOKEN' });

const run = await client.actor('YOUR_USERNAME/YOUR_ACTOR_SLUG').call({
  postUrls: ['https://www.instagram.com/p/DZxvMgyH8yR/'],
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### 🎯 Use cases

- **Content marketing:** study the captions and hashtags that work for competitors and creators in your niche.
- **Hashtag research:** collect hashtag sets from top-performing posts.
- **Social listening and research:** analyze post text and engagement at scale.
- **AI and LLM pipelines:** feed clean Instagram text into RAG, sentiment analysis or summarization workflows.
- **Influencer vetting:** check caption style and engagement on specific sponsored posts.

### 💰 Pricing

\[PRICE] Check the **Pricing** tab on this Actor's page for the current rates.

### ❓ FAQ

**How do I scrape Instagram captions?**
Paste Instagram post URLs into the `postUrls` input field and run the Actor. Each post returns its caption as clean text in the output dataset.

**Can I extract hashtags from an Instagram post?**
Yes. Hashtags are parsed into a separate `hashtags` array for every post, without the `#` symbol.

**Can I get likes and comments counts?**
Yes. Each result includes `likesCount` and `commentsCount`.

**Does it scrape comments, profiles or reels?**
No. This Actor extracts post-level text and engagement data only. It does not download comment threads or crawl profiles.

**Are private posts supported?**
No. Posts must be public and reachable through a valid URL.

**Do I need proxies or cookies?**
No. The Actor handles proxy rotation and request formatting automatically.

**What export formats are available?**
JSON, CSV, Excel, XML and HTML, plus access through the Apify API.

**Is it legal to scrape Instagram?**
This Actor only collects publicly available data. Laws and platform terms vary by country and use case, so you are responsible for using the data in line with applicable laws, Instagram's terms and privacy rules such as GDPR. This is not legal advice.

**Can AI agents use this Actor?**
Yes. It works through the Apify MCP server (`mcp.apify.com`) and the Apify API with fixed input and output schemas.

### 🛠 Support and feedback

Found a bug or need a new field? Open an issue on the Actor's **Issues** tab in Apify Console, and we'll respond as soon as we can.

### ⚖️ Disclaimer

This Actor is not affiliated with, endorsed by or sponsored by Instagram or Meta. Instagram is a trademark of Meta Platforms, Inc. Only scrape publicly available data and respect people's privacy.

# Actor input Schema

## `postUrls` (type: `array`):

Provide one or more Instagram post URLs to extract captions and descriptions.

## Actor input object example

```json
{
  "postUrls": [
    "https://www.instagram.com/p/Dd3c_LJxVUj/?xtok=MzRlODBiNWFlZA==&srtk=MzRlODBiNWFlZA=="
  ]
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("instagramapi/instagram-post-caption-description-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("instagramapi/instagram-post-caption-description-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 '{}' |
apify call instagramapi/instagram-post-caption-description-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,instagramapi/instagram-post-caption-description-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/nAd3wRqYK8FcdXZIf/builds/tGnKEr7lFLl4vSNZS/openapi.json
