Pricing
from $5.00 / 1,000 results
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
(1)
Developer
Actor stats
0
Bookmarked
27
Total users
1
Monthly active users
8 days ago
Last modified
Categories
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.
Features
- π·οΈ Tagged Posts Extraction: Scrapes posts from the
/tagged/tab of any Instagram profile - π 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
username | String | Yes | - | Instagram username whose tagged posts to scrape |
maxPosts | Integer | No | 12 | Maximum number of tagged posts to extract |
cookies | String | No | - | Instagram cookies in JSON format |
sessionName | String | No | "default_session" | Session name for cookie persistence |
minDelayBetweenRequests | Integer | No | 3 | Minimum delay between requests (seconds) |
maxDelayBetweenRequests | Integer | No | 7 | Maximum delay between requests (seconds) |
humanizeBehavior | Boolean | No | true | Enable human-like behavior simulation |
Example Input
{"username":"instagram","maxPosts":20,"humanizeBehavior":true}
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}}
Cookie Authentication
Option 1: MongoDB Cookie Rotation (Automatic)
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
Option 2: Manual Cookie Input
Export cookies from your browser and provide them in the cookies parameter:
- Install a browser extension like "Cookie-Editor" or "EditThisCookie"
- Log into Instagram in your browser
- Export cookies as JSON
- Paste the JSON into the
cookiesinput parameter
Option 3: File-Based Cookies
Place a cookies file in the scraper directory:
www.instagram.com.cookies (1).jsonwww.instagram.com.cookies.jsoncookies.jsonIG_Cookies.json
Anti-Blocking Measures
This scraper includes multiple anti-detection features:
- Stealth Scripts: Override navigator properties to avoid bot detection
- Human Behavior Simulation: Random mouse movements, scrolling, and delays
- Cookie Rotation: Automatic rotation through multiple accounts
- Random Delays: Variable delays between requests
- 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 dependenciespip install-r requirements.txt# Install Playwright browsersplaywright install firefox# Run locallyapify run
Deployment to Apify
# Login to Apifyapify login# Push to Apifyapify push
Support
If you encounter issues:
- Ensure cookies are valid and not expired
- Check if the target profile is public
- Reduce
maxPoststo avoid rate limiting - Enable
humanizeBehaviorto reduce detection risk
