apify/facebook-posts-scraper
7 days trial then $35.00/month - No credit card required now
Extract data from hundreds of Facebook posts from one or multiple Facebook pages and profiles. Get post URL, post text, page or profile URL, timestamp, number of likes, shares, comments, and more. Download the data in JSON, CSV, and Excel and use it in apps, spreadsheets, and reports.
It's a simple and powerful tool that allows you to extract data from Facebook posts. To get that data, just insert the URL of Facebook page, Facebook post or Facebook profile and click "Save & Start" button.
Facebook Scraper was designed to be easy to start with even if you've never extracted data from the web before. Here's how you can scrape Facebook data with this tool:
The input for Facebook Posts Scraper should be URLs of Facebook pages or Facebook profiles you want to scrape posts from. Click on the input tab for a full explanation of input in JSON.
{
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
},
"resultsLimit": 5,
"startUrls": [
{
"url": "https://www.facebook.com/nytimes"
}
],
"maxRequestRetries": 10
}
This scraper will deliver results in a dataset. You can choose in which format to download it: JSON, Excel, HTML, CSV, or XML. Here's an excerpt from the JSON dataset you'd get if you apply the input parameters above:
[{
"facebookUrl": "https://www.facebook.com/nytimes/",
"pageId": "5281959998",
"postId": "10153102379324999",
"pageName": "The New York Times",
"url": "https://www.facebook.com/nytimes/posts/pfbid02H3AMTEUUKeVQfHUxARkcz12qCNep8Xhta5czh5rGwVWKf15UdFksFEZiKJ5BiSRul",
"time": "Thursday, 6 April 2023 at 07:10",
"timestamp": 1680790202000,
"likes": 9,
"comments": 17,
"shares": null,
"text": "Vice President Kamala Harris’s visit to Africa last week was designed to send a message — China is not your friend. The U.S. is. What’s at stake as the U.S. races to deepen its relationships with African countries? Listen to today's episode of The Daily.",
"link": "https://nyti.ms/3m5ATQF",
"thumb": "https://external.fbhx1-1.fna.fbcdn.net/emg1/v/t13/14235345366312894764?url=https%3A%2F%2Fstatic01.nyt.com%2Fimages%2F2023%2F03%2F31%2Fmultimedia%2F06daily-africa-china-image%2F31DAILY-africa-harris-audio-app-lqcz-facebookJumbo.jpg&fb_obo=1&utld=nyt.com&stp=c0.5000x0.5000f_dst-emg0_p540x282_q75_u&ccb=13-1&oh=06_AbFAcUqXHUyQslcBMU4ZurZEl5k4RkI70FPgilDPmwOxHA&oe=6430CB18&_nc_sid=6ac203",
"topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102379324999",
"facebookId": "5281959998",
"postFacebookId": "10153102379324999"
},
{
"facebookUrl": "https://www.facebook.com/nytimes/",
"pageId": "5281959998",
"postId": "10153102374144999",
"pageName": "The New York Times",
"url": "https://www.facebook.com/nytimes/posts/pfbid02meAxCj1jLx1jJFwJ9GTXFp448jEPRK58tcPcH2HWuDoogD314NvbFMhiaint4Xvkl",
"time": "Thursday, 6 April 2023 at 06:55",
"timestamp": 1680789311000,
"likes": 22,
"comments": 2,
"shares": null,
"text": "Four days before the wedding they emailed family members a “save the date” invite. It was void of time, location and dress code — the couple were still deciding those details.",
"link": "https://nyti.ms/3KAutlU",
"thumb": "https://external.fbhx1-1.fna.fbcdn.net/emg1/v/t13/10934665028194629920?url=https%3A%2F%2Fstatic01.nyt.com%2Fimages%2F2023%2F04%2F06%2Ffashion%2F06FLASH-WEDDINGS%2F06FLASH-WEDDINGS-facebookJumbo.jpg&fb_obo=1&utld=nyt.com&stp=c0.5000x0.5000f_dst-emg0_p540x282_q75_u&ccb=13-1&oh=06_AbHZm2V5eGBS0LJDL_K__5OFCQlIIRY0KoWsbfyhQs7K2w&oe=64307090&_nc_sid=6ac203",
"topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102374144999",
"facebookId": "5281959998",
"postFacebookId": "10153102379324999"
},
{
"facebookUrl": "https://www.facebook.com/nytimes/",
"pageId": "5281959998",
"postId": "10153102363149999",
"pageName": "The New York Times",
"url": "https://www.facebook.com/nytimes/posts/pfbid0rx37EW9fgw4oEdQngFjAberf7VTPX3Nyz7t5b4aWb75yQgGEA2TiNPZCbTrAeCb9l",
"time": "Thursday, 6 April 2023 at 06:25",
"timestamp": 1680787505000,
"likes": 22,
"comments": 17,
"shares": 11,
"text": "In the early, panicked days of the pandemic, the U.S. government made policies like Medicaid and food stamps more generous and created benefits like paid sick leave and free school lunches. Now, most of those policies have ended or will expire soon.",
"link": "https://nyti.ms/3m9eqC9",
"thumb": "https://external.fbhx1-1.fna.fbcdn.net/emg1/v/t13/10917508170453131590?url=https%3A%2F%2Fstatic01.nyt.com%2Fimages%2F2023%2F04%2F05%2Fupshot%2Fpandemic-safety-net-medicaid-food-stamps-promo%2Fpandemic-safety-net-medicaid-food-stamps-promo-facebookJumbo.png&fb_obo=1&utld=nyt.com&stp=c0.5000x0.5000f_dst-emg0_p540x282_q75_u&ccb=13-1&oh=06_AbFjzcX-8HBnqgZ-au4C4Gy9gxAta0xkxHvyGxN9CaORKg&oe=643083D5&_nc_sid=6ac203",
"topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102363149999",
"facebookId": "5281959998",
"postFacebookId": "10153102379324999"
},
{
"facebookUrl": "https://www.facebook.com/nytimes/",
"pageId": "5281959998",
"postId": "10153102358079999",
"pageName": "The New York Times",
"url": "https://www.facebook.com/nytimes/posts/pfbid0pzTZ7jE4BjAjZA3tP6SzXtgZvbpc4q5XaC3ToGq6Qabxv7EWYoGESBsjtnPQUj3Sl",
"time": "Thursday, 6 April 2023 at 06:11",
"timestamp": 1680786664000,
"likes": 161,
"comments": 121,
"shares": 30,
"text": "Bob Lee, a tech executive who helped create the payment service Cash App, was fatally stabbed in San Francisco on Tuesday, his family said. “I was so fortunate to grow up with him, and I feel like I’ve lost part of myself,” his brother wrote on Facebook.",
"link": "https://nyti.ms/40YcAD2",
"thumb": "https://external.fbhx1-1.fna.fbcdn.net/emg1/v/t13/5428151098979393741?url=https%3A%2F%2Fstatic01.nyt.com%2Fimages%2F2023%2F04%2F05%2Flens%2F05xp-lee-01%2F05xp-lee-01-facebookJumbo.png&fb_obo=1&utld=nyt.com&stp=c0.5000x0.5000f_dst-emg0_p540x282_q75_u&ccb=13-1&oh=06_AbHjQI0VQ8mEBLefnL0N89esU5kZNEtCSyn6Xb-uNs4YeQ&oe=6430C0D7&_nc_sid=6ac203",
"topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102358079999",
"facebookId": "5281959998",
"postFacebookId": "10153102379324999"
}]
Facebook Posts Scraper can return up to 5,000 results from one page. However, you have to keep in mind that scraping facebook.com has many variables to it and may cause the results to fluctuate case by case. There’s no one-size-fits-all-use-cases number. The maximum number of results may vary depending on the complexity of the input, location, and other factors. Some of the most frequent cases are:
Therefore, while we regularly run Actor tests to keep the benchmarks in check, the results may also fluctuate without our knowing. The best way to know for sure for your particular use case is to do a test run yourself.
When it comes to scraping, it can be challenging to estimate the resources needed to extract data as use cases may vary significantly. That's why the best course of action is to run a test scrape with a small sample of input data and limited output. You’ll get your price per scrape, which you’ll then multiply by the number of scrapes you intend to do.
If the Tripadvisor reviews scraper doesn’t exactly meet your needs, you can always build your own! We have various scraper templates in Python, JavaScript, and TypeScript to get you started. Alternatively, you can write it from scratch using our open-source library Crawlee. You can keep the scraper to yourself or make it public by adding it to the Apify Store.
Let us know if you need a custom scraping solution.
Last but not least, Facebook Posts Scraper can be connected with almost any cloud service or web app thanks to integrations on the Apify platform. You can integrate with Make, Asana, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive, and more.
You can also use webhooks to carry out an action whenever an event occurs, e.g., get a notification whenever Facebook Posts Scraper successfully finishes a run.
The Apify API gives you programmatic access to the Apify platform. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. The API also lets you access any datasets, monitor actor performance, fetch results, create and update versions, and more. To access the API using Node.js, use the apify-client
NPM package. To access the API using Python, use the apify-client
PyPI package.
Our Facebook scrapers are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. However, you should be aware that your results could contain personal data. You should not scrape personal data unless you have a legitimate reason to do so.
If you're unsure whether your reason is legitimate, consult your lawyers. You can also read our blog post on the legality of web scraping and ethical scraping.
We’re always working on improving the performance of our Actors. So if you’ve got any technical feedback for Facebook Pages Scraper or simply found a bug, please create an issue on the Actor’s Issues tab in Apify Console.