# Instagram Scraper - All In One (`toolzerhub/instagram-all-in-one-scraper`) Actor

Every mode this Instagram family offers, in one Actor: profiles, posts, reels, social graph, stories and highlights, post lookups with comments and likes, hashtags, the location directory, audio tracks, and search. The mode is chosen at run time and each fills in its own section.

- **URL**: https://apify.com/toolzerhub/instagram-all-in-one-scraper.md
- **Developed by:** [ToolzerHub](https://apify.com/toolzerhub) (community)
- **Categories:** Social media, Marketing, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.40 / 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?

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 Scraper - All In One

Every mode this Instagram family offers, in one Actor — profiles, posts and reels, followers and following, stories and highlights, single posts with comments and likes, hashtags, the location directory, audio tracks and search. Pick the mode at run time and fill in that section. No login, no cookies.

Use this when you want one Actor and one dataset covering several kinds of Instagram data. Use a focused Actor when you want one job with a shorter input form.

### What it covers

| Area | Modes | Focused Actor |
|---|---|---|
| Profiles | by username, by ID, extended, username-by-ID, former usernames | [Profile](https://apify.com/toolzerhub/instagram-profile-scraper) |
| Posts | timeline, reels, tagged, reposts | [Posts & Reels](https://apify.com/toolzerhub/instagram-posts-reels-scraper) |
| Social graph | followers, following, related, similar | [Followers & Following](https://apify.com/toolzerhub/instagram-followers-following-scraper) |
| Stories | active stories, highlight tray, stories in a highlight | [Stories & Highlights](https://apify.com/toolzerhub/instagram-stories-highlights-scraper) |
| One post | by URL, by ID, extended, comments, replies, likes | [Post, Comments & Likes](https://apify.com/toolzerhub/instagram-post-comments-likes-scraper) |
| Hashtags | posts by tag | [Hashtag](https://apify.com/toolzerhub/instagram-hashtag-posts-scraper) |
| Locations | details, posts, cities, places, search, nearby | [Location](https://apify.com/toolzerhub/instagram-places-scraper) |
| Audio | posts using a track, track search | [Audio](https://apify.com/toolzerhub/instagram-audio-scraper) |
| Search | quick, general, users, hashtags, reels | [Search](https://apify.com/toolzerhub/instagram-search-scraper) |

### Input

Set **What to collect**, then fill in that mode's section — the rest of the form is for other modes and is ignored.

| Field | Notes |
|---|---|
| **Max results** | Per identifier or search term, not per run. `0` removes the bound. |
| **Resume from** | Continuation value from an earlier run's log |

Links are accepted wherever an ID is: post URLs, location URLs and highlight URLs all have the ID pulled out of them.

### Output

`source_identifier` · `username` · `code` · `like_count` · `comment_count`

Rows keep the shape of whichever mode produced them, so a profile row and a post row are not the same set of columns. **source\_identifier** is on every row.

### Questions

**One run, several modes?**
No — one mode per run. The mode is chosen when the run starts. Chain runs, or schedule several; every row carries `source_identifier` so one dataset stays sortable.

**Does it cost more than a focused Actor?**
No. The same mode does the same work whichever Actor you start it from. The difference is the input form and the shape of the dataset you end up with.

**Which mode needs a numeric user ID rather than a handle?**
The four post modes — timeline, reels, tagged and reposts — and Related profiles. Everything else takes a handle, or either. Run a profile mode first and use its `pk`.

**A mode returned no rows and the run still succeeded.**
That is deliberate. A private account, a deleted post, a retired location ID, a hashtag Instagram restricts — all return nothing rather than failing, so a batch does not lose its other results to one bad identifier. Compare the `source_identifier` values you got back against what you sent.

**Some fields are missing on my rows.**
Different modes come from different Instagram surfaces and carry different fields. Nothing is dropped — a field absent from a row was not part of that mode's response. The focused Actor pages list what each area returns.

### Support

Questions, bugs, or feature requests: **contact@toolzerhub.com**

Browse the rest: [apify.com/toolzerhub](https://apify.com/toolzerhub)

# Actor input Schema

## `scraperType` (type: `string`):

Choose the dataset for this run, then fill in the section for that mode below.

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

One or more Instagram usernames, without the @.

## `userIds` (type: `array`):

One or more numeric Instagram user IDs. Only a numeric ID works for this mode — get one from the Profile actor's "Get profile by username" mode, which returns it for any account.

## `usernamesOrIds` (type: `array`):

One or more Instagram usernames or numeric user IDs, mixed freely — this mode accepts either.

## `highlightId` (type: `string`):

Paste the highlight's instagram.com/stories/highlights/... link, or just the number at the end of it. You can also get this from the Stories & Highlights actor's "List highlight covers" mode.

## `postUrl` (type: `string`):

Full Instagram post, reel, or TV URL, copied from the address bar.

## `postId` (type: `string`):

The post's numeric media ID. Most people won't have this on hand — paste the post's URL into "Get post by URL" instead, or convert a shortcode to one with the Post actor's "Convert shortcode to media ID" mode.

## `code` (type: `string`):

Paste the post's Instagram link (instagram.com/p/..., /reel/..., or /tv/...), or just the code at the end of it.

## `commentId` (type: `string`):

The id of the comment to read replies for. Run "List post comments" first and copy the `id` field of the comment you want from its output.

## `sortBy` (type: `string`):

Order to read a post's comments in.

## `hashtag` (type: `string`):

A hashtag, without the leading #.

## `locationId` (type: `string`):

Paste the location's instagram.com/explore/locations/... link, or just the number in it. You can also get this from the Location actor's "Search locations by name" mode.

## `tab` (type: `string`):

Which ranking of a location's posts to read.

## `countryCode` (type: `string`):

Two-letter ISO country code.

## `cityId` (type: `string`):

A city id from this domain's "List cities in a country" mode (looks like c2753900) — Instagram doesn't show this id anywhere else.

## `latitude` (type: `number`):

Latitude of the point to search near.

## `longitude` (type: `number`):

Longitude of the point to search near.

## `musicId` (type: `string`):

An Instagram audio track's numeric ID. Only needed if you don't have the track's link — give either this or Audio track URL below, not both.

## `musicUrl` (type: `string`):

The audio/reel-mix page link, copied from Instagram. Give either this or Audio track ID above, not both.

## `keyword` (type: `string`):

The word or phrase to search for.

## `query` (type: `string`):

The word or phrase to search for.

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

Restrict the typeahead search to one section, or leave it on All.

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

The maximum number of records to save per identifier or search term. A value of 0 removes the bound and the run continues until the source has no more to give.

## `cursor` (type: `string`):

A continuation value from an earlier run — the value the run log prints when it stops. The run continues from there instead of the top. Leave it empty to start at the top. Applies only to a single identifier or search term; a multi-account run uses it for the first one only.

## Actor input object example

```json
{
  "scraperType": "userInfo",
  "usernames": [
    "instagram"
  ],
  "userIds": [
    "25025320"
  ],
  "usernamesOrIds": [
    "instagram"
  ],
  "highlightId": "highlight:18142207969557132",
  "postUrl": "https://www.instagram.com/p/DcBr7X4SL3h/",
  "postId": "3963642343152205281",
  "code": "DcBr7X4SL3h",
  "commentId": "17962178040160246",
  "sortBy": "recent",
  "hashtag": "nature",
  "locationId": "212988663",
  "tab": "ranked",
  "countryCode": "US",
  "cityId": "c2753900",
  "latitude": 40.7128,
  "longitude": -74.006,
  "musicId": "1373038466202836",
  "musicUrl": "https://www.instagram.com/reels/audio/1373038466202836/",
  "keyword": "nasa",
  "query": "nasa",
  "searchType": "all",
  "maxItems": 25
}
```

# Actor output Schema

## `dataset` (type: `string`):

Every record collected during this run

# 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 = {
    "scraperType": "userInfo",
    "usernames": [
        "instagram"
    ],
    "userIds": [
        "25025320"
    ],
    "usernamesOrIds": [
        "instagram"
    ],
    "highlightId": "highlight:18142207969557132",
    "postUrl": "https://www.instagram.com/p/DcBr7X4SL3h/",
    "postId": "3963642343152205281",
    "code": "DcBr7X4SL3h",
    "commentId": "17962178040160246",
    "hashtag": "nature",
    "locationId": "212988663",
    "countryCode": "US",
    "cityId": "c2753900",
    "musicId": "1373038466202836",
    "musicUrl": "https://www.instagram.com/reels/audio/1373038466202836/",
    "keyword": "nasa",
    "query": "nasa",
    "maxItems": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("toolzerhub/instagram-all-in-one-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 = {
    "scraperType": "userInfo",
    "usernames": ["instagram"],
    "userIds": ["25025320"],
    "usernamesOrIds": ["instagram"],
    "highlightId": "highlight:18142207969557132",
    "postUrl": "https://www.instagram.com/p/DcBr7X4SL3h/",
    "postId": "3963642343152205281",
    "code": "DcBr7X4SL3h",
    "commentId": "17962178040160246",
    "hashtag": "nature",
    "locationId": "212988663",
    "countryCode": "US",
    "cityId": "c2753900",
    "musicId": "1373038466202836",
    "musicUrl": "https://www.instagram.com/reels/audio/1373038466202836/",
    "keyword": "nasa",
    "query": "nasa",
    "maxItems": 25,
}

# Run the Actor and wait for it to finish
run = client.actor("toolzerhub/instagram-all-in-one-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 '{
  "scraperType": "userInfo",
  "usernames": [
    "instagram"
  ],
  "userIds": [
    "25025320"
  ],
  "usernamesOrIds": [
    "instagram"
  ],
  "highlightId": "highlight:18142207969557132",
  "postUrl": "https://www.instagram.com/p/DcBr7X4SL3h/",
  "postId": "3963642343152205281",
  "code": "DcBr7X4SL3h",
  "commentId": "17962178040160246",
  "hashtag": "nature",
  "locationId": "212988663",
  "countryCode": "US",
  "cityId": "c2753900",
  "musicId": "1373038466202836",
  "musicUrl": "https://www.instagram.com/reels/audio/1373038466202836/",
  "keyword": "nasa",
  "query": "nasa",
  "maxItems": 25
}' |
apify call toolzerhub/instagram-all-in-one-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,toolzerhub/instagram-all-in-one-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/RC3WD1vQtQhuugLZs/builds/5EVNUrMiqGsZhfGAr/openapi.json
