# Instagram Scraper (`vortex_data/instagram-scraper`) Actor

One Instagram scraper for everything — profiles, contacts (emails & phones), posts, reels, comments, likers, followers, following, tagged, stories, highlights, hashtags, locations & search. No code: paste usernames or URLs, export to Excel, CSV, JSON or API. Public data needs no login.

- **URL**: https://apify.com/vortex_data/instagram-scraper.md
- **Developed by:** [VortexData](https://apify.com/vortex_data) (community)
- **Categories:** Social media, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 369 total users, 64 monthly users, 100.0% runs succeeded, 4 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.10 / 1,000 profile / contacts / searches

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 is Instagram Scraper?

**Instagram Scraper extracts data from Instagram: profiles, contacts, posts, reels, comments, followers, likers, stories, highlights, hashtags and locations.** Use it to **monitor competitors, research influencers, find leads and track trends**. Paste **usernames or links**, choose what to scrape, and download the results as **Excel, CSV or JSON**. Profiles, contacts, posts, reels, comments and location posts work **without an Instagram login**.

**Try it for free:** press **Start** with the example input to get 20 recent posts each from [@humansofny](https://www.instagram.com/humansofny/) and [@natgeo](https://www.instagram.com/natgeo/). The free plan's $5 monthly credit covers about **4,000 posts or 2,200 profiles**.

#### What can Instagram Scraper do?

- 🧩 **All Instagram data in one Actor:** 15 modes, from profile details to hashtag posts.
- 🔓 **No login for public data:** you need an Instagram cookie only for the modes marked 🔑.
- 📅 **Date filters:** keep only posts, reels or stories from the last days or from a date range.
- 📇 **Lead generation:** get emails, phones and links from profile bios.
- ⏰ **Scheduling:** run it daily or weekly on the Apify platform to keep your data fresh.
- 📈 **Monitoring:** get alerted when a run fails or returns less data than usual.
- 🔌 **API and integrations:** get the data in Python or JavaScript, Google Sheets, Make, Zapier or a webhook.

#### What data can you extract from Instagram?

| Mode | What you get | What to paste | Login cookie |
|---|---|---|---|
| 👤 Profile details | Bio, links, follower and following counts, verified and business flags, highlights | username | not needed |
| 📇 Contacts | Emails, phones and links from the bio | username | not needed |
| 🖼️ Profile posts | Caption, likes, comments count, date, images, video, music, tagged users | username | not needed |
| 🎬 Profile reels | The same as posts, plus play counts | username | not needed |
| 📄 Post / Reel detail | One post or reel | post URL | not needed |
| 💬 Comments | Comment text, author, date, likes | post URL or username | not needed |
| ❤️ Likers | Accounts that liked a post | post URL or username | 🔑 needed |
| 👥 Followers / Following | A profile's followers or the accounts it follows | username | 🔑 needed |
| 🏷️ Tagged posts | Posts a profile is tagged in | username | 🔑 needed |
| 📸 Stories / ⭐ Highlights | Active stories or highlight items | username | 🔑 needed |
| #️⃣ Hashtag posts | Posts under a hashtag | `#tag` or hashtag URL | 🔑 needed |
| 📍 Location posts | Posts from a place | location URL or ID | not needed for about 70 recent and top posts; add a cookie for more |
| 🔎 Search | Profiles, hashtags or places matching a phrase | a search phrase | 🔑 needed |

If you paste a **username** into Comments or Likers, you get the comments or likers of that account's recent posts.

#### What can you do with Instagram data?

- 🔍 **Competitor monitoring:** see what your competitors post, how often, and which posts and reels get the most likes and views.
- 🤝 **Influencer research:** compare follower counts, engagement and recent posts before you contact a creator.
- 📇 **Lead generation:** collect emails, phones and websites of businesses in your niche.
- 💬 **Audience research:** read comments to learn what people like, ask for or complain about.
- \#️⃣ **Trend tracking:** follow hashtags and places to spot popular topics and content.
- 📊 **Reporting:** schedule a run and send fresh numbers to Google Sheets or your dashboard every week.

### How to scrape Instagram

1. [Create a free Apify account](https://console.apify.com/sign-up) and open Instagram Scraper.
2. Choose a mode in **What do you want to scrape?**
3. Paste usernames or URLs, one per line. `nike`, `@nike` and `https://www.instagram.com/nike/` all work.
4. Set **Results per input**: how many results you want from each line.
5. For a 🔑 mode, add your Instagram cookie (see [How to get your Instagram cookie](#how-to-get-your-instagram-cookie)).
6. Press **Start**. When the run finishes, open **Output**, pick the view for your data (for example **Posts & reels**, **Profiles** or **Contacts**) and export it.

#### How to get your Instagram cookie

1. Log in to [instagram.com](https://www.instagram.com/) in your browser.
2. Export your cookies with the **Cookie-Editor** or **EditThisCookie** browser extension.
3. Paste the export into **Instagram login cookie**.
4. In **Country you use Instagram from**, choose the country where you usually use Instagram. If your account is suddenly used from another country, Instagram may ask you to verify it.

⚠️ Use only your own cookie and don't share it with anyone: it gives access to your Instagram account.

#### Ready-to-run Instagram scraping tasks

Open a task, press **Try for free**, and change the usernames or dates to your own:

- 📈 [Track competitors' Instagram posts from the last 7 days](https://apify.com/vortex_data/instagram-scraper/examples/competitor-posts-last-7-days)
- 🎬 [Compare Instagram reel views of tech brands](https://apify.com/vortex_data/instagram-scraper/examples/tech-brand-reel-views)
- 👗 [Get follower counts and bios of fashion brands](https://apify.com/vortex_data/instagram-scraper/examples/fashion-brand-followers-and-bios)
- ⚽ [Compare Instagram followers of top football clubs](https://apify.com/vortex_data/instagram-scraper/examples/football-club-followers)
- 💬 [Collect comments on a brand's latest Instagram posts](https://apify.com/vortex_data/instagram-scraper/examples/comments-on-brand-latest-posts)
- 📰 [Monitor news outlets' Instagram posts from the last day](https://apify.com/vortex_data/instagram-scraper/examples/news-outlet-posts-last-day)
- 📇 [Extract emails, phones and links from Instagram bios](https://apify.com/vortex_data/instagram-scraper/examples/brand-websites-and-contacts-from-bios)
- 📅 [Download an Instagram account's posts for a date range](https://apify.com/vortex_data/instagram-scraper/examples/account-posts-for-a-date-range)

### Pricing

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

You pay for the results you get. The price per result depends on the type of data and on your Apify plan:

| Price per 1,000 results | Free plan | Starter | Scale | Business |
|---|---|---|---|---|
| 🖼️ Posts, reels, hashtag and location posts | $1.20 | $0.60 | $0.55 | $0.50 |
| 👤 Profiles, contacts, search results | $2.20 | $1.30 | $1.20 | $1.10 |
| 📸 Stories and highlight items | $0.80 | $0.40 | $0.35 | $0.30 |
| 💬 Comments | $0.60 | $0.30 | $0.25 | $0.20 |
| 👥 Followers, following, likers | $0.50 | $0.25 | $0.20 | $0.15 |

For example, 1,000 posts from 10 accounts cost $1.20 on the Free plan and $0.60 on the Starter plan. Results per input sets how many you get, and a maximum cost per run in the run options caps your spending.

If a line of your input leads nowhere for a reason about the input itself, such as an account that doesn't exist, a private account or a login cookie Instagram refused, you get one error row for that line instead of data. It says what happened and is charged as one result of the mode you chose. Lines that fail on our side are never charged.

#### Is scraping Instagram free?

You can scrape Instagram for free within Apify's free plan. It includes $5 of platform credit every month, which is enough for about 4,000 posts, 2,200 profiles or 8,000 comments.

On a paid plan, every result costs less and your monthly credit goes further. At Starter prices, $10 of credit buys about 16,600 posts or 7,700 profiles.

### Input and output examples

#### Input

The input is simple: choose a mode and paste usernames or links. Every other field is optional. Fill the form in the **Input** tab, or send the same fields as JSON through the API:

- **What do you want to scrape?** (`resultsType`): the mode, for example `posts`, `reels`, `details`, `contacts`, `comments` or `followers`.
- **Instagram URLs or usernames** (`directUrls`): one username, profile, post, hashtag or location per line.
- **Results per input** (`resultsLimit`): how many results to get from each line.
- 🔎 **Search phrase**, **Search for** and **Search matches** (`search`, `searchType`, `searchLimit`): find profiles, hashtags or places by a phrase instead of pasting them.
- 🔑 **Instagram login cookie** (`sessionCookies`) and **Country you use Instagram from** (`proxyCountry`): needed only for the 🔑 modes.
- 📅 **Only newer than** and **Only older than** (`onlyPostsNewerThan`, `onlyPostsOlderThan`): a date like `2026-01-15` or a period like `3 months`.
- **Add source info** (`addParentData`): add columns that say where each row came from.

This input gets 20 recent reels from @apple:

```json
{
  "resultsType": "reels",
  "directUrls": ["apple"],
  "resultsLimit": 20
}
```

#### Output

Each result is one row of your dataset. You can download it as JSON, CSV, Excel, XML or HTML, or read it through the API. The examples below are real rows, shortened.

**🎬 Posts and reels**

```json
{
  "url": "https://www.instagram.com/p/Ddt0zGgsis6/",
  "type": "Video",
  "caption": "A one-of-a-kind look at the world's most iconic structure. #ShotoniPhone18Pro ...",
  "hashtags": ["ShotoniPhone18Pro"],
  "likesCount": 47723,
  "commentsCount": 646,
  "videoPlayCount": 1928639,
  "videoDuration": 50.567,
  "timestamp": "2026-09-25T16:00:16.000Z",
  "displayUrl": "https://scontent.cdninstagram.com/...",
  "videoUrl": "https://scontent.cdninstagram.com/...mp4",
  "ownerUsername": "apple",
  "inputUrl": "https://www.instagram.com/apple/"
}
```

**👤 Profile details**

```json
{
  "username": "apple",
  "fullName": "apple",
  "biography": "Everyone has a story to tell.\n#ShotoniPhone",
  "followersCount": 37993640,
  "followsCount": 9,
  "verified": true,
  "isBusinessAccount": true,
  "externalUrl": "http://apple.co/Apple-Support"
}
```

**📇 Contacts**

```json
{
  "username": "cafe16",
  "biography": "• Food • Cake • Tea • Coffee • Wine •\r\n\r\nNakhon Rachasima - Thailand\r\ncontact : 044 353 116\r\ne-mail : cafe.sixteen@gmail.com ...",
  "followersCount": 123,
  "emails": ["cafe.sixteen@gmail.com"],
  "phones": ["044353116"],
  "inputUrl": "https://www.instagram.com/cafe16/"
}
```

**💬 Comments**

```json
{
  "postUrl": "https://www.instagram.com/p/Ddt0zGgsis6/",
  "commentUrl": "https://www.instagram.com/p/Ddt0zGgsis6/c/18108919220179128/",
  "text": "❤️❤️❤️❤️",
  "timestamp": "2026-09-28T15:26:18.000Z",
  "likesCount": 0,
  "ownerUsername": "jamu.n792",
  "ownerIsVerified": false
}
```

**👥 Followers, following and likers**

```json
{
  "username": "mr.pjane_",
  "fullName": "PJ",
  "isPrivate": true,
  "isVerified": false,
  "profilePicUrl": "https://scontent.cdninstagram.com/...",
  "inputUrl": "https://www.instagram.com/natgeo/"
}
```

**⚠️ Error rows**

```json
{
  "inputUrl": "https://www.instagram.com/zq1_nosuchuser_7919/",
  "error": "not_found",
  "errorMessage": "Instagram has no such account, post or place: it was deleted, renamed or mistyped."
}
```

**📸 Stories and highlights**

```json
{
  "url": "https://www.instagram.com/stories/natgeo/3995540021612466512/",
  "type": "Video",
  "timestamp": "2026-09-27T16:12:04.000Z",
  "dimensionsHeight": 1280,
  "dimensionsWidth": 720,
  "displayUrl": "https://scontent.cdninstagram.com/..."
}
```

#### How to scrape Instagram posts from the last 7 days

Track what your competitors published this week:

```json
{
  "resultsType": "posts",
  "directUrls": ["nike", "adidas", "puma"],
  "resultsLimit": 100,
  "onlyPostsNewerThan": "7 days"
}
```

You get each brand's posts from the last 7 days, up to 100 per brand. Relative dates like `2 weeks` or `3 months` work too.

#### How to scrape Instagram posts from a date range

```json
{
  "resultsType": "posts",
  "directUrls": ["natgeo"],
  "resultsLimit": 500,
  "onlyPostsNewerThan": "2026-01-01",
  "onlyPostsOlderThan": "2026-03-31"
}
```

You get up to 500 of @natgeo's posts published in the first quarter of 2026.

#### How to compare Instagram reel views

```json
{
  "resultsType": "reels",
  "directUrls": ["apple", "samsung"],
  "resultsLimit": 30
}
```

Each reel comes with `videoPlayCount`, `likesCount` and `commentsCount`, so you can compare which reels performed best.

#### How to scrape Instagram comments from a post

```json
{
  "resultsType": "comments",
  "directUrls": ["https://www.instagram.com/p/Ddt0zGgsis6/"],
  "resultsLimit": 500
}
```

You get up to 500 comments with their text, author and date. No cookie needed.

#### How to scrape comments from an account's recent posts

```json
{
  "resultsType": "comments",
  "directUrls": ["apple"],
  "resultsLimit": 300
}
```

Paste the account instead of post URLs. The 300 results are spread over the account's recent posts, not 300 per post.

#### How to extract emails and phone numbers from Instagram

```json
{
  "resultsType": "contacts",
  "directUrls": ["starbucks", "https://www.instagram.com/p/Ddt0zGgsis6/"]
}
```

You get one row per profile with the emails, phones and links from its bio. A post URL works too: you get the contacts of the account that posted it.

#### How to find Instagram profiles by name and get their contacts

```json
{
  "resultsType": "contacts",
  "search": "bakery",
  "searchType": "profile",
  "searchLimit": 50,
  "sessionCookies": "<your Instagram cookie>"
}
```

The search finds up to 50 profiles and returns their contacts. Instagram matches the phrase against account names and usernames, not against the bio, so use words people put in their names.

#### How to scrape Instagram followers

```json
{
  "resultsType": "followers",
  "directUrls": ["natgeo"],
  "resultsLimit": 1000,
  "sessionCookies": "<your Instagram cookie>"
}
```

You get up to 1,000 followers with username, full name, profile picture and private and verified flags. Use `"following"` to get the accounts a profile follows.

#### How to scrape Instagram posts by hashtag or location

```json
{
  "resultsType": "hashtag",
  "directUrls": ["#streetphotography"],
  "resultsLimit": 200,
  "sessionCookies": "<your Instagram cookie>"
}
```

For a place, use `"resultsType": "location"` and paste the place's URL from Instagram, which looks like `https://www.instagram.com/explore/locations/{id}/`, or just the ID. A place works without a cookie too: you get its recent and top posts, about 70 of them. Add a cookie to go further.

#### How to scrape many Instagram accounts into one dataset

```json
{
  "resultsType": "posts",
  "directUrls": ["nike", "adidas", "puma", "reebok", "newbalance"],
  "resultsLimit": 50
}
```

Every row has `inputUrl`, the line it came from, so you can filter or group one dataset by account.

### Other scrapers

| Actor | What it does |
|---|---|
| 🗺️ [Google Maps Scraper](https://apify.com/vortex_data/google-maps) | Extracts businesses from Google Maps for lead generation and market research. |
| 📊 [Similarweb Scraper](https://apify.com/vortex_data/similarweb-scraper) | Gets any website's traffic, rankings, top keywords, competitors and WHOIS from Similarweb. |

### FAQ

#### Is it legal to scrape Instagram?

The Actor collects only data that Instagram shows publicly, or that your own account can see. This data can include personal information protected by GDPR and similar laws, so use it only for legitimate purposes. If you are unsure, consult a lawyer. Read more in [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

#### Do I need an Instagram login cookie?

**Yes** for the 🔑 modes: likers, followers, following, tagged, stories, highlights, hashtag and search. Instagram shows this data only to logged-in users, so these modes need your login cookie. The other modes work without it. Location posts are shown to everyone only up to about 70 posts per place; with a cookie you can get more.

#### Instagram Scraper or the official Instagram API?

| | Instagram Scraper | Official Instagram API |
|---|---|---|
| Whose data | Any public profile, post, hashtag or place | Mainly your own business or creator account |
| What you need | An Apify account; a cookie only for 🔑 modes | A business account, a Meta app and app review |
| Comments, followers, likers of other accounts | ✅ | ❌ |
| Export to Excel, CSV, JSON | ✅ built in | ❌ you write the code |

#### How to use the Instagram API in Python?

Start runs and download results with the [Apify API](https://docs.apify.com/api/v2). The **API** tab has ready-to-use code for Python, JavaScript and other languages. A Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("vortex_data/instagram-scraper").call(run_input={
    "resultsType": "details",
    "directUrls": ["apple", "nike"],
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["username"], item["followersCount"])
```

#### Can I connect Instagram Scraper to other apps?

Yes. With [Apify integrations](https://docs.apify.com/platform/integrations) you can send results to Google Sheets, Slack, Make, Zapier, Airbyte or your own webhook after every run. Combine it with a [schedule](https://docs.apify.com/platform/schedules) to get fresh Instagram data every day.

#### How do I get the most out of it?

- Set **Results per input** to what you need: you pay per result.
- Use **Only newer than** to get recent posts only. The run stops reading an account once its posts get older than the date.
- Put many accounts into one run instead of starting one run per account.
- Turn on **Add source info** if you mix profiles, hashtags and posts in one run and want to group the rows later.

#### Why are some fields empty?

Instagram doesn't show some data to visitors who aren't logged in. Without a cookie, a profile's number of posts, business email and business phone stay empty. To collect emails and phones, use Contacts mode: it finds them in the bio.

#### Why did I get fewer results than I asked for?

The account has fewer posts than you asked for, or Instagram limits the list. For example, Instagram shows only about 100 likers per post. To get more likers, paste a username instead of a post URL: the results come from several of the account's recent posts.

#### Can I scrape private accounts?

You can get their public profile information. Their posts are visible only to approved followers.

#### Can I download photos and videos?

Each post, reel and story contains links to its images and videos. The links **expire after a few days**, so download the files you want to keep.

#### Does it collect replies to comments?

No. Comments mode collects top-level comments.

#### A run returned no results. What should I do?

Look for error rows in the dataset: the `error` and `errorMessage` columns say why a line gave nothing, for example that the account doesn't exist or is private. The end of the run's log says the same. If it looks like a bug, let us know on the **Issues** tab.

#### Need help or a custom solution?

Open an issue on the **Issues** tab and include the link to your run. You can also ask there if you need a custom version of this Actor.

# Changelog

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

# Actor input Schema

## `resultsType` (type: `string`):

Choose what to scrape. Each line you paste below is read for this mode.<br>🔑 Modes with a key need your Instagram login cookie (see the 🔑 section below).

## `directUrls` (type: `array`):

Paste one item per line:<ul><li><b>Profile modes</b>: a username, <code>@username</code> or <code>instagram.com/username/</code>. A post URL works too: you get its author.</li><li><b>Post / Reel detail, Comments, Likers</b>: a post or reel URL. Comments and Likers also accept a username: you get the comments or likers of that account's recent posts.</li><li><b>Hashtag posts</b>: <code>#tag</code>, <code>tag</code> or <code>instagram.com/explore/tags/tag/</code>.</li><li><b>Location posts</b>: a location ID or <code>instagram.com/explore/locations/ID/</code>.</li><li><b>Search</b>: leave empty and use the 🔎 Search section.</li></ul>Lines that don't fit the mode are skipped, and the log says why.

## `resultsLimit` (type: `integer`):

Enter how many results to get from each line. For example, 50 with 3 usernames gives up to 150 posts.<br>When you paste a username into Comments or Likers, the number is spread over the account's recent posts. Instagram shows at most about 100 likers per post.

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

Enter a word or name to search for on Instagram, for example <code>bakery</code>. Profile search matches account names and usernames, not the bio. Use one phrase per run.

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

Choose what the search should find.

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

Enter how many search matches to scrape.

## `sessionCookies` (type: `string`):

Paste the cookies of your logged-in Instagram session. Export them with the <b>Cookie-Editor</b> or <b>EditThisCookie</b> browser extension, or copy the <code>Cookie</code> header from your browser. The export must contain <code>sessionid</code>.<br>Use only your own account and never share your cookie: it gives access to your account. <a href="https://apify.com/vortex_data/instagram-scraper#how-to-get-your-instagram-cookie" target="_blank">How to get your cookie</a>

## `proxyCountry` (type: `string`):

Choose the country where you usually use Instagram. If your account is suddenly used from another country, Instagram may challenge the login and ask you to verify it. Leave <b>Automatic</b> if you don't use a cookie.

## `onlyPostsNewerThan` (type: `string`):

Enter a date (<code>2026-01-15</code>) or a period (<code>3 months</code>) to keep only newer items. Works for posts, reels, tagged posts, hashtag and location posts, stories and highlights.

## `onlyPostsOlderThan` (type: `string`):

Enter a date (<code>2026-03-31</code>) or a period (<code>1 week</code>) to keep only older items. Combine with <b>Only newer than</b> for a date range.

## `addParentData` (type: `boolean`):

Turn on to add columns saying where each row came from: <code>dataSource</code> and the source profile, hashtag, place, post or highlight. Every row already has <code>inputUrl</code>, the line it came from.

## Actor input object example

```json
{
  "resultsType": "posts",
  "directUrls": [
    "nike",
    "@adidas",
    "https://www.instagram.com/puma/"
  ],
  "resultsLimit": 50,
  "search": "bakery",
  "searchType": "profile",
  "searchLimit": 20,
  "proxyCountry": "",
  "onlyPostsNewerThan": "3 months",
  "onlyPostsOlderThan": "2026-03-31",
  "addParentData": false
}
```

# Actor output Schema

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

All rows of the run's default dataset.

## `runReport` (type: `string`):

A readable summary of the run: what was scraped from each line, what was skipped and why.

# 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 = {
    "directUrls": [
        "humansofny",
        "https://www.instagram.com/natgeo/"
    ],
    "resultsLimit": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("vortex_data/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 = {
    "directUrls": [
        "humansofny",
        "https://www.instagram.com/natgeo/",
    ],
    "resultsLimit": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("vortex_data/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 '{
  "directUrls": [
    "humansofny",
    "https://www.instagram.com/natgeo/"
  ],
  "resultsLimit": 20
}' |
apify call vortex_data/instagram-scraper --silent --output-dataset

```

## MCP server setup

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