
Facebook Smart Search
Under maintenance
Pricing
$2.90 / 1,000 results

Facebook Smart Search
Under maintenance
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
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
Parameter | Type | Description | Default | Required |
---|---|---|---|---|
query | string | Search term (e.g., "technology", "climate change") | - | β |
max_posts | integer | Maximum posts to collect (1-10,000) | 50 | β |
start_date | string | Start date (YYYY-MM-DD format) | - | β |
end_date | string | End date (YYYY-MM-DD format) | - | β |
recent_posts | boolean | Focus on recent posts | true | β |
search_type | string | Search 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
Option 1: Environment Variables (Recommended)
Set these in your Apify Actor environment:
FACEBOOK_EMAIL=your_email@gmail.comFACEBOOK_PASSWORD=your_passwordFACEBOOK_COOKIES={"cookies":"json","from":"local","run"}
Option 2: Local Development
- Run locally first to handle 2FA and save cookies
- Update credentials in code (for testing only)
- Deploy with saved cookies
π Quick Start
1. Deploy to Apify
- Upload this code to Apify Console
- Set environment variables for authentication
- Configure input parameters
- Run the actor
2. Local Development
# Install dependenciesnpm install# Configure inputecho '{"query": "technology", "max_posts": 20}' > input_local.json# Run locallynpm start
3. Build and Test
# Build for productionnpm run build# Run production buildnpm 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:
- Check the troubleshooting section above
- Review Apify Actor logs for error details
- Contact support with specific error messages
Ready to scrape Facebook posts at scale? Deploy this actor and start collecting valuable social media data today! π