# Instagram Scraper: Profiles, Posts & Reels (`humble-echidna/instagram-scraper`) Actor

Scrape public Instagram profiles, posts and reels from usernames or links, no login: followers, bio and links, and per post the caption, hashtags, likes, comments, date, image and video URLs, collaborators, tagged users, audio and first comments. Reels-only, date filter and only-new mode.

- **URL**: https://apify.com/humble-echidna/instagram-scraper.md
- **Developed by:** [Michael Costa](https://apify.com/humble-echidna) (community)
- **Categories:** Social media, Marketing, For creators
- **Stats:** 18 total users, 5 monthly users, 99.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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?

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

### What does Instagram Scraper do?

**Instagram Scraper** gets public **Instagram profiles, posts and reels** from usernames or links: followers, bio
and links for each profile, and for each post the **caption, hashtags, likes, comments count, date, image and video
URLs**, collaborators, tagged users, audio and the first comments. One run takes any mix of profiles, reels tabs and
post links. **No login**, no cookies, no account.

It is **not** a hashtag or keyword search: Instagram shows those pages only to signed-in accounts ([Limits](#limits)).

[Input fields](https://apify.com/humble-echidna/instagram-scraper/input-schema) ·
[API](https://apify.com/humble-echidna/instagram-scraper/api) ·
[Use it from Claude, ChatGPT or Cursor (MCP)](#can-i-use-instagram-scraper-from-an-ai-agent-mcp)

**Jump to:** [Monitor](#monitor-instagram-profiles-get-only-new-posts-in-slack-email-or-a-webhook) ·
[Fields](#what-data-does-instagram-scraper-return) ·
[Price](#how-much-does-it-cost-to-scrape-instagram) ·
[How to use](#how-to-scrape-instagram-profiles-posts-and-reels) ·
[Input](#input) · [Output](#output) · [Switching](#switching-from-another-instagram-actor) ·
[AI agents (MCP)](#can-i-use-instagram-scraper-from-an-ai-agent-mcp) · [Limits](#limits) · [FAQ](#faq)

**Try it in one click:** the input comes pre-filled with NASA's profile. That's 13 results (the profile and its 12
latest posts), or about $0.033 (13 × $2.50/1,000, plus $0.00005 for the run start). **Then replace it with what you
actually want.**

### Monitor Instagram profiles: get only new posts, in Slack, email or a webhook

With **Only new posts since the last run** on, each run returns (and charges for) only the posts published since
the newest one it returned before for that profile. A run with nothing new costs only the $0.00005 start fee.

1. Put the profiles in **Profiles, posts or reels** (`"targets": ["nasa", "natgeo"]`), turn off **Include the
   profile** (`"includeProfile": false`) if you only want posts, turn on **Only new posts since the last run**
   (`"onlyNew": true`), and click **Start**. This first run returns the latest posts (12 per profile by default) and
   is the baseline.
2. Click **Save as a new task** (top right of the actor page). What has been returned is remembered per profile (and
   per reels filter), in a key-value store in your account, so two tasks on one profile don't hide each other's posts
   unless they use the same filter.
3. In Apify Console, open **Schedules**, click **Create new**, set how often in **Schedule setup** (for example every
   hour, or daily at 07:00), then **Add** your task.
4. On the task, open the **Integrations** tab and pick where the new posts go:
   - **Slack**: click **Configure**, sign in, pick the workspace and channel, and the "run succeeded" event. A
     useful message: `{{resource.statusMessage}}` and a link,
     `<https://console.apify.com/storage/datasets/{{resource.defaultDatasetId}}|new posts>`.
   - **Gmail**: click **Connect with Google**, set the subject and body, and attach the dataset. It sends after each
     successful run.
   - **HTTP webhook**: event `ACTOR.RUN.SUCCEEDED`, your URL. Apify POSTs `{"eventType": ..., "resource": {...}}`;
     `resource.defaultDatasetId` is the run's dataset, and
     `GET https://api.apify.com/v2/datasets/<defaultDatasetId>/items?format=json` (with your API token) returns the
     new posts.

Apify's integrations fire after every successful run, including quiet ones: a quiet run's dataset is empty.

### What data does Instagram Scraper return?

One result per **profile** (`"type": "profile"`) and one per **post or reel** (`"type": "post"`), in one table: every
result has every column, and the ones that don't apply are empty.

| Field | Example | Notes |
|---|---|---|
| `type`, `url` | `post`, `https://www.instagram.com/reel/DeTUk4sDSp-/` | Reels link as /reel/ |
| `username`, `fullName`, `biography` | `nasa`, `NASA`, `Making the seemingly impossible, possible. ✨` | Profiles |
| `followersCount`, `followingCount` | `104366397`, `90` | Profiles |
| `isVerified`, `isPrivate`, `externalUrls` | `true`, `false`, `[{"title": "NASA.gov Homepage", "url": "https://www.nasa.gov"}, ...]` | Profiles: every bio link |
| `caption`, `hashtags`, `mentions` | `"POV: you're watching the Earth set..."`, `["NASA", "ArtemisII"]`, `[]` | Posts |
| `timestamp` | `2026-10-10T15:15:02Z` | Posts: when it was published (UTC) |
| `likesCount`, `commentsCount` | `670284`, `6575` | Posts; `likesCount` is null when the owner hides likes |
| `postType`, `isReel` | `video`, `true` | `image`, `video` or `carousel` |
| `displayUrl`, `videoUrl`, `videoDuration` | image and MP4 links, `43.77` | Video length in seconds |
| `carouselItems` | `[{"type": "image", "displayUrl": "...", ...}]` | Every photo or video in a carousel, one row per post |
| `ownerUsername`, `coauthors`, `taggedUsers` | `nasa`, `["nasasolarsystem", "nasaartemis"]`, `[...]` | Collab posts list their collaborators |
| `locationName`, `audioTitle`, `audioArtist` | `International Space Station`, `Original audio`, `nasa` | When the post has them |
| `latestComments` | `[{"text": "...", "ownerUsername": "...", "likesCount": 0, ...}]` | The comments Instagram shows logged-out visitors (about 10-15) |

Every result also has a stable `id` (Instagram's own), the `input` line it came from and `scrapedAt`. The full list
is under [Output](#output).

### How much does it cost to scrape Instagram?

You pay per result: **$2.50 per 1,000 results** on the Free plan, $2.10 on Starter, $1.75 on Scale and $1.40 on
Business, plus $0.00005 each time a run starts. A result is one profile or one post (a carousel is one result, however
many photos it holds); the full post details are included, with no extra events.

- **The example below:** 13 results × $2.50/1,000 = $0.033, plus the start fee.
- **A month, for example:** 20 competitor accounts checked daily with only new posts on, about 2 new posts each a
  day: 1,200 posts ≈ **$2.52** on Starter, plus $0.002 of start fees.
- **Caps:** **Max results per run** in the input, and **Maximum cost per run** in the run options. The run stops
  cleanly at whichever comes first; it stops fetching as soon as the limit is covered, so a capped run is also a
  fast one.

**Never charged:** inputs that fail (a hashtag link, a username that doesn't exist, a post Instagram withholds), posts
skipped by your filters, and posts already returned when only new is on.

### How to scrape Instagram profiles, posts and reels

1. Open Instagram Scraper and click **Try for free** (or **Start** if you're signed in).
2. Put usernames or links in **Profiles, posts or reels**, one per line: `nasa`, `https://www.instagram.com/nasa/`,
   `https://www.instagram.com/nasa/reels/` (reels only), or a post or reel link.
3. Set **Posts per profile** (12 by default, 0 for profiles only) and, if you want, **Only reels**, **Only posts newer
   than** (`2026-09-01` or `7 days`) and **Only new posts since the last run**.
4. Click **Start**, then open the **Output** tab and export as JSON, CSV or Excel.

### Example: NASA's profile and latest posts

The pre-filled input:

```json
{"targets": ["https://www.instagram.com/nasa/"], "postsPerProfile": 12}
```

It returned 13 results in 44 seconds ([run](https://console.apify.com/view/runs/P6NrMZC58RUDdNqb7) on 2026-10-14):
the profile first, then its 12 latest posts in the profile's order (pinned posts first, as on Instagram). It costs
$0.033 at the Free plan price below. One of NASA's reels (from an earlier run that day; long links, the empty profile
columns and all but one comment left out, the commenter's name replaced):

```json
{
  "id": "4004634989362489982",
  "type": "post",
  "url": "https://www.instagram.com/reel/DeTUk4sDSp-/",
  "input": "nasa",
  "shortCode": "DeTUk4sDSp-",
  "postType": "video",
  "isReel": true,
  "productType": "clips",
  "caption": "POV: you're watching the Earth set\n\nWe just released hundreds of new images and hours of new audio from our Artemis II mission around the Moon this spring. ...\n\n#NASA #ArtemisII #Artemis",
  "hashtags": ["NASA", "ArtemisII", "Artemis"],
  "mentions": [],
  "timestamp": "2026-10-10T15:15:02Z",
  "likesCount": 670284,
  "likesHidden": false,
  "commentsCount": 6575,
  "ownerUsername": "nasa",
  "ownerFullName": "NASA",
  "ownerId": "528817151",
  "ownerVerified": true,
  "coauthors": ["nasasolarsystem", "nasaartemis"],
  "taggedUsers": ["nasaartemis", "nasasolarsystem"],
  "locationName": null,
  "displayUrl": "https://scontent-cdg4-3.cdninstagram.com/v/t51.82787-15/842191580_..._n.jpg?...",
  "videoUrl": "https://scontent-cdg6-1.cdninstagram.com/o1/v/t2/f2/m86/AQNUvreb47JF....mp4?...",
  "videoDuration": 43.77,
  "width": 1074,
  "height": 1908,
  "hasAudio": true,
  "carouselCount": null,
  "audioTitle": "Original audio",
  "audioArtist": "nasa",
  "originalAudio": true,
  "altText": "Video by NASA on October 10, 2026. May be an image of planet, eclipse and text.",
  "topics": ["earthrise", "apollo mission", "lunar surface", "blue marble", "nasa footage"],
  "latestComments": [
    {"id": "18369051532301081", "text": "So what was moving the moon?", "ownerUsername": "a_commenter", "timestamp": "2026-10-14T22:31:32Z", "likesCount": 0, "repliesCount": null}
  ],
  "scrapedAt": "2026-10-14T22:31:46.415219Z"
}
```

### Input

| Field | What it does |
|---|---|
| **Profiles, posts or reels** (`targets`) | One per line: a username, a profile link, a profile's /reels/ link, or a post or reel link. |
| Posts per profile (`postsPerProfile`) | Latest posts per profile, newest first; 0 = profile only. Default 12, at most 2,000. |
| Include the profile (`includeProfile`) | One profile result per profile line (default on). |
| Only reels (`onlyReels`) | From profiles, return reels only. |
| Only posts newer than (`newerThan`) | `2026-09-01`, `2026-09-01T12:00:00Z`, or an age: `12 hours`, `7 days`, `2 weeks`, `3 months`. |
| Only new posts since the last run (`onlyNew`) | For schedules: only posts newer than the newest this input returned before. |
| Max results per run (`maxResults`) | Cap the total number of results. |

```json
{
  "targets": ["nasa", "https://www.instagram.com/natgeo/reels/", "https://www.instagram.com/p/DeTUk4sDSp-/"],
  "postsPerProfile": 50,
  "newerThan": "30 days",
  "maxResults": 500
}
```

### Output

A post looks like the [example above](#example-nasas-profile-and-latest-posts). A profile (real output, 2026-10-14;
the picture link shortened, two of five bio links shown, the empty post columns left out):

```json
{
  "id": "528817151",
  "type": "profile",
  "url": "https://www.instagram.com/nasa/",
  "input": "nasa",
  "username": "nasa",
  "fullName": "NASA",
  "biography": "Making the seemingly impossible, possible. ✨",
  "followersCount": 104366397,
  "followingCount": 90,
  "isVerified": true,
  "isPrivate": false,
  "hasReels": true,
  "externalUrl": "https://www.nasa.gov",
  "externalUrls": [
    {"title": "NASA.gov Homepage", "url": "https://www.nasa.gov"},
    {"title": "MAX POWER", "url": "https://www.nasa.gov/maxpower"}
  ],
  "profilePicUrl": "https://scontent-den2-1.cdninstagram.com/v/t51.2885-19/29090066_..._n.jpg?...",
  "pronouns": [],
  "threadsUsername": "nasa",
  "scrapedAt": "2026-10-14T22:31:46.415219Z"
}
```

Image and video links are Instagram's own signed links: they work for a few days, so download what you want to keep
([Bulk Image Downloader](https://apify.com/humble-echidna/bulk-image-downloader) reads this run's dataset with its URL
field set to `displayUrl`). `id` is stable
across runs, so you can use it to deduplicate. The run's `RUN_STATS` record lists every input, how many results it
gave, pages read and anything that failed, with the reason.

### Switching from another Instagram actor?

Most Instagram actors take links or usernames and a few switches. Here's where each goes:

| What you had | Put it here |
|---|---|
| Profile links or usernames (`directUrls`, `usernames`) | **Profiles, posts or reels** (`targets`), one per line; links and usernames can be mixed |
| Post, reel or IGTV links | `targets` too, in the same run as profiles |
| A content-type switch (posts, reels, details) | Not needed: a profile line gives the profile and its posts. **Only reels** (`onlyReels`) or a `/reels/` link for reels only; **Include the profile** off for posts only; **Posts per profile** 0 for profiles only |
| A results limit per profile (`resultsLimit`) | **Posts per profile** (`postsPerProfile`) |
| A date cutoff (`onlyPostsNewerThan`) | **Only posts newer than** (`newerThan`): the same date or relative forms |
| A "post details" or "add-on" setting | Not needed: every post comes in full (likes, comments count, date, media, collaborators, audio, first comments) |
| Hashtag, place or search inputs | Not available here: Instagram shows those only to signed-in accounts ([why](#limits)) |

What's different in the output: profiles and posts come in **one table**, one row per profile or post, every column
on every row (`type` says which). A carousel is one row with its photos in `carouselItems`. Field names that differ:
`likesCount`, `commentsCount`, `timestamp`, `displayUrl`, `videoUrl` and `ownerUsername` are what you'd expect; posts
from a profile carry the profile line in `input`.

### Run it on a schedule, or from your own code

1. Save your input as a [task](https://docs.apify.com/platform/actors/running/tasks) (**Save as a new task**, top right
   of the actor page) and add it to a [schedule](https://docs.apify.com/platform/schedules) (Console → Schedules →
   **Create new**).
2. Collect results: download the dataset as JSON, CSV or Excel; fetch the latest run's results from the
   [API](https://apify.com/humble-echidna/instagram-scraper/api)
   (`GET https://api.apify.com/v2/actor-tasks/<task id>/runs/last/dataset/items?status=SUCCEEDED&format=csv`, with
   your API token); let a [webhook](https://docs.apify.com/platform/integrations/webhooks) tell your system when a
   run succeeds; or connect it to Make, Zapier or n8n through
   [Apify's integrations](https://docs.apify.com/platform/integrations).

#### Can I use Instagram Scraper from an AI agent (MCP)?

Yes, through [Apify's MCP server](https://docs.apify.com/platform/integrations/mcp), from Claude, ChatGPT, Cursor or
any other MCP client. Add this to your client's MCP configuration (or let the agent find it with the server's actor
search); your client signs you in to Apify:

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=humble-echidna/instagram-scraper"
    }
  }
}
```

To use an [Apify API token](https://console.apify.com/settings/integrations) instead of signing in, add
`"headers": {"Authorization": "Bearer <APIFY_TOKEN>"}` next to `url`.

An agent should pass usernames or links and a small count, e.g.
`{"targets": ["natgeo"], "postsPerProfile": 10, "maxResults": 20}`.

### Who it's for

Social media and influencer marketers vetting creators (followers, engagement on recent posts, collabs), brands and
agencies tracking competitors' posts and reels, researchers collecting public posts over time, and anyone whose
dashboard or AI agent needs fresh Instagram numbers on a schedule instead of copying them by hand.

### Why this one?

- **Everything in one run and one table.** Profiles, posts, reels and single post links together; no separate actor
  or run per content type, no add-on events for post details.
- **Only new posts.** Schedule it and get just the posts published since the last run, per profile; quiet runs cost
  the start fee.
- **Full posts from a profile.** Likes, comments count, date, video URL and length, collaborators, tagged users,
  carousel items and audio for every post, not just the first page's summary.
- **It finishes.** On 2026-10-14 on Apify, 5 profiles × 100 posts plus a post link (506 results) took 180 s with no
  refusals; a visitor Instagram turns away is replaced by a new one, and a run refused everywhere stops early instead
  of hanging.
- **Reliable.** One failing input, or one post Instagram withholds, never affects the others. The run log and the
  `RUN_STATS` record say exactly which input had a problem and why.

### Limits

- **No hashtags, locations, search, stories, highlights, tagged posts or follower lists.** Instagram shows these only
  to signed-in accounts, and this actor never signs in, uses cookies or accounts. Those lines fail with the reason and
  aren't charged.
- **Comments:** the 10-15 that Instagram shows logged-out visitors, in its order, inside each post (`latestComments`);
  not all of them, and no replies.
- **Not in Instagram's logged-out data:** video view and play counts, the number of posts on a profile, business
  category and contact buttons. They're left out rather than guessed.
- **Private accounts:** only the profile result; their posts aren't public.
- **Counts are what logged-out visitors see** when the run reads them; Instagram may round or delay some.
- **Up to 2,000 posts per profile.** With **Only reels** or a date filter, the run reads at most five times the
  pages of 12 posts the count needs, plus three, to find them; `RUN_STATS` says so when it stops there.
- Instagram changes its web app often. When it renames the queries this actor uses, it reads the new names from
  Instagram's own pages; if Instagram changes more than that, inputs fail with a "changed its pages" reason until the
  actor is updated.

### FAQ

#### Is it legal to scrape Instagram?

This actor reads only what Instagram shows anyone who isn't signed in: public profiles and posts, through the same
requests instagram.com's own pages make in a browser. It never logs in, so it accepts no Instagram terms on your
behalf, and it can't see private accounts. Instagram's robots.txt disallows automated access and its Terms of Use
forbid collecting data by automated means without permission; a US federal court held in 2024 (Meta v. Bright Data)
that Meta's terms didn't bind a scraper of public data that never logged in, but the law differs by country. Results
include public usernames and comments, which are personal data in many places (GDPR and similar laws): have a lawful
reason, keep only what you need, and don't use it for spam or profiling people. How you use the data is up to you and
the laws that apply to you. An account owner who wants their account left out of this actor can open an issue.

#### Why did an input return nothing, or fewer results than expected?

The usual reasons: the account is private or doesn't exist, the line is a hashtag or other signed-in-only page, the
post was deleted or is age-restricted, or a filter (**Only reels**, **Only posts newer than**, **Only new**) skipped
the rest. The run log and `RUN_STATS` name the input and the reason, and every other input is unaffected. If
Instagram turned away every visitor, the inputs fail free; run it again later. Please open an issue with the input you
used if it keeps happening.

#### Can I get only new results since my last run?

Yes, for profiles: turn on **Only new posts since the last run**
([how](#monitor-instagram-profiles-get-only-new-posts-in-slack-email-or-a-webhook)). Post links are always returned.

#### How is this different from Instagram's official API?

Meta's Instagram Graph API gives full data for accounts you manage, and limited data on other business or creator
accounts through a business account of your own and an app review. This actor needs neither and works for any public
account, but only with what logged-out visitors can see.

### Related actors

| Actor | Use it when |
|---|---|
| [Bulk Image Downloader](https://apify.com/humble-echidna/bulk-image-downloader) | You want the images saved before Instagram's links expire (dataset input, URL field `displayUrl`) |
| [Dataset Transformer](https://apify.com/humble-echidna/dataset-transform) | You want the results filtered, renamed or flattened into your own CSV or Excel layout |
| [Dataset Diff](https://apify.com/humble-echidna/dataset-diff) | You want to see how followers or likes changed between two runs |
| [Audio & Video Transcriber](https://apify.com/humble-echidna/audio-transcriber) | You want reels' speech as text (dataset input, URL field `videoUrl`) |

### Feedback and support

Found a bug, or need a field that isn't here? Open an issue on the **Issues** tab with the input you used.

### Versions

Current version: **0.1**. See the Changelog tab for what changed in each version.

# Changelog

This Actor's version history is a separate document: https://apify.com/humble-echidna/instagram-scraper/changelog.md

# Actor input Schema

## `targets` (type: `array`):

One per line: a username (nasa), a profile link (https://www.instagram.com/nasa/), a profile's reels tab (https://www.instagram.com/nasa/reels/, reels only), or a post or reel link (https://www.instagram.com/p/DeTUk4sDSp-/). A profile gives a profile result plus its latest posts; a post link gives that post. Hashtag, location, story and search pages are refused: Instagram shows them only to signed-in accounts, and this actor never signs in.

## `postsPerProfile` (type: `integer`):

How many of each profile's latest posts to return, newest first (pinned posts come first, as on the profile). 0 returns only the profile. Default 12, at most 2000.

## `includeProfile` (type: `boolean`):

Return one profile result (name, bio, followers, following, links) for each profile line, before its posts. Turn it off to get only posts, e.g. when monitoring for new posts.

## `onlyReels` (type: `boolean`):

From profiles, return only reels (videos posted as reels), skipping photos, carousels and other videos. A /reels/ profile link does this for that line alone.

## `newerThan` (type: `string`):

Skip profile posts published before this: a date (2026-09-01), a date and time in UTC (2026-09-01T12:00:00Z), or an age (12 hours, 7 days, 2 weeks, 3 months). Paging stops once a whole page of posts is older. Empty: no date filter.

## `onlyNew` (type: `boolean`):

For schedules: return only profile posts published since the newest post this input returned before. Remembered per profile (and the reels filter) in a key-value store in your account, so the first run returns the latest posts and later runs only what's new. Post and reel links are always returned.

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

Stop after this many results in total (profiles and posts), e.g. 100. Minimum 1; leave empty (the default) for no limit. The run also stops cleanly at the maximum cost per run you set in the run options, whichever comes first.

## Actor input object example

```json
{
  "targets": [
    "https://www.instagram.com/nasa/"
  ],
  "postsPerProfile": 12,
  "includeProfile": true,
  "onlyReels": false,
  "onlyNew": false
}
```

# Actor output Schema

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

No description

## `runStats` (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 = {
    "targets": [
        "https://www.instagram.com/nasa/"
    ]
};

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

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,humble-echidna/instagram-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/KWu0g485BU8QKXWKf/builds/IFOxXIbvQ0QJqnwFl/openapi.json
