Disclaimer : Real Data API only extracts publicly available data while maintaining a strict policy against collecting any personal or identity-related information.
Scrape data from thousands of Facebook posts from multiple pages. Get page URL, number of likes, comments, shares, post text, post URL, and many more data fields using Facebook Posts data scraper. Save the data in any digestible format, and use it when needed. Our scraper is available for Facebook Posts Data Collection in Australia, Canada, the USA, the UK, Germany, France, Spain, Japan, Mexico, Singapore, and other countries worldwide.
It is an easy and robust data scraping tool that allows you to collect Facebook post data. To retrieve it, feed the page link, and click the Save and Start button.
Using this Facebook posts data scraping API, you can collect the following data from Facebook posts:
We have designed a Facebook posts scraper such that it is easy to start even though you've never scraped web data before using this scraper. Here is the process to extract Facebook post data.
Follow the stepwise tutorial if you want to learn about how to run the Facebook Posts data scraper.
It would help if you fed the Facebook page URLs of the page you want to scrape post data to the input field of the scraper. Open the input tab to learn JSON input with a detailed explanation.
{ "proxy": { "useApifyProxy": true, "apifyProxyGroups": [ "RESIDENTIAL" ] }, "resultsLimit": 5, "startUrls": [ { "url": "https://www.facebook.com/nytimes" } ], "maxRequestRetries": 10 } ...
You can check out the storage tab to see the output dataset. Applying the above input parameters will give you the output dataset like the one below.
The data you get will be in JSON. But you can download the Facebook post data in another format, like HTML, CSV, Excel, XML, JSONL, or JSON.
[{ "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" }, ...
Our plan of 49 USD allows you to extract 20 to 30 thousand Facebook posts every month. You must use residential proxies to scrape Facebook post data successfully.
To learn more about our platform credits, pricing plans, prices, and usage, visit our pricing page.
We've developed every scraper, especially for relevant data scraping from Facebook, like reviews, groups, photos, or comments. There are dedicated scrapers available on our platform to scrape specific Facebook data. Check them out for your custom needs.
Lastly, you can connect Facebook posts data scraper with any web application or cloud service using the integrations available on our platform. Multiple options exist to integrate the scraper, including Asana, Slack, GitHub, Zapier, Make, Airbyte, Google Drive, and Google Sheets.
Whenever any event occurs, you can use Webhooks to take actions, like getting an alert for a successful run of the scraper for Facebook Posts Data Collection.
Our API programmatically allows you to access the platform. We have organized the API around RESTful HTTP endpoints, allowing you to schedule, manage, and execute data scrapers. The data scraping API also allows you to track scraper performance, access datasets, create and update scraper versions, fetch outputs, and more. You can try our client NPM package to access the API using Node.js and the client PyPl package to access it using Python.
Visit the API tab to study code examples, explore our API reference document, and get more details.
We've designed our Facebook data scrapers for ethical uses that don't scrape users' personal information, like locations, email ids, genders, etc. Our scrapers only scrape publically available Facebook post data. But remember that you may get private data in the scraper output by mistake. Don't try to scrape any personal data without genuine reason.
If you are still determining whether your reason is genuine, you can seek advice from your lawyer.
We always try to improve the operating performance of our APIs. Therefore, if you find any issues, have any feedback for technical improvement, or discover any bug, you can raise it on the issue tab in the Real Data API console.
You should have a Real Data API account to execute the program examples. Replace<YOUR_API_TOKEN>
in the program using the token of your actor. Read about the live APIs with Real Data API docs for more explanation.
import { ApifyClient } from 'apify-client';
// Initialize the ApifyClient with API token
const client = new ApifyClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare actor input
const input = {
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork/"
}
],
"resultsLimit": 20,
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
},
"maxRequestRetries": 10
};
(async () => {
// Run the actor and wait for it to finish
const run = await client.actor("apify/facebook-posts-scraper").call(input);
// Fetch and print actor results from the run's dataset (if any)
console.log('Results from dataset');
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
console.dir(item);
});
})();
from apify_client import ApifyClient
# Initialize the ApifyClient with your API token
client = ApifyClient("<YOUR_API_TOKEN>")
# Prepare the actor input
run_input = {
"startUrls": [{ "url": "https://www.facebook.com/humansofnewyork/" }],
"resultsLimit": 20,
"proxy": {
"useApifyProxy": True,
"apifyProxyGroups": ["RESIDENTIAL"],
},
"maxRequestRetries": 10,
}
# Run the actor and wait for it to finish
run = client.actor("apify/facebook-posts-scraper").call(run_input=run_input)
# Fetch and print actor results from the run's dataset (if there are any)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)
# Set API token
API_TOKEN=<YOUR_API_TOKEN>
# Prepare actor input
cat > input.json <<'EOF'
{
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork/"
}
],
"resultsLimit": 20,
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
},
"maxRequestRetries": 10
}
EOF
# Run the actor
curl "https://api.apify.com/v2/acts/apify~facebook-posts-scraper/runs?token=$API_TOKEN" \
-X POST \
-d @input.json \
-H 'Content-Type: application/json'
startUrls
Required Array
Submit the valid URL of the public Facebook page—for example, https://www.facebook.com/humansofnewyork/. Remember to avoid using personal profile URLs.
resultsLimit
Optional Integer
The scraper will return initial page outputs if you don't set any limit.
proxy
Required Object
It would help if you used proxy servers to run this scraper. There are two options to use proxies, like using your proxy or residential proxies from our platform.
maxRequestRetries
Optional Integer
maxConcurrency
{
"startUrls": [
{
"url": "https://www.facebook.com/humansofnewyork/"
}
],
"resultsLimit": 20,
"proxy": {
"useApifyProxy": true,
"apifyProxyGroups": [
"RESIDENTIAL"
]
},
"maxRequestRetries": 10
}