# Instagram Profile & Post Scraper — Zero Cookies, Anti-Detect (`autokeren/ghostfox-instagram-scraper`) Actor

Instagram profiles & posts WITHOUT cookies or login. Exact likes, comments, captions, media URLs. Anti-detect engine + protocol-level API interception — invisible to anti-bot. Works on datacenter IPs. $2/1k results.

- **URL**: https://apify.com/autokeren/ghostfox-instagram-scraper.md
- **Developed by:** [auto keren](https://apify.com/autokeren) (community)
- **Categories:** Social media
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 results

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

Learn more: https://docs.apify.com/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

## 🦊 Instagram Profile & Post Scraper — Zero Cookies, Zero Login

Scrape Instagram **profiles and posts without logging in and without session cookies**. Powered by the Ghostfox anti-detect browser engine with **protocol-level API interception** — the interception is invisible to Instagram's anti-bot scripts.

### Why this one?

Almost every Instagram scraper on the market forces you to choose between two painful options:

- 🔑 **Feeding it your own session cookies** — your account eventually gets flagged and banned.
- 💸 **Burning expensive residential-proxy bandwidth** — because their scraping gets detected otherwise.

This Actor does neither. It runs a **coherent-identity anti-detect engine** (patched-Firefox/Gecko with consistent fingerprinting) and extracts data by **intercepting Instagram's own API responses at the browser protocol level**. Instagram cannot detect the interception, and no login is ever performed.

### 📦 What you get

**Profile data** (per username):

- Followers / following / posts counts — exact numbers, e.g. `679,812,464`
- Full name, biography, verified badge, profile picture URL

**Post data** (per post):

- Exact likes & comments counts — live numbers, e.g. `1,493,180` likes
- Full captions, direct CDN media URLs, media type, posted date
- Works with both profile grids (latest posts) and direct post URLs / shortcodes

### 💰 Pricing

**$2.00 per 1,000 results** — cheaper than every major Instagram scraper on the Store, with no cookie requirement. You pay only for results written to the dataset.

### ⚙️ Input

| Field | Description |
|---|---|
| `usernames` | List of Instagram usernames (no `@` needed) |
| `postUrls` | List of post URLs or shortcodes |
| `maxPosts` | How many latest posts per profile (default 12) |
| `enrichEmbed` | Exact like/comment counts per post via embed enrichment (recommended) |
| `tryApi` | Attempt the internal `web_profile_info` API via request interception (gets media URLs + full captions automatically) |
| `proxy` | Optional proxy URL — **not required** for light use. For heavy volume, bring your own residential proxy (any `http(s)://` or `socks5://` URL) and the whole browser session routes through it. |

### 🔬 How it works (the technical edge)

1. Every page loads through the anti-detect engine with a coherent browser fingerprint.
2. Public data (profile counts, bio, grid shortcodes) is read from server-rendered HTML.
3. For richer data, the Actor holds Instagram's own `web_profile_info` API request, **resumes it with a modified User-Agent header**, and captures the response body — all at the protocol level, invisible to the page.
4. Media and font requests are **aborted at the protocol level** during scraping — lower bandwidth, lower memory, lower compute cost for you.

### ⚠️ Rate limits & fair use

Instagram rate-limits aggressive traffic per IP. For small batches (up to ~5 profiles per run) the default datacenter setup works well. For larger jobs, add a residential proxy in the `proxy` field.

Blocked or private profiles are returned with `error: "profile_blocked_or_private"` — you are never charged mystery costs for empty results.

### 📊 Sample output

```json
{
  "type": "profile",
  "username": "cristiano",
  "followers": 679812464,
  "following": 638,
  "posts_count": 4148,
  "verified": true,
  "profile_pic_url": "https://scontent..."
}
{
  "type": "post",
  "shortcode": "De4ydmnAMes",
  "caption": "71 years of passion. Happy birthday, Al Nassr! 🟡🔵",
  "likes": 1493180,
  "comments": 15468,
  "media_url": "https://scontent..."
}
```

# Actor input Schema

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

List of Instagram usernames to scrape profiles for (without @)

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

List of Instagram post URLs or shortcodes (https://www.instagram.com/p/XXXX/ or just XXXX)

## `maxPosts` (type: `integer`):

Maximum number of latest posts to scrape per profile

## `enrichEmbed` (type: `boolean`):

Visit each post's embed page to get EXACT like/comment counts and full caption. Slower but much richer data.

## `tryApi` (type: `boolean`):

Attempt the internal web_profile_info API via request interception (gets media URLs + full captions). Auto-falls back to public data on rate limit.

## `proxy` (type: `string`):

Optional proxy for the browser session (residential recommended for heavy use). Format: http://user:pass@host:port or socks5://host:port

## `pacingMode` (type: `string`):

Request pacing between items. Randomized jitter in each mode. Use 'cautious' for large jobs to avoid rate limits.

## Actor input object example

```json
{
  "usernames": [
    "cristiano"
  ],
  "postUrls": [],
  "maxPosts": 12,
  "enrichEmbed": true,
  "tryApi": true,
  "proxy": "",
  "pacingMode": "balanced"
}
```

# Actor output Schema

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

No description

## `username` (type: `string`):

No description

## `profile_url` (type: `string`):

No description

## `full_name` (type: `string`):

No description

## `followers` (type: `string`):

No description

## `following` (type: `string`):

No description

## `posts_count` (type: `string`):

No description

## `verified` (type: `string`):

No description

## `profile_pic_url` (type: `string`):

No description

## `biography` (type: `string`):

No description

## `shortcode` (type: `string`):

No description

## `post_url` (type: `string`):

No description

## `caption` (type: `string`):

No description

## `likes` (type: `string`):

No description

## `comments` (type: `string`):

No description

## `posted_at` (type: `string`):

No description

## `media_url` (type: `string`):

No description

## `media_type` (type: `string`):

No description

## `is_video` (type: `string`):

No description

## `error` (type: `string`):

No description

## `scraped_at` (type: `string`):

No description

## `source` (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": [
        "cristiano"
    ],
    "postUrls": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("autokeren/ghostfox-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 = {
    "usernames": ["cristiano"],
    "postUrls": [],
}

# Run the Actor and wait for it to finish
run = client.actor("autokeren/ghostfox-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 '{
  "usernames": [
    "cristiano"
  ],
  "postUrls": []
}' |
apify call autokeren/ghostfox-instagram-scraper --silent --output-dataset

```

## MCP server setup

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