# Instagram Scraper Ultimate (`qaseemiqbal/instagram-scraper-ultimate`) Actor

Scrape public Instagram profiles, posts, Reels, hashtags, places, comments, and media links. Export clean data for research, monitoring, and analysis.

- **URL**: https://apify.com/qaseemiqbal/instagram-scraper-ultimate.md
- **Developed by:** [Muhammad Qaseem Iqbal](https://apify.com/qaseemiqbal) (community)
- **Categories:** Social media, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.md):

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

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

Extract clean, ready-to-use data from public Instagram pages in minutes. 🚀

Instagram Scraper Ultimate helps you collect public Instagram profiles, posts, Reels, hashtags, places, comments, media links, and search results for market research, social listening, influencer discovery, campaign tracking, lead research, and trend monitoring. 📊🔎

You do not need an Instagram login for the default setup. The Actor is built for public data only. It does not unlock private profiles, bypass access controls, or collect hidden account data. 🔐✅

### What does this Actor do? 🌟

Give the Actor Instagram usernames, post URLs, Reel URLs, hashtag URLs, place URLs, or a search term. It visits the public pages, extracts the information Instagram makes visible, and saves the results in an Apify dataset you can download as JSON, CSV, Excel, XML, RSS, or HTML. 📁⬇️

Use it when you want a simple way to turn public Instagram pages into organized data instead of manually copying posts, captions, likes, comments, profile details, and links one by one. 🧹✨

### What can you scrape? ✅

| Data type | What you can get |
| --- | --- |
| 👤 Profiles | Username, full name, biography when visible, profile URL, follower counts, following counts, post counts, verification status, privacy status, category, and related profile details |
| 📷 Posts | Post URL, shortcode, caption, hashtags, mentions, post type, owner username, timestamp, likes, comments count, views when available, and media URLs |
| 🎬 Reels | Reel URL, shortcode, caption, owner, media type, engagement metrics when available, and media URLs |
| #️⃣ Hashtags | Hashtag name, hashtag URL, visible post counts, and hashtag-related post results |
| 📍 Places | Place name, place ID, place URL, location metadata when available, and place-related post results |
| 💬 Comments | Public comments, comment owner usernames, timestamps, likes, replies when exposed, and parent comment IDs |
| 🔎 Search results | Public profile, hashtag, and place search results from your query |
| 🖼️ Media | Public image, thumbnail, and video URLs, with optional download into the Apify key-value store |
| ⚠️ Errors | Clear error records when a target cannot be processed |

### Why scrape Instagram? 💡

Public Instagram data can help you understand what people, brands, creators, and communities are talking about. 🌍

Common use cases include:

- 📈 Track hashtag trends and see which topics are gaining attention.
- 🧲 Find influencers, creators, and brand partners in a niche.
- 🛍️ Monitor product launches, campaigns, and customer reactions.
- 💬 Analyze public comments for brand sentiment and feedback.
- 📍 Research activity around places, venues, cities, stores, or events.
- 🧪 Build datasets for academic, market, or competitor research.
- 🔔 Run scheduled monitoring jobs and spot changes over time.
- 📊 Export public Instagram data to spreadsheets, dashboards, CRMs, or BI tools.

### How to use Instagram Scraper Ultimate 🏁

1. Open the Actor in Apify Console. 🎛️
2. Choose what you want to collect in **Operation**. 🧭
3. Add usernames, URLs, hashtags, place IDs, or a search query. ✍️
4. Set your result limit. For a cheap test, start small, such as 10 results. 💸
5. Keep comments and media downloads turned off unless you need them. ⚙️
6. Click **Start**. ▶️
7. Download your results from the **Dataset** tab. 📥

That is it. No coding is required. 🙌

### Quick input examples 🧪

#### Scrape public profile posts 👤📷

```json
{
  "operation": "profilePosts",
  "usernames": ["humansofny", "natgeo"],
  "maxItemsPerTarget": 10,
  "includeProfileDetails": true
}
````

#### Scrape one public post 📷

```json
{
  "operation": "postDetails",
  "postUrls": ["https://www.instagram.com/p/C3TTthZLoQK/"],
  "includeComments": false,
  "downloadMedia": false
}
```

#### Scrape public Reels 🎬

```json
{
  "operation": "profileReels",
  "usernames": ["instagram"],
  "maxItemsPerTarget": 10
}
```

#### Search for places 🔎📍

```json
{
  "operation": "searchResults",
  "search": "Niagara Falls",
  "searchType": "place",
  "searchLimit": 20
}
```

#### Scrape hashtag posts #️⃣📈

```json
{
  "operation": "hashtagPosts",
  "hashtags": ["travelphotography"],
  "maxItemsPerTarget": 25
}
```

#### Scrape public comments 💬

```json
{
  "operation": "comments",
  "postUrls": ["https://www.instagram.com/p/C3TTthZLoQK/"],
  "includeComments": true,
  "includeReplies": false,
  "maxCommentsPerPost": 50
}
```

#### Save media files 🖼️💾

```json
{
  "operation": "postDetails",
  "postUrls": ["https://www.instagram.com/p/C3TTthZLoQK/"],
  "downloadMedia": true,
  "downloadMediaTypes": ["image", "thumbnail", "video"],
  "maxMediaFiles": 10
}
```

### Input settings explained 🧰

You can use the visual input form in Apify Console, or paste JSON like the examples above. 🧾

| Setting | Plain-English meaning |
| --- | --- |
| 🧭 `operation` | What the Actor should do, such as profile posts, post details, comments, hashtag posts, place posts, search results, or auto-detection |
| 🔗 `startUrls` | Instagram URLs to process, useful when you have a mixed list of profiles, posts, Reels, hashtags, or places |
| 👤 `usernames` | Instagram usernames, with or without `@` |
| #️⃣ `hashtags` | Hashtags, with or without `#` |
| 📍 `placeUrls` | Instagram place URLs or numeric place IDs |
| 📷 `postUrls` | Post or Reel URLs |
| 🔎 `search` | A search term for finding public profiles, hashtags, or places |
| 🎚️ `searchLimit` | Maximum number of search results to save |
| 📦 `maxItemsPerTarget` | Maximum number of posts, Reels, or discovered items to save per target |
| 👤 `includeProfileDetails` | Add profile details when profile targets are processed |
| 💬 `includeComments` | Try to collect public comments for posts and Reels |
| ↩️ `includeReplies` | Include public comment replies when Instagram exposes them |
| 🔢 `maxCommentsPerPost` | Maximum number of public comments to save for each post |
| 📅 `fromDate` / `toDate` | Keep only posts inside a date range when timestamps are available |
| 🖼️ `downloadMedia` | Store media files in Apify storage instead of only saving temporary Instagram CDN links |
| 🧮 `maxMediaFiles` | Maximum number of media files to download in one run |
| 🌐 `proxyConfiguration` | Optional proxy settings. The default is off to keep small runs cheap |
| 🐢 `maxConcurrency` | How many targets to process at the same time. Lower values are gentler and cheaper |
| 🔁 `maxRequestRetries` | How many times to retry failed requests. The default is 0 for low-cost testing |
| 🧹 `deduplicateAcrossRuns` | Remember previously seen items using a named state store |
| 🆕 `outputOnlyNewItems` | When deduplication is on, save only newly discovered items |
| 📉 `changeDetection` | Track metric changes across runs |
| 🛡️ `removePersonalTextFields` | Remove captions, biographies, comments, and similar text fields where supported |
| 🕶️ `redactUsernames` | Replace usernames with stable redacted labels where supported |

### Output format 📦

The Actor saves results to the default Apify dataset. Each dataset row is one record, such as a profile, post, comment, hashtag, place, media item, search result, or error. 📚

Every record includes:

- 🏷️ `recordType` - tells you what kind of row it is, such as `post`, `profile`, or `comment`.
- 🧾 `source` - shows which input produced the result.
- 🎯 `target` - shows the normalized target, such as the username, shortcode, URL, or place ID.
- 📊 `metrics` - includes counts such as likes, comments, views, followers, or posts when Instagram exposes them.
- 🖼️ `media` - contains public media URLs and download information.
- 🕒 `crawl` - includes scrape time, request URL, warnings, and whether the result is partial.

The Actor also writes an `OUTPUT` summary with total records, finished requests, failed requests, warnings, and errors. 🧾✅

#### Example post output 📷

```json
{
  "recordType": "post",
  "schemaVersion": "1.0",
  "source": {
    "input": "https://www.instagram.com/p/ABC123/",
    "inputType": "postUrl",
    "inputIndex": 0,
    "operation": "postDetails"
  },
  "target": {
    "type": "post",
    "name": "ABC123",
    "url": "https://www.instagram.com/p/ABC123/",
    "id": "ABC123"
  },
  "post": {
    "shortCode": "ABC123",
    "url": "https://www.instagram.com/p/ABC123/",
    "type": "image",
    "caption": "Example caption #campaign @partner",
    "hashtags": ["campaign"],
    "mentions": ["partner"],
    "timestamp": "2026-06-01T12:00:00.000Z",
    "ownerUsername": "examplebrand"
  },
  "metrics": {
    "likesCount": 100,
    "commentsCount": 5
  },
  "media": [
    {
      "type": "image",
      "displayUrl": "https://cdn.example.com/post.jpg",
      "downloaded": false,
      "downloadStatus": "skipped"
    }
  ],
  "crawl": {
    "scrapedAt": "2026-06-15T13:16:50.780Z",
    "partial": false,
    "warnings": [],
    "requestUrl": "https://www.instagram.com/p/ABC123/"
  }
}
```

### Dataset views 👀

In Apify Console, the dataset includes ready-made views so you can scan the data faster. ✨

- 📋 **Overview** - all records with common fields.
- 📷 **Posts and Reels** - captions, URLs, timestamps, metrics, hashtags, and mentions.
- 👤 **Profiles** - usernames, follower counts, verification status, and profile metadata.
- 💬 **Comments** - comment text, owners, timestamps, likes, and reply relationships.
- \#️⃣ **Hashtags** - hashtag names, URLs, and counts.
- 📍 **Places** - place IDs, names, URLs, and location details when visible.
- 🔎 **Search Results** - discovered public profiles, hashtags, and places.
- 🖼️ **Media** - downloaded media records and media storage details.
- ⚠️ **Errors** - targets that could not be processed, with readable error messages.

### How much will it cost? 💸

Instagram Scraper Ultimate is tuned for low-cost runs by default. 🪙

The default setup uses:

- 🧠 256 MB memory by default.
- 🐢 1 concurrent request.
- 🔁 0 automatic retries.
- ⏱️ 0 artificial delay.
- 🌐 Proxy disabled by default.
- 💬 Comments disabled by default.
- 🖼️ Media downloads disabled by default.
- 📦 Small default result limits.

This keeps quick tests very cheap. In a small Apify platform smoke test, one public post URL completed in about 9 seconds at 256 MB and saved one post record. ⚡

Your final cost depends on Apify platform pricing, runtime, memory, number of targets, retries, proxies, storage writes, dataset reads, and whether you download media. For the lowest cost, start with a small limit, keep media downloads off, keep comments off, and increase settings only after your test run looks good. 🧪➡️📈

### How many results can I get? 📏

The number of results depends on what Instagram publicly shows for each target. Some pages expose rich public data. Others may show only partial data, require login, rate-limit requests, or change their page format. 🔄

A good rule of thumb:

- 👀 Open the target in an incognito browser.
- ✅ If you can see the content without logging in, the Actor has a better chance of collecting it.
- ⚠️ If Instagram shows a login wall, hides comments, or blocks pagination, the Actor may return partial data or an error record.
- 🧪 Run a small test before scaling to large jobs.

### During the Actor run ▶️

While the Actor runs, it logs what it is processing and updates the run status with progress. You can watch the log in Apify Console. 👀

If an input is invalid, the Actor stops early and explains what needs to be fixed. If one target cannot be processed, the Actor can save an error record so you can review it later. 🧯

### Exporting and integrations 🔌

After the run finishes, you can download the dataset from Apify Console. 📥

You can export to:

- 📄 JSON
- 📊 CSV
- 📗 Excel
- 🌐 HTML
- 🧾 XML
- 📰 RSS

You can also connect the results to cloud tools using Apify integrations, webhooks, or the Apify API. Popular destinations include Google Sheets, Google Drive, Slack, Make, Zapier, Airbyte, databases, dashboards, and custom apps. 🔗🚀

### Public data, privacy, and responsible use ⚖️🛡️

This Actor is intended for public Instagram data only. It does not scrape private accounts, does not require Instagram login by default, and does not bypass access controls. 🔐

However, public Instagram pages may still contain personal data, such as usernames, captions, comments, profile text, images, or engagement data. You are responsible for using the results lawfully and respectfully. If you are unsure whether your use case is allowed, ask a qualified legal professional. 👩‍⚖️👨‍⚖️

Helpful privacy options:

- 🛡️ Turn on `removePersonalTextFields` to remove captions, biographies, comments, and similar text fields where supported.
- 🕶️ Turn on `redactUsernames` to replace usernames with stable redacted labels where supported.
- 🧹 Use smaller limits and collect only the fields you actually need.

Instagram Scraper Ultimate is not affiliated with Instagram or Meta. ℹ️

### Limitations ⚠️

Instagram changes often, and public pages can behave differently depending on the target, region, traffic, and current Instagram restrictions. 🌦️

Important limits to know:

- 🔐 Private accounts cannot be scraped.
- 🚪 Login-only content may not be available.
- 💬 Comments are collected only when Instagram exposes them publicly.
- 📜 Deep pagination may be limited by what Instagram shows publicly.
- 🖼️ Instagram CDN media URLs can expire. Enable `downloadMedia` if stable media files matter.
- 🌐 If you see rate limiting or login walls, try lower concurrency, smaller batches, or proxy settings.

### Troubleshooting 🧯

| Problem | What to try |
| --- | --- |
| 😕 Fewer results than expected | Check the target in an incognito browser, reduce concurrency, and start with a smaller batch |
| 🚪 Login wall or blocked page | Retry later, lower request volume, or use proxy settings |
| 💬 No comments returned | Instagram may not expose public comments for that post |
| 🖼️ Media links stopped working | Turn on `downloadMedia` for stable stored files |
| 🧾 Invalid input error | Add at least one target source, such as `startUrls`, `usernames`, `hashtags`, `placeUrls`, `postUrls`, or `search` |
| ⚠️ Partial records | Some fields were not visible on the public page. Check warnings in the dataset and `OUTPUT` summary |

### FAQ 🙋

#### Does this Actor require Instagram login? 🔑

No. The default setup is public-data-first and does not require login.

#### Can it scrape private Instagram accounts? 🔐

No. It only works with public data that Instagram exposes.

#### Can it scrape Reels? 🎬

Yes. Use Reel URLs, profile Reel mode, or auto-detection with mixed Instagram URLs.

#### Can it scrape comments? 💬

Yes, when comments are publicly exposed by Instagram. Turn on `includeComments` and set `maxCommentsPerPost`.

#### Can it download images and videos? 🖼️

Yes. Turn on `downloadMedia`. This stores media files in the run key-value store, which is better than relying only on temporary Instagram CDN URLs.

#### Can I export to CSV or Excel? 📊

Yes. Open the Dataset tab after the run and choose your export format.

#### Can I run it every day? 📅

Yes. Create an Apify task from your input and schedule it in Apify Console. For recurring monitoring, consider using `deduplicateAcrossRuns`, `outputOnlyNewItems`, or `changeDetection`.

#### Can I use it with Google Sheets, Zapier, or Make? 🔌

Yes. Use Apify integrations, webhooks, or API access to send results to other tools.

#### Why are some fields missing? 🧩

Instagram does not show the same data for every public page. If a metric, timestamp, comment, or media URL is not visible, the Actor may leave that field empty or mark the result as partial.

### For developers 🧑‍💻

Most users can run the Actor from Apify Console without touching code. If you are developing locally, use these commands:

```bash
npm install
npm test
npm run build
npm run start
```

When no local input is present, the Actor uses fixture mode so a local smoke run can finish without hitting Instagram. Production runs should provide real input and keep `debugUseFixtures` disabled. 🧪

# Actor input Schema

## `operation` (type: `string`):

Choose the extraction workflow. Auto-detect works with mixed URLs and plain targets.

## `startUrls` (type: `array`):

Instagram profile, post, reel, hashtag, or location URLs.

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

Public Instagram usernames, with or without @.

## `hashtags` (type: `array`):

Hashtags, with or without #.

## `placeUrls` (type: `array`):

Instagram location URLs or numeric place IDs.

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

Instagram post or Reel URLs.

## `search` (type: `string`):

Search query for profile, hashtag, and place discovery.

## `searchType` (type: `string`):

Legacy-compatible search target hint.

## `searchLimit` (type: `integer`):

Maximum search records to output.

## `maxItemsPerTarget` (type: `integer`):

Maximum posts, reels, or discovered items to process per target.

## `includeProfileDetails` (type: `boolean`):

Write profile metadata when profile targets are processed.

## `includePostDetails` (type: `boolean`):

Write post metadata when post targets are discovered.

## `includeComments` (type: `boolean`):

Attempt to extract public comments for post and Reel targets.

## `includeReplies` (type: `boolean`):

Include public comment replies when they are exposed.

## `maxCommentsPerPost` (type: `integer`):

Maximum public comments to output per post.

## `fromDate` (type: `string`):

Only include posts at or after this ISO date when timestamps are available.

## `toDate` (type: `string`):

Only include posts at or before this ISO date when timestamps are available.

## `mediaTypes` (type: `array`):

Post media types to keep.

## `downloadMedia` (type: `boolean`):

Store public media files in the key-value store so output is not dependent on temporary Instagram CDN URLs.

## `downloadMediaTypes` (type: `array`):

Media types to download when media downloading is enabled.

## `maxMediaFiles` (type: `integer`):

Maximum media files to download in one run.

## `proxyConfiguration` (type: `object`):

Apify Proxy or custom proxy settings.

## `maxConcurrency` (type: `integer`):

Maximum number of targets processed concurrently.

## `maxRequestRetries` (type: `integer`):

Maximum retries per crawl job.

## `requestDelaySecs` (type: `number`):

Delay before each target request.

## `deduplicateAcrossRuns` (type: `boolean`):

Use a named key-value store to remember previously seen items.

## `deduplicateBy` (type: `string`):

Primary key used for deduplication.

## `outputOnlyNewItems` (type: `boolean`):

When cross-run deduplication is enabled, output only unseen records.

## `changeDetection` (type: `boolean`):

Track metric changes across runs using the named state store.

## `stateStoreName` (type: `string`):

Named key-value store for cross-run deduplication or change detection.

## `removePersonalTextFields` (type: `boolean`):

Remove biography, caption, comment text, and similar text fields from output where supported.

## `redactUsernames` (type: `boolean`):

Replace usernames with deterministic coarse labels where supported.

## `saveRawSnapshots` (type: `boolean`):

Reserved for debugging. Raw responses are not saved by default.

## `enablePayPerEvent` (type: `boolean`):

Enable only after PPE events are configured in Apify Console.

## `debugUseFixtures` (type: `boolean`):

Developer-only local smoke mode. Leave disabled for production runs.

## Actor input object example

```json
{
  "operation": "mixedAuto",
  "startUrls": [
    {
      "url": "https://www.instagram.com/p/C3TTthZLoQK/"
    }
  ],
  "searchType": "auto",
  "searchLimit": 10,
  "maxItemsPerTarget": 10,
  "includeProfileDetails": false,
  "includePostDetails": true,
  "includeComments": false,
  "includeReplies": false,
  "maxCommentsPerPost": 25,
  "mediaTypes": [
    "image",
    "video",
    "sidecar"
  ],
  "downloadMedia": false,
  "downloadMediaTypes": [
    "image",
    "thumbnail",
    "video"
  ],
  "maxMediaFiles": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "maxConcurrency": 1,
  "maxRequestRetries": 0,
  "requestDelaySecs": 0,
  "deduplicateAcrossRuns": false,
  "deduplicateBy": "shortCode",
  "outputOnlyNewItems": false,
  "changeDetection": false,
  "removePersonalTextFields": false,
  "redactUsernames": false,
  "saveRawSnapshots": false,
  "enablePayPerEvent": false,
  "debugUseFixtures": false
}
```

# Actor output Schema

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

All extracted profiles, posts, reels, comments, hashtags, places, search results, media records, and clear error records.

## `summary` (type: `string`):

A JSON summary with input settings, record counts, request counts, warnings, and errors.

## `mediaFiles` (type: `string`):

Optional image, thumbnail, or video files saved when media downloading is enabled.

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

// Run the Actor and wait for it to finish
const run = await client.actor("qaseemiqbal/instagram-scraper-ultimate").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 = { "startUrls": [{ "url": "https://www.instagram.com/p/C3TTthZLoQK/" }] }

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

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Instagram Scraper Ultimate",
        "description": "Scrape public Instagram profiles, posts, Reels, hashtags, places, comments, and media links. Export clean data for research, monitoring, and analysis.",
        "version": "1.0",
        "x-build-id": "scnNCem8JVOXkmuoF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/qaseemiqbal~instagram-scraper-ultimate/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-qaseemiqbal-instagram-scraper-ultimate",
                "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/qaseemiqbal~instagram-scraper-ultimate/runs": {
            "post": {
                "operationId": "runs-sync-qaseemiqbal-instagram-scraper-ultimate",
                "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/qaseemiqbal~instagram-scraper-ultimate/run-sync": {
            "post": {
                "operationId": "run-sync-qaseemiqbal-instagram-scraper-ultimate",
                "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",
                "properties": {
                    "operation": {
                        "title": "Operation",
                        "enum": [
                            "mixedAuto",
                            "profileDetails",
                            "profilePosts",
                            "profileReels",
                            "postDetails",
                            "reelDetails",
                            "comments",
                            "hashtagDetails",
                            "hashtagPosts",
                            "placeDetails",
                            "placePosts",
                            "searchResults",
                            "mentions"
                        ],
                        "type": "string",
                        "description": "Choose the extraction workflow. Auto-detect works with mixed URLs and plain targets.",
                        "default": "mixedAuto"
                    },
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "Instagram profile, post, reel, hashtag, or location URLs.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL",
                                    "description": "Public Instagram URL to process."
                                }
                            }
                        }
                    },
                    "usernames": {
                        "title": "Usernames",
                        "type": "array",
                        "description": "Public Instagram usernames, with or without @.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "hashtags": {
                        "title": "Hashtags",
                        "type": "array",
                        "description": "Hashtags, with or without #.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "placeUrls": {
                        "title": "Place URLs or IDs",
                        "type": "array",
                        "description": "Instagram location URLs or numeric place IDs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "postUrls": {
                        "title": "Post or Reel URLs",
                        "type": "array",
                        "description": "Instagram post or Reel URLs.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "search": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Search query for profile, hashtag, and place discovery."
                    },
                    "searchType": {
                        "title": "Search type",
                        "enum": [
                            "auto",
                            "all",
                            "user",
                            "profile",
                            "hashtag",
                            "place",
                            "post"
                        ],
                        "type": "string",
                        "description": "Legacy-compatible search target hint.",
                        "default": "auto"
                    },
                    "searchLimit": {
                        "title": "Search result limit",
                        "minimum": 1,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Maximum search records to output.",
                        "default": 10
                    },
                    "maxItemsPerTarget": {
                        "title": "Maximum items per target",
                        "minimum": 1,
                        "maximum": 50000,
                        "type": "integer",
                        "description": "Maximum posts, reels, or discovered items to process per target.",
                        "default": 10
                    },
                    "includeProfileDetails": {
                        "title": "Include profile details",
                        "type": "boolean",
                        "description": "Write profile metadata when profile targets are processed.",
                        "default": false
                    },
                    "includePostDetails": {
                        "title": "Include post details",
                        "type": "boolean",
                        "description": "Write post metadata when post targets are discovered.",
                        "default": true
                    },
                    "includeComments": {
                        "title": "Include comments",
                        "type": "boolean",
                        "description": "Attempt to extract public comments for post and Reel targets.",
                        "default": false
                    },
                    "includeReplies": {
                        "title": "Include replies",
                        "type": "boolean",
                        "description": "Include public comment replies when they are exposed.",
                        "default": false
                    },
                    "maxCommentsPerPost": {
                        "title": "Maximum comments per post",
                        "minimum": 0,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum public comments to output per post.",
                        "default": 25
                    },
                    "fromDate": {
                        "title": "From date",
                        "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}",
                        "type": "string",
                        "description": "Only include posts at or after this ISO date when timestamps are available."
                    },
                    "toDate": {
                        "title": "To date",
                        "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}",
                        "type": "string",
                        "description": "Only include posts at or before this ISO date when timestamps are available."
                    },
                    "mediaTypes": {
                        "title": "Media types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Post media types to keep.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "image",
                                "video",
                                "sidecar",
                                "thumbnail",
                                "unknown"
                            ]
                        },
                        "default": [
                            "image",
                            "video",
                            "sidecar"
                        ]
                    },
                    "downloadMedia": {
                        "title": "Download media files",
                        "type": "boolean",
                        "description": "Store public media files in the key-value store so output is not dependent on temporary Instagram CDN URLs.",
                        "default": false
                    },
                    "downloadMediaTypes": {
                        "title": "Download media types",
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Media types to download when media downloading is enabled.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "image",
                                "thumbnail",
                                "video",
                                "sidecar",
                                "unknown"
                            ]
                        },
                        "default": [
                            "image",
                            "thumbnail",
                            "video"
                        ]
                    },
                    "maxMediaFiles": {
                        "title": "Maximum media files",
                        "minimum": 0,
                        "maximum": 100000,
                        "type": "integer",
                        "description": "Maximum media files to download in one run.",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify Proxy or custom proxy settings.",
                        "default": {
                            "useApifyProxy": false
                        }
                    },
                    "maxConcurrency": {
                        "title": "Maximum concurrency",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum number of targets processed concurrently.",
                        "default": 1
                    },
                    "maxRequestRetries": {
                        "title": "Maximum request retries",
                        "minimum": 0,
                        "maximum": 20,
                        "type": "integer",
                        "description": "Maximum retries per crawl job.",
                        "default": 0
                    },
                    "requestDelaySecs": {
                        "title": "Request delay seconds",
                        "minimum": 0,
                        "maximum": 60,
                        "type": "number",
                        "description": "Delay before each target request.",
                        "default": 0
                    },
                    "deduplicateAcrossRuns": {
                        "title": "Deduplicate across runs",
                        "type": "boolean",
                        "description": "Use a named key-value store to remember previously seen items.",
                        "default": false
                    },
                    "deduplicateBy": {
                        "title": "Deduplicate by",
                        "enum": [
                            "shortCode",
                            "postId",
                            "url",
                            "commentId"
                        ],
                        "type": "string",
                        "description": "Primary key used for deduplication.",
                        "default": "shortCode"
                    },
                    "outputOnlyNewItems": {
                        "title": "Output only new items",
                        "type": "boolean",
                        "description": "When cross-run deduplication is enabled, output only unseen records.",
                        "default": false
                    },
                    "changeDetection": {
                        "title": "Change detection",
                        "type": "boolean",
                        "description": "Track metric changes across runs using the named state store.",
                        "default": false
                    },
                    "stateStoreName": {
                        "title": "State store name",
                        "type": "string",
                        "description": "Named key-value store for cross-run deduplication or change detection."
                    },
                    "removePersonalTextFields": {
                        "title": "Remove personal text fields",
                        "type": "boolean",
                        "description": "Remove biography, caption, comment text, and similar text fields from output where supported.",
                        "default": false
                    },
                    "redactUsernames": {
                        "title": "Redact usernames",
                        "type": "boolean",
                        "description": "Replace usernames with deterministic coarse labels where supported.",
                        "default": false
                    },
                    "saveRawSnapshots": {
                        "title": "Save raw snapshots",
                        "type": "boolean",
                        "description": "Reserved for debugging. Raw responses are not saved by default.",
                        "default": false
                    },
                    "enablePayPerEvent": {
                        "title": "Enable pay-per-event charging",
                        "type": "boolean",
                        "description": "Enable only after PPE events are configured in Apify Console.",
                        "default": false
                    },
                    "debugUseFixtures": {
                        "title": "Use local fixtures",
                        "type": "boolean",
                        "description": "Developer-only local smoke mode. Leave disabled for production runs.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
