# Instagram Posts (0.3$/1K 🤑) (`karamelo/instagram-posts`) Actor

Cost-efficient (0.3$/1K 🤑) Instagram scraper for extracting posts from public profiles.

- **URL**: https://apify.com/karamelo/instagram-posts.md
- **Developed by:** [karamelo](https://apify.com/karamelo) (community)
- **Categories:**
- **Stats:** 3 total users, 2 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.30 / 1,000 posts

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

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

### What is Instagram Posts Scraper?

Instagram Posts Scraper is a high-performance, cost-efficient data extraction automation built for gathering comprehensive public post data from Instagram profiles. Designed specifically for data analysts, digital marketers, brand strategists, and software engineers, this Actor extracts public feed posts, captions, media assets, engagement counts, and author details at scale without requiring browser automation overhead, login credentials, or user cookies.

Instagram represents one of the largest public visual repositories in the world, with billions of interactions occurring daily across fashion, e-commerce, entertainment, sports, and technology. Accessing this data systematically has traditionally required heavyweight browser sessions that consume substantial computing memory and bandwidth. Instagram Posts Scraper eliminates this overhead by interacting directly with public endpoint structures, drastically reducing resource consumption and execution latency while maintaining data fidelity.

Whether your organization requires continuous competitive tracking across hundreds of industry brands, daily social listening audits, or one-time historical datasets for machine learning models, this Actor provides a reliable, scalable foundation with configurable concurrency, rate limiting, and incremental scraping controls.

***

### Why choose this Actor?

When evaluating Instagram scraping solutions on the Apify Store, execution cost, reliability, and data completeness are the most critical criteria. Instagram Posts Scraper delivers significant advantages across all three dimensions:

- **Ultra-lightweight compute footprint** — Operating within a 256MB to 512MB memory boundary, this Actor avoids running heavy browser engines, saving up to eighty percent of standard compute costs compared to browser-based scrapers.
- **Zero authentication or session management** — The Actor scrapes purely public profile content, eliminating the risk of personal account suspensions, cookie expiration, two-factor authentication hurdles, or session invalidation.
- **Full media and metadata fidelity** — Captures all public post formats, including single images, video clips, and multi-slide carousel albums, alongside high-resolution media candidate URLs, video durations, view counts, and engagement tallies.
- **Incremental scraping boundary controls** — Use the `newerThan` configuration parameter to automatically halt pagination once posts cross your designated cutoff date, making scheduled daily and weekly monitoring runs fast and economical.
- **Resilient rate management and retries** — Built-in exponential backoff retry mechanisms, randomized browser fingerprints, and staggered worker concurrency prevent unnecessary request bursts and maximize success rates.
- **Standardized flat and nested data** — Dataset records conform to strict schemas optimized for direct tabular querying, CSV export into business intelligence software, or programmatic ingestion via JSON.
- **Operational transparency with Run Summary** — Every execution automatically records a comprehensive `RUN_SUMMARY` record in the default Key-Value Store, providing immediate visibility into total profiles processed, success rates, failure diagnostics, and timings.

***

### Core Features and Capabilities

Instagram Posts Scraper is packed with production-ready features engineered to handle real-world scraping workloads:

#### Multi-Format Target Input Normalization

You do not need to manually clean or reformat your input lists before running the Actor. The input processor automatically handles:

- Plain Instagram usernames (such as `natgeo` or `nike`)
- Usernames prefixed with handle symbols (such as `@cristiano`)
- Full canonical profile URLs (such as `https://www.instagram.com/instagram/`)
- URLs with trailing slashes, query parameters (`?hl=en`), or fragments

The normalization engine filters out duplicates and automatically detects and skips invalid URL structures (such as direct post or reel links entered as profiles) without crashing the remaining batch.

#### Comprehensive Post Data Extraction

Every record delivered to the Apify dataset contains structured fields covering:

- **Stable Identifiers:** Unique numeric post identifier (`pk`), full media identifier (`id`), and shortcode (`code`).
- **Canonical Post URLs:** Direct, permanent web link to view the post on Instagram (`post_url`).
- **Publication Timestamps:** Exact Unix epoch timestamp (`taken_at`) allowing precise temporal sorting and filtering.
- **Media Classification:** Numeric media type code (`1` for photos, `2` for videos, `8` for carousel albums) and product type strings.
- **Full Captions:** Caption identifier and complete text content, preserving emojis, line breaks, and hashtags.
- **Engagement Metrics:** Verified like counts and total public comment counts.
- **Author Summary:** Author profile identifier, username, full display name, verification status (`is_verified`), and avatar image URL.
- **Multi-Resolution Visual Assets:** High-resolution candidate arrays for images and video download streams with dimensions, durations, and view counts.
- **Carousel Albums:** Individual media items and dimensions for posts containing multiple photos or video clips.
- **Tagging and Collaborations:** User tags with coordinate metadata and tagged co-author profiles.
- **Location Details:** Tagged physical locations, city names, and Instagram location identifiers.

#### Intelligent Incremental Pagination

For recurring monitoring pipelines, re-scraping the entire profile history is wasteful. By specifying the `newerThan` parameter (accepting ISO 8601 strings, calendar dates like `2026-01-01`, or Unix timestamps), the scraper checks publication dates on each fetched page. The moment an entire page of posts falls before your cutoff boundary, pagination gracefully stops. Furthermore, each output item is annotated with `newer_than_cutoff`, `newer_than_cutoff_iso`, and a boolean `is_newer_than_cutoff` flag.

***

### Business Use Cases and Workflows

Enterprises and individuals leverage Instagram Posts Scraper across a wide variety of commercial and analytical applications:

#### Competitive Intelligence and Brand Benchmarking

Keep tabs on competitor promotional strategies, product launch schedules, and audience reactions. By tracking multiple rival brand accounts on a weekly schedule, marketing analysts can measure publication frequency, identify peak engagement hours, and analyze which post formats (video clips versus carousels) yield superior interaction rates.

#### Influencer Discovery and Campaign Auditing

Before investing marketing budgets in sponsored influencer partnerships, agencies can audit candidate creator profiles. Analyze recent post consistency, verify engagement metrics across recent campaigns, evaluate hashtag consistency, and confirm whether creator engagement matches follower baselines.

#### Content Strategy and Trend Discovery

Digital publishers and social media managers utilize extracted post data to analyze high-performing visual themes, caption messaging, and trending hashtags within specific niches. Exporting thousands of posts into data warehouses allows data teams to run semantic text analysis and sentiment scoring over caption text.

#### E-Commerce Product Research and UGC Aggregation

Retailers monitor brand mentions, user-generated content, and visual reviews by scraping relevant creator profiles. Aggregated image URLs and caption feedback inform product development, merchandising decisions, and authentic social proof integration for e-commerce storefronts.

#### Machine Learning and Computer Vision Datasets

Data science teams collecting large datasets for training computer vision models, aesthetic scoring algorithms, or natural language processing models can extract thousands of structured records with categorized image resolutions and corresponding text descriptions in minutes.

***

### Step-by-Step Onboarding Guide

Starting your first scrape takes under two minutes:

1. **Open the Actor in Apify Console:** Navigate to the Instagram Posts Scraper page and select **Try for free** or click **Start**.
2. **Specify Target Profiles:** In the **Instagram Usernames or Profile URLs** input field, enter one or more Instagram usernames or profile URLs (for example, `instagram`, `@natgeo`, or `https://www.instagram.com/nike/`).
3. **Set Post Limit:** Configure **Posts per profile** to specify how many posts you want per account (for testing, start with a conservative number like `10` or `24`).
4. **Choose Proxy Configuration:** Ensure **Proxy Configuration** is enabled using Apify Proxy. US Residential proxies provide optimal stability for Instagram data extraction.
5. **Run the Actor:** Click the **Save & Run** button at the bottom of the page. Watch the live console log as profiles are processed and posts are streamed directly into your default dataset.
6. **Export Your Results:** Once the run status changes to **Succeeded**, switch to the **Storage** tab. Download your dataset in JSON, CSV, Excel, XML, or HTML format.

***

### Input Configuration Reference

The Actor accepts configuration through a standardized JSON input schema. All parameters are documented below:

| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
| `usernames` | Array of Strings | *Required* | **Yes** | List of Instagram usernames, `@handles`, or full profile URLs to extract. Example: `["natgeo", "@nike", "https://www.instagram.com/cristiano/"]`. Supports up to 4,000 items per batch. |
| `postsPerProfile` | Integer | `24` | No | The exact maximum number of posts to export for each profile. Valid values range from `1` to `500`. Pagination terminates as soon as this limit is reached. |
| `newerThan` | String | `null` | No | Incremental scraping date cutoff. Accepts ISO-8601 strings (e.g. `2026-01-01T00:00:00Z`), calendar dates (`YYYY-MM-DD`), or Unix timestamps. Halts pagination when older posts are encountered. |
| `proxy` | Object | Apify Proxy | No | Apify Proxy configuration object. Residential proxies with US country routing are strongly recommended for maximum reliability. |
| `delayBetweenProfiles` | Integer | `250` | No | Delay in milliseconds between starting consecutive profiles. Prevents sudden request spikes across parallel workers. Range: `0` to `10000`. |
| `delayBetweenRequests` | Integer | `500` | No | Delay in milliseconds between pagination requests for the same profile. Range: `0` to `10000`. |
| `maxRetries` | Integer | `3` | No | Maximum number of retry attempts for failed network requests before marking a profile step as failed. Range: `1` to `10`. |
| `maxConcurrentProfiles` | Integer | `10` | No | Number of profiles processed concurrently in parallel. Lower values (`3` to `10`) improve stability on large profile batches. Range: `1` to `50`. |

***

### Practical Input Examples

#### 1. Minimal Quick Run

Ideal for a fast test scrape of a single profile:

```json
{
  "usernames": [
    "instagram"
  ],
  "postsPerProfile": 12
}
```

#### 2. Multi-Profile Competitive Benchmarking

Scrape a curated set of competitors with residential proxy support:

```json
{
  "usernames": [
    "nike",
    "adidas",
    "puma",
    "underarmour"
  ],
  "postsPerProfile": 50,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  },
  "delayBetweenProfiles": 500,
  "delayBetweenRequests": 750,
  "maxConcurrentProfiles": 5
}
```

#### 3. Incremental Daily Monitoring Run

Scheduled execution collecting only posts published since the start of the week:

```json
{
  "usernames": [
    "https://www.instagram.com/natgeo/",
    "https://www.instagram.com/nasa/"
  ],
  "postsPerProfile": 100,
  "newerThan": "2026-09-01T00:00:00Z",
  "proxy": {
    "useApifyProxy": true
  }
}
```

***

### Output Data Structure

The Actor pushes structured items into the default Apify Dataset. Below is the complete field mapping for each post record:

| Field | Type | Description |
|---|---|---|
| `pk` | String | Unique numeric identifier for the post assigned by Instagram. |
| `id` | String | Full media identifier string (often composed of pk and author id). |
| `code` | String | Alphanumeric shortcode used in the canonical post web URL. |
| `post_url` | String | Direct canonical web URL to view the post (`https://www.instagram.com/p/{code}/`). |
| `scraped_username` | String | Target username requested in the input that owns this post. |
| `taken_at` | Integer | Unix epoch timestamp (seconds) indicating when the post was published. |
| `media_type` | Integer | Media classification code: `1` (photo), `2` (video clip/reel), `8` (carousel). |
| `product_type` | String | Instagram product categorization (`feed`, `clips`, `carousel_container`). |
| `like_count` | Integer | Total count of public likes received by the post. |
| `comment_count` | Integer | Total count of public comments posted under the item. |
| `caption` | Object | Object containing `pk` (caption ID) and `text` (caption content string). |
| `user` | Object | Author profile summary including `pk`, `username`, `full_name`, `is_verified`, and `profile_pic_url`. |
| `image_versions2` | Object | Contains candidate arrays of image assets sorted by dimensions and URLs. |
| `video_versions` | Array | Array of video download streams with dimensions and bitrate (for video posts). |
| `video_duration` | Number | Duration of the video in seconds (null for photos). |
| `view_count` | Integer | Total video view count (if reported by Instagram). |
| `play_count` | Integer | Total video play count (if reported by Instagram). |
| `carousel_media` | Array | Detailed media list for each individual slide within a multi-slide carousel post. |
| `usertags` | Object | Contains tagged user objects with account usernames and screen coordinates. |
| `coauthor_producers` | Array | Profiles collaborating as recognized co-authors on the post. |
| `location` | Object | Location metadata including location name and identifier when tagged. |
| `scraped_at` | Integer | Unix epoch timestamp (seconds) when this record was scraped. |
| `newer_than_cutoff` | Integer | Unix timestamp boundary passed in the input (if specified). |
| `newer_than_cutoff_iso` | String | ISO representation of the incremental cutoff (if specified). |
| `is_newer_than_cutoff` | Boolean | Boolean flag indicating whether this post is newer than the cutoff. |

#### Sample Output Record

```json
{
  "pk": "3983211470613048091",
  "id": "3983211470613048091_25025320",
  "code": "DdHNbqDJusb",
  "post_url": "https://www.instagram.com/p/DdHNbqDJusb/",
  "scraped_username": "instagram",
  "taken_at": 1789056002,
  "media_type": 2,
  "product_type": "clips",
  "like_count": 393550,
  "comment_count": 8270,
  "caption": {
    "pk": "17884947270618045",
    "text": "Every room is its own world 🖊️\n\nInside each space: imaginary architecture and intricate detail."
  },
  "user": {
    "pk": "25025320",
    "username": "instagram",
    "full_name": "Instagram",
    "is_verified": true,
    "profile_pic_url": "https://instagram.fna.fbcdn.net/v/t51.2885-19/avatar.jpg"
  },
  "image_versions2": {
    "candidates": [
      {
        "width": 720,
        "height": 1280,
        "url": "https://instagram.fna.fbcdn.net/v/t51.2885-15/cover.jpg"
      }
    ]
  },
  "video_duration": 34.5,
  "view_count": 1250000,
  "play_count": 1840000,
  "scraped_at": 1789058100,
  "newer_than_cutoff": 1788500000,
  "newer_than_cutoff_iso": "2026-09-05T00:00:00.000Z",
  "is_newer_than_cutoff": true
}
```

***

### Key-Value Store Run Summary

In addition to dataset records, every run writes a diagnostic summary under the key `RUN_SUMMARY` in the default Key-Value Store. This summary provides instant transparency into job health:

```json
{
  "totalInputProfiles": 4,
  "uniqueProfiles": 4,
  "successfulProfiles": 4,
  "failedProfiles": 0,
  "totalPostsSaved": 96,
  "startedAt": "2026-09-12T13:00:00.000Z",
  "finishedAt": "2026-09-12T13:02:15.000Z",
  "failures": []
}
```

If an individual profile fails (for example, if the profile was set to private or deleted), the specific error message and username are recorded in the `failures` array while the remaining batch continues without interruption.

***

### Export Formats and Downstream Delivery

Apify provides flexible data export options directly from the Console or through REST API calls:

- **JSON & JSONL** — Ideal for programmatic processing in Node.js, Python, or ingestion into document databases.
- **CSV & Excel (.xlsx)** — Perfect for spreadsheet analysis, pivot tables, and importing into marketing dashboards.
- **XML & HTML** — Useful for legacy enterprise feeds and immediate human inspection in a web browser.

You can also use Apify dataset filtering options to download only specific columns (such as `post_url`, `like_count`, and `caption.text`) to optimize file transfer sizes.

***

### Cost Transparency and Optimization Tips

Because Instagram Posts Scraper operates without rendering full browser sessions, it is exceptionally cost-effective. Here are best practices to maximize your compute budget:

1. **Target exact post quotas:** Do not set `postsPerProfile` higher than your actual requirement. If you only need the latest 10 posts, keep the limit at `10` or `12` (one single API page).
2. **Leverage `newerThan` for recurring jobs:** Instead of fetching 100 posts every day, set `newerThan` to 24 hours ago. The Actor will stop fetching as soon as it reaches yesterday's posts.
3. **Use Apify Residential Proxies:** While datacenter proxies are cheaper, Instagram frequently blocks datacenter IP ranges. Residential proxies ensure uninterrupted pagination and prevent wasted retries.
4. **Tune Concurrency:** Running 5 to 10 concurrent profiles offers the optimal balance between completion speed and proxy session longevity.

***

### Automating with Apify API and Clients

You can trigger runs, monitor status, and consume dataset results programmatically using official Apify clients.

#### Node.js Example

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

const client = new ApifyClient({
    token: process.env.APIFY_TOKEN,
});

const input = {
    usernames: ['natgeo', 'nike'],
    postsPerProfile: 20,
    proxy: {
        useApifyProxy: true,
    },
};

// Start the Actor run and wait for completion
const run = await client.actor('karamelo/instagram-posts').call(input);

// Fetch results from the default dataset
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Retrieved ${items.length} posts.`);
items.forEach((post) => {
    console.log(`[${post.scraped_username}] ${post.post_url} - Likes: ${post.like_count}`);
});
```

#### Python Example

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.getenv('APIFY_TOKEN'))

actor_input = {
    'usernames': ['natgeo', 'nike'],
    'postsPerProfile': 20,
    'proxy': {
        'useApifyProxy': True
    }
}

    # Run the Actor and wait for it to finish
run = client.actor('karamelo/instagram-posts').call(run_input=actor_input)

    # Iterate through dataset items
for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(f"[{item.get('scraped_username')}] {item.get('post_url')} - Likes: {item.get('like_count')}")
```

#### REST API (cURL) Example

```bash
curl -X POST "https://api.apify.com/v2/acts/karamelo~instagram-posts/runs?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "usernames": ["natgeo"],
    "postsPerProfile": 15
  }'
```

***

### Third-Party Integrations

Connect Instagram Posts Scraper directly to your existing business stack:

- **Google Sheets:** Automatically append new post records to a shared tracking spreadsheet using Apify's Google Sheets integration.
- **Make (Integromat) & Zapier:** Build zero-code trigger workflows that send Slack alerts when a competitor publishes a post with extraordinary like velocity.
- **Webhooks:** Configure run-completion webhooks that trigger downstream data ingestion microservices or ETL pipelines the moment a scrape finishes.
- **Cloud Storage:** Deliver CSV or JSON files automatically to Amazon S3, Google Cloud Storage, or Azure Blob storage for enterprise data lake integration.

***

### Limitations and Boundaries

To ensure realistic project planning, please observe the following technical scope boundaries:

- **Public Profiles Only:** The Actor cannot extract posts from private profiles or accounts that require accepted follow requests.
- **Stories and Highlights:** This Actor focuses exclusively on permanent timeline posts (photos, video clips, reels, and carousel albums). Instagram Stories and Highlights require authentication and are not supported.
- **Comments Content:** While the total number of comments (`comment_count`) is collected for each post, individual comment text and user replies are not extracted. Use a dedicated comments scraper for comment analysis.
- **Platform Rate Limits:** Instagram enforces dynamic rate limits based on IP reputation. Always use Apify Proxy (Residential preferred) when scraping batches exceeding a few profiles.

***

### Troubleshooting and Error Recovery

If you encounter unexpected results, review these common troubleshooting checks:

- **No posts returned for a profile:** Verify that the username is spelled correctly and that the account is publicly accessible in a private browser window. If the profile has zero published posts or is restricted in certain regions, no items will be emitted.
- **HTTP 429 Too Many Requests:** This indicates that the target endpoint is applying temporary rate controls to the active IP. The Actor automatically retries with backoff delays, but you can also increase `delayBetweenRequests` or decrease `maxConcurrentProfiles`.
- **404 Not Found error in Run Summary:** The requested username does not exist on Instagram or has recently changed its handle.
- **Timeout on large batches:** When scraping hundreds of profiles in a single run, increase your run timeout in the Apify Console or split large lists into separate scheduled batches.

***

### Frequently Asked Questions (FAQ)

#### Do I need an Instagram account or login cookies to use this Actor?

No. Instagram Posts Scraper operates without logging into any Instagram account. You do not need to share passwords, session cookies, or tokens.

#### How many posts can I extract per profile?

You can configure between 1 and 500 posts per profile. For general monitoring, 24 to 50 posts are typical. Extracting deeper historical archives is possible as long as Instagram's pagination cursor remains valid for the target account.

#### How does the `newerThan` incremental filter work?

The `newerThan` filter instructs the scraper to stop paginating once all posts on a fetched page have publication timestamps prior to your boundary. This saves proxy bandwidth and compute time by avoiding older posts.

#### Can I scrape Instagram Reels and Video posts?

Yes. Feed video clips and Instagram Reels published to the profile's main timeline are captured with video download URLs, durations, play counts, and view counts.

#### What is the difference between this Actor and browser-based scrapers?

Browser scrapers launch full Chromium instances that render CSS, execute complex client scripts, and download layout assets, consuming 4GB to 8GB of memory. This Actor retrieves the underlying structured response directly, running reliably in 512MB memory at a fraction of the cost.

#### Can I run this Actor on a schedule?

Yes. Using Apify Schedules, you can set the Actor to run hourly, daily, or weekly. Combine this with the `newerThan` parameter to capture only newly published content on each cycle.

#### Is Instagram data scraping legal?

Extracting publicly accessible data that does not require login or bypass security controls is standard industry practice. However, you should ensure that your use of the data complies with local privacy regulations (such as GDPR or CCPA) and Instagram's Terms of Service. Do not extract private personal information or use the data for unsolicited marketing.

***

### Responsible Data Collection and Compliance

We are committed to ethical and responsible data automation:

- This Actor extracts only publicly available information that creators and brands have published openly to the web.
- It does not bypass login firewalls, access private direct messages, or extract non-public contact details.
- Users are responsible for complying with applicable privacy legislation when processing user-generated content and respecting creator copyright across extracted media assets.

# Actor input Schema

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

List of Instagram usernames, @usernames, or profile URLs. Example: natgeo, @nike, https://www.instagram.com/instagram/

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

Maximum number of posts to export per profile. The Actor stops as soon as this exact limit is reached.

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

Pagination cutoff for incremental scraping. Accepts ISO date/time, YYYY-MM-DD, or Unix timestamp. The Actor stops once a fetched page has no posts newer than this cutoff.

## `proxy` (type: `object`):

Apify proxy configuration to avoid blocking

## `delayBetweenProfiles` (type: `integer`):

Minimum global delay in milliseconds between starting profiles to prevent request bursts.

## `delayBetweenRequests` (type: `integer`):

Delay in milliseconds between pagination requests for the same profile.

## `maxRetries` (type: `integer`):

Number of retry attempts on request failure.

## `maxConcurrentProfiles` (type: `integer`):

Maximum number of profiles scraped concurrently. Lower values reduce Instagram blocking.

## Actor input object example

```json
{
  "usernames": [
    "natgeo",
    "@nike",
    "https://www.instagram.com/cristiano/"
  ],
  "postsPerProfile": 24,
  "newerThan": "2026-01-01T00:00:00Z",
  "proxy": {
    "useApifyProxy": true
  },
  "delayBetweenProfiles": 250,
  "delayBetweenRequests": 500,
  "maxRetries": 3,
  "maxConcurrentProfiles": 10
}
```

# Actor output Schema

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

No description

## `runSummary` (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 = {
    "usernames": [
        "instagram"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("karamelo/instagram-posts").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 = {
    "usernames": ["instagram"],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("karamelo/instagram-posts").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 '{
  "usernames": [
    "instagram"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call karamelo/instagram-posts --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,karamelo/instagram-posts"
        }
    }
}

```

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/FJ5XYbSyfWnJb1SEO/builds/3cx5KIZkD1oMgdbLy/openapi.json
