Instagram Tagged Posts Scraper avatar

Instagram Tagged Posts Scraper

Pricing

from $5.00 / 1,000 results

Go to Apify Store
Instagram Tagged Posts Scraper

Instagram Tagged Posts Scraper

Extracts posts where a specific Instagram user is tagged by others. Returns complete post data including likes, comments, captions, media URLs, and author details with profile pictures and verification status.

Pricing

from $5.00 / 1,000 results

Rating

5.0

(2)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

0

Bookmarked

32

Total users

3

Monthly active users

3 days ago

Last modified

Share

Extract posts where a user is tagged on Instagram. This scraper navigates to the "Tagged" tab of any Instagram profile and extracts all posts where the target user has been tagged by others. Accepts one or more usernames per run - each username's post URLs are found by the browser, then handed off to run in the background while the browser moves on to the next username.

Features

  • 🏷️ Tagged Posts Extraction: Scrapes posts from the /tagged/ tab of any Instagram profile
  • 👥 Multiple Usernames: Process several usernames in a single run, pipelined so scraping overlaps with crawling
  • 📊 Engagement Metrics: Extracts likes, comments, and views for each post
  • 📸 Media URLs: Collects image and video URLs from posts
  • 👤 Author Information: Gets details about who posted/tagged the user
  • 🔐 Cookie Authentication: Supports MongoDB cookie rotation and file-based cookies
  • 🛡️ Anti-Detection: Human behavior simulation, stealth scripts, and random delays
  • 📧 Email Alerts: Automatic notifications when cookies fail or are exhausted

Input Parameters

ParameterTypeRequiredDefaultDescription
usernamesArray[String]Yes-One or more Instagram usernames whose tagged posts to scrape
maxPostsIntegerNo100Maximum number of tagged posts to extract per username
cookiesStringNo-Instagram cookies in JSON format
sessionNameStringNo"default_session"Session name for cookie persistence

Example Input

{
"usernames": ["instagram", "natgeo"],
"maxPosts": 20
}

Output Format

Each tagged post is returned with the following structure:

{
"tagged_username": "instagram",
"post_url": "https://www.instagram.com/p/ABC123/",
"description": "Post caption here...",
"post_type": "image",
"like_count": 12345,
"comment_count": 234,
"view_count": 0,
"pub_date": "2024-01-15T10:30:00",
"media_urls": ["https://instagram.com/..."],
"scraped_at": "2024-01-20T15:30:00.000Z",
"authorMeta": {
"username": "photographer",
"full_name": "John Photographer",
"profile_url": "https://www.instagram.com/photographer/",
"is_verified": false
}
}

The scraper automatically connects to MongoDB for cookie rotation. This provides:

  • Round-robin cookie selection
  • Automatic failover when cookies fail
  • Usage tracking and failure detection
  • Email alerts for cookie failures

Export cookies from your browser and provide them in the cookies parameter:

  1. Install a browser extension like "Cookie-Editor" or "EditThisCookie"
  2. Log into Instagram in your browser
  3. Export cookies as JSON
  4. Paste the JSON into the cookies input parameter

Option 3: File-Based Cookies

Place a cookies file in the scraper directory:

  • www.instagram.com.cookies (1).json
  • www.instagram.com.cookies.json
  • cookies.json
  • IG_Cookies.json

Anti-Blocking Measures

This scraper includes multiple anti-detection features:

  1. Stealth Scripts: Override navigator properties to avoid bot detection
  2. Human Behavior Simulation: Random mouse movements, scrolling, and delays
  3. Cookie Rotation: Automatic rotation through multiple accounts
  4. Random Delays: Variable delays between requests
  5. Firefox Browser: Uses Firefox which has better anti-detection properties

Error Handling

The scraper handles various error scenarios:

  • Profile Not Found: Returns error message if profile doesn't exist
  • Private Account: Tagged posts are not accessible for private accounts
  • No Tagged Posts: Returns message if user has no tagged posts
  • Rate Limiting: Automatically stops if Instagram blocks access
  • Cookie Failure: Rotates to next cookie and sends email alert

Limitations

  • Tagged posts are only visible if the target profile is public
  • Instagram may limit access without authentication
  • Rate limits apply - avoid scraping too many posts too quickly
  • Some posts may be restricted based on account settings

Local Development

# Install dependencies
pip install -r requirements.txt
# Install Playwright browsers
playwright install firefox
# Run locally
apify run

Deployment to Apify

# Login to Apify
apify login
# Push to Apify
apify push

Support

If you encounter issues:

  1. Ensure cookies are valid and not expired
  2. Check if the target profile is public
  3. Reduce maxPosts to avoid rate limiting