Instagram Scraper avatar

Instagram Scraper

Pricing

Pay per usage

Go to Apify Store
Instagram Scraper

Instagram Scraper

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Megan Studios

Megan Studios

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 hours ago

Last modified

Share

Scrape Instagram profiles, posts, reels, and comments from one Apify Actor.

This Actor is designed for authenticated scraping. The Instagram session cookies are configured by the Actor owner as an environment variable, so regular users only need to choose what to scrape and provide usernames or post IDs.

What You Can Scrape

  • Profile details such as biography, follower counts, profile picture, verified status, and external URL.
  • Posts and reels with captions, hashtags, mentions, media URLs, structured media assets, timestamps, likes, comments count, and available playback metrics.
  • Comments with username, text, likes, reply count, pinned status, and verified status.
  • Combined collection using the all mode.

Input

scrapeType

Choose what the Actor should collect:

  • profile - scrape profile information for each username.
  • posts - scrape posts and reels for each username.
  • reels - scrape video/reel media only.
  • comments - scrape comments from postIds, or resolve posts from usernames first.
  • all - scrape profile, posts/reels, and comments in one run.

usernames

Instagram usernames to scrape. Do not include @.

Required for profile, posts, reels, and all. For comments, this is optional if postIds are provided.

Default: ["wander_worldly"]

postIds

Numeric Instagram media IDs used for comment scraping.

If scrapeType is comments and postIds is empty, the Actor will fetch posts from usernames first and then scrape comments for those posts.

limit

Maximum number of posts or reels to scrape or inspect per username.

Default: 20

commentsLimit

Maximum number of comments to scrape per post.

Default: 50

outputPath and outputFormat

Optional local file output for self-hosted/local runs. Apify runs always write results to the default Dataset.

Supported formats:

  • json
  • jsonl
  • csv

Example Inputs

Profile

{
"scrapeType": "profile",
"usernames": ["wander_worldly"]
}

Posts and Reels

{
"scrapeType": "posts",
"usernames": ["wander_worldly"],
"limit": 10
}

Reels Only

{
"scrapeType": "reels",
"usernames": ["wander_worldly"],
"limit": 10
}

Comments by Post ID

{
"scrapeType": "comments",
"postIds": ["3931648135231633082"],
"commentsLimit": 50
}

All Data

{
"scrapeType": "all",
"usernames": ["wander_worldly"],
"limit": 5,
"commentsLimit": 20
}

Example Output

Profile

{
"recordType": "profile",
"id": "61423648970",
"username": "wander_worldly",
"fullName": "Wander Worldly",
"biography": "Global journeys and travel moments",
"followersCount": 360,
"followingCount": 308,
"postsCount": 390,
"profilePicUrl": "https://...",
"isVerified": false,
"businessCategoryName": "None"
}

Post or Reel

{
"recordType": "reel",
"id": "3931648135231633082",
"shortcode": "DaQBSXyTva6",
"mediaType": 2,
"productType": "clips",
"ownerId": "61423648970",
"ownerUsername": "wander_worldly",
"caption": "Caption text with #hashtags",
"hashtags": ["travel", "world"],
"mentions": [],
"media": [
{
"type": "thumbnail",
"url": "https://...",
"width": 640,
"height": 1138
},
{
"type": "video",
"url": "https://...",
"width": 720,
"height": 1280,
"duration": 17.5,
"bandwidth": 123456
}
],
"mediaUrls": ["https://..."],
"isVideo": true,
"thumbnailUrl": "https://...",
"timestamp": 1782909029,
"publishedAtMs": 1782909029000,
"publishedAt": "2026-07-01T00:30:29.000Z",
"likesCount": 0,
"commentsCount": 0,
"playsCount": 1234,
"viewsCount": 1200,
"sharesCount": 12,
"repostsCount": 3,
"savesCount": 8,
"taggedUsers": []
}

Some engagement metrics, such as shares and reposts, are included only when Instagram returns them in the authenticated response.

Comment

{
"recordType": "comment",
"postId": "3931648135231633082",
"id": "18000000000000000",
"username": "example_user",
"text": "Great post!",
"likesCount": 3,
"repliesCount": 0,
"timestamp": 1782909999,
"isPinned": false,
"isVerified": false
}

Authentication

This Actor requires Instagram cookies configured by the Actor owner.

Set the environment variable:

INSTAGRAM_COOKIES=sessionid=...; ds_user_id=...; csrftoken=...

Store it as a secret environment variable. Do not expose session cookies in Actor input, public documentation, logs, or examples.

Limits and Notes

  • Instagram may rate-limit or block requests depending on account trust, request volume, region, and proxy quality.
  • Private profiles, deleted posts, restricted content, or unavailable media may not be returned.
  • Media URLs can expire because Instagram CDN links are time-limited.
  • Counts and engagement metrics reflect what Instagram returns at scrape time.
  • Using one shared Instagram session for many users can increase rate-limit risk.

Troubleshooting

The Actor says cookies are required

Set INSTAGRAM_COOKIES in the Actor environment variables.

The Actor returns login or checkpoint errors

Refresh the Instagram cookies. The session may be expired, challenged, or rate-limited.

Shares or reposts are missing

Instagram does not always return these metrics in the endpoint response. The Actor includes them only when available.

Dataset is empty

Check that the input contains valid usernames or post IDs, then inspect the run log for authentication or rate-limit messages.

For Developers

Technical setup, monorepo structure, Docker, and local development notes are available in docs/DEVELOPMENT.md.

Release history is available in CHANGELOG.md.