Facebook Posts Scraper avatar
Facebook Posts Scraper
Try for free

7 days trial then $35.00/month - No credit card required now

View all Actors
Facebook Posts Scraper

Facebook Posts Scraper

apify/facebook-posts-scraper
Try for free

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.

What is Facebook Posts Scraper?

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.

What Facebook posts data can I extract?

With this Facebook API, you will be able to extract the following data from Facebook:

📝 Post text 🔗 Post and page/profile URL
🕐 Timestamp 👍 Number of likes, shares, comments
🗂 Page or profile details🌆 Post thumbnail

Why scrape Facebook posts?

🤺 Competition monitoring to identify what they're doing right, or wrong, and how you can do it better

🔍 Market research or analysis

🔥 Monitoring trends and brand sentiment and use the data to inform your investment strategy

🥸 Social media analysis and identifying hot spots of misinformation

How do I use Facebook Posts Scraper?

Facebook Posts 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:

  1. Create a free Apify account using your email.
  2. Open Facebook Posts Scraper.
  3. Add one or more Facebook page/profile URLs to scrape its posts.
  4. Click "Start" and wait for the data to be extracted.
  5. Download your data in JSON, XML, CSV, Excel, or HTML.

If you need guidance on how to run the scraper, you can follow our step-by-step tutorial 🔗

Is there a difference between scraping a Facebook Profile and Facebook Page?

Yes, there is. Facebook Pages are created for businesses, companies, non-profits, and other social causes. Those are the Facebook accounts that strive to provide "public-first" content and are often managed by a group of people. An easy way to distinguish between a Facebook profile and a Facebook page is that pages usually have a category of content and activity they would like to be associated with (news, software, hospitality, etc.) Facebook Pages that are particularly popular often include a blue verification badge. This scraper can extract information from both Facebook Pages and Facebook Profiles.

Input

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.

1{
2  "proxy": {
3    "useApifyProxy": true,
4    "apifyProxyGroups": [
5      "RESIDENTIAL"
6    ]
7  },
8  "resultsLimit": 5,
9  "startUrls": [
10    {
11      "url": "https://www.facebook.com/nytimes"
12    }
13  ],
14  "maxRequestRetries": 10
15}
16...

Output sample

The results will be wrapped into a dataset which you can find in the Storage tab. Here's an excerpt from the dataset you'd get if you apply the input parameters above:

Facebook posts scraping

And here is the same data but in JSON. You can choose in which format to download your Facebook data: CSV, Excel spreadsheet, JSON, JSONL, HTML table, or XML.

1[{
2  "facebookUrl": "https://www.facebook.com/nytimes/",
3  "pageId": "5281959998",
4  "postId": "10153102379324999",
5  "pageName": "The New York Times",
6  "url": "https://www.facebook.com/nytimes/posts/pfbid02H3AMTEUUKeVQfHUxARkcz12qCNep8Xhta5czh5rGwVWKf15UdFksFEZiKJ5BiSRul",
7  "time": "Thursday, 6 April 2023 at 07:10",
8  "timestamp": 1680790202000,
9  "likes": 9,
10  "comments": 17,
11  "shares": null,
12  "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.",
13  "link": "https://nyti.ms/3m5ATQF",
14  "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",
15  "topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102379324999",
16  "facebookId": "5281959998",
17  "postFacebookId": "10153102379324999"
18},
19{
20  "facebookUrl": "https://www.facebook.com/nytimes/",
21  "pageId": "5281959998",
22  "postId": "10153102374144999",
23  "pageName": "The New York Times",
24  "url": "https://www.facebook.com/nytimes/posts/pfbid02meAxCj1jLx1jJFwJ9GTXFp448jEPRK58tcPcH2HWuDoogD314NvbFMhiaint4Xvkl",
25  "time": "Thursday, 6 April 2023 at 06:55",
26  "timestamp": 1680789311000,
27  "likes": 22,
28  "comments": 2,
29  "shares": null,
30  "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.",
31  "link": "https://nyti.ms/3KAutlU",
32  "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",
33  "topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102374144999",
34  "facebookId": "5281959998",
35  "postFacebookId": "10153102379324999"
36},
37{
38  "facebookUrl": "https://www.facebook.com/nytimes/",
39  "pageId": "5281959998",
40  "postId": "10153102363149999",
41  "pageName": "The New York Times",
42  "url": "https://www.facebook.com/nytimes/posts/pfbid0rx37EW9fgw4oEdQngFjAberf7VTPX3Nyz7t5b4aWb75yQgGEA2TiNPZCbTrAeCb9l",
43  "time": "Thursday, 6 April 2023 at 06:25",
44  "timestamp": 1680787505000,
45  "likes": 22,
46  "comments": 17,
47  "shares": 11,
48  "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.",
49  "link": "https://nyti.ms/3m9eqC9",
50  "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",
51  "topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102363149999",
52  "facebookId": "5281959998",
53  "postFacebookId": "10153102379324999"
54},
55{
56  "facebookUrl": "https://www.facebook.com/nytimes/",
57  "pageId": "5281959998",
58  "postId": "10153102358079999",
59  "pageName": "The New York Times",
60  "url": "https://www.facebook.com/nytimes/posts/pfbid0pzTZ7jE4BjAjZA3tP6SzXtgZvbpc4q5XaC3ToGq6Qabxv7EWYoGESBsjtnPQUj3Sl",
61  "time": "Thursday, 6 April 2023 at 06:11",
62  "timestamp": 1680786664000,
63  "likes": 161,
64  "comments": 121,
65  "shares": 30,
66  "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.",
67  "link": "https://nyti.ms/40YcAD2",
68  "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",
69  "topLevelUrl": "https://www.facebook.com/5281959998/posts/10153102358079999",
70  "facebookId": "5281959998",
71  "postFacebookId": "10153102379324999"
72},
73...

How many results can you scrape with Facebook Posts Scraper?

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:

  • website gives a different number of results depending on the type/value of the input
  • website has an internal limit that no scraper can cross
  • scraper has a limit that we are working on improving

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.

How much will scraping Facebook Posts cost you?

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.

Watch this video for a few helpful tips. And don't forget that choosing a higher plan will save you money in the long run.

Want to scrape Facebook search or comments?

You can use the dedicated scrapers below if you want to scrape specific Facebook data. Each of them is built particularly for the relevant Facebook scraping case be it reviews, ads, comments or photos. Feel free to browse them:

👥 Facebook Groups Scraper🏞 Facebook Photos Scraper
💬 Facebook Comments Scraper📱 Facebook Pages Info Scraper
🚩 Facebook Pages Scraper🌟 Facebook Reviews Scraper
🗓 Facebook Events Scraper🕵️‍♀️ Facebook Search Scraper
📢 Facebook Ads Scraper👍 Facebook Likes and Reactions Scraper
#️⃣ Facebook Hashtag Scraperℹ️ Facebook Page Posts Checker

Not your cup of tea? Build your own scraper

Facebook Pages Scraper doesn’t exactly do what you need? 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 Apify Store (and find users for it).

Or let us know if you need a custom scraping solution.

Integrations and Facebook Posts Scraper

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.

Using Facebook Posts Scraper with the Apify API

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.

Check out the Apify API reference docs for full details or click on the API tab for code examples.

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.

Your feedback

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.

Developer
Maintained by Apify
Actor metrics
  • 1.1k monthly users
  • 100.0% runs succeeded
  • 1.4 days response time
  • Created in Nov 2022
  • Modified 9 days ago