Facebook Smart Search avatar
Facebook Smart Search

Under maintenance

Pricing

$2.90 / 1,000 results

Go to Store
Facebook Smart Search

Facebook Smart Search

Under maintenance

Developed by

Devinja

Devinja

Maintained by Community

Extract Facebook posts with intelligent search capabilities and project-optimized scraping. This actor searches Facebook posts by keywords, date ranges, and filters while handling dynamic content loading and anti-bot measures.

5.0 (1)

Pricing

$2.90 / 1,000 results

2

Total users

3

Monthly users

3

Runs succeeded

>99%

Last modified

4 days ago

πŸš€ Facebook Post Scraper - Apify Actor

Apify Actor License: MIT Node.js Version

A powerful, production-ready Facebook post scraper that can extract thousands of posts with advanced infinite scroll support. Built with Apify and Crawlee for maximum reliability and scalability.

✨ Key Features

  • πŸ”„ Infinite Scroll: Automatically scrolls through Facebook's feed to collect thousands of posts
  • πŸ” Smart Authentication: Handles login with cookies, environment variables, and 2FA support
  • πŸ“Š Rich Data Extraction: Posts, authors, reactions, comments, images, and metadata
  • πŸ›‘οΈ Anti-Bot Protection: Built-in delays, user agent rotation, and Facebook-specific handling
  • ⚑ High Performance: Optimized for large-scale scraping with memory efficiency
  • 🎯 Precise Targeting: Advanced search with date ranges and filtering options
  • πŸ“± Real-time Progress: Detailed logging and progress tracking for long-running jobs

🎯 Use Cases

  • Social Media Monitoring: Track brand mentions and sentiment
  • Market Research: Analyze trends and public opinion
  • Content Analysis: Study viral content and engagement patterns
  • Competitor Intelligence: Monitor competitor social media activity
  • Academic Research: Collect data for social science studies
  • Trend Analysis: Identify emerging topics and hashtags

πŸ“Š Sample Output

[
{
"post_id": "123456789",
"url": "https://facebook.com/posts/123456789",
"message": "Check out this amazing new technology! #innovation #tech",
"timestamp": 1674567890,
"comments_count": 25,
"reactions_count": 150,
"author": {
"id": "user123",
"name": "Tech Enthusiast",
"url": "https://facebook.com/techuser",
"profile_picture_url": "https://facebook.com/profile.jpg"
},
"image": {
"uri": "https://facebook.com/image.jpg",
"height": 720,
"width": 1280,
"id": "img123"
},
"video": null,
"attached_post_url": null
}
]

βš™οΈ Input Configuration

ParameterTypeDescriptionDefaultRequired
querystringSearch term (e.g., "technology", "climate change")-βœ…
max_postsintegerMaximum posts to collect (1-10,000)50βœ…
start_datestringStart date (YYYY-MM-DD format)-❌
end_datestringEnd date (YYYY-MM-DD format)-❌
recent_postsbooleanFocus on recent poststrue❌
search_typestringSearch type (currently "posts")"posts"❌

Example Input:

{
"query": "artificial intelligence",
"max_posts": 500,
"start_date": "2025-01-01",
"end_date": "2025-01-31",
"recent_posts": true,
"search_type": "posts"
}

πŸ” Authentication Setup

Set these in your Apify Actor environment:

FACEBOOK_EMAIL=your_email@gmail.com
FACEBOOK_PASSWORD=your_password
FACEBOOK_COOKIES={"cookies":"json","from":"local","run"}

Option 2: Local Development

  1. Run locally first to handle 2FA and save cookies
  2. Update credentials in code (for testing only)
  3. Deploy with saved cookies

πŸš€ Quick Start

1. Deploy to Apify

  1. Upload this code to Apify Console
  2. Set environment variables for authentication
  3. Configure input parameters
  4. Run the actor

2. Local Development

# Install dependencies
npm install
# Configure input
echo '{"query": "technology", "max_posts": 20}' > input_local.json
# Run locally
npm start

3. Build and Test

# Build for production
npm run build
# Run production build
npm run start:prod

πŸ“ˆ Performance & Scalability

  • Handles 10,000+ posts with infinite scroll
  • Memory efficient - processes posts in batches
  • Rate limit compliant - built-in delays prevent blocking
  • Fault tolerant - handles network issues and retries
  • Progress tracking - real-time logging for long jobs

Performance Metrics:

  • ~100 posts per minute (varies by content)
  • Memory usage: <500MB for 1000 posts
  • Success rate: >95% for typical queries

πŸ› οΈ Technical Details

  • Runtime: Node.js 18+ with TypeScript
  • Browser: Puppeteer with Chrome headless
  • Architecture: Apify Actor with Crawlee framework
  • Storage: Apify Dataset (auto-exports to JSON/CSV)
  • Monitoring: Built-in logging and error tracking

πŸ” Troubleshooting

Common Issues:

No posts found:

  • Verify the search query works on Facebook manually
  • Check if the account has access to the content
  • Ensure date ranges include available posts

Login failures:

  • Verify environment variables are set correctly
  • Handle 2FA by running locally first
  • Check if Facebook requires additional verification

Rate limiting:

  • Reduce max_posts or add delays
  • Use different Facebook account
  • Run during off-peak hours

πŸ“š Advanced Usage

Large Scale Scraping:

{
"query": "climate change",
"max_posts": 5000,
"recent_posts": true
}

Historical Data Collection:

{
"query": "covid vaccine",
"max_posts": 1000,
"start_date": "2021-01-01",
"end_date": "2021-12-31"
}

Brand Monitoring:

{
"query": "your_brand_name",
"max_posts": 200,
"recent_posts": true
}

πŸ”’ Privacy & Compliance

  • Respects Facebook's robots.txt
  • Implements proper rate limiting
  • Uses public data only
  • Includes user agent identification
  • Follows ethical scraping practices

πŸ“„ License

MIT License - see LICENSE file for details.

🀝 Support

For issues, questions, or feature requests:

  1. Check the troubleshooting section above
  2. Review Apify Actor logs for error details
  3. Contact support with specific error messages

Ready to scrape Facebook posts at scale? Deploy this actor and start collecting valuable social media data today! πŸš€