How to scrape and collect data from Facebook?

Facebook Data Scraper API

Scrape and collect data from Facebook sounds interesting. With more than 2.85 billion users worldwide, Facebook is not just a social network. Constantly reinventing itself, the social network has diversified and is today a powerful commercial platform. Consumers connect directly to brands and interact with their content.

Facebook is full of interesting data to follow trends. Although Facebook offers an API, data collection will be very limited because the social network has tightened its security to avoid extracting too much data in a short time. Otherwise you can very easily see your API key blocked.

 

To overcome this problem, ScrapingBot offers a Facebook scraper to scrape and collect public data from Facebook profile pages and Facebook organization pages.
Get the data you want in JSON, without any blocking.

Example of the data you can collect:

  • Facebook profiles
    URL, profile picture URL, profile name, verified profiles, profiletype, likes, followers, last posts informations.
  • Facebook organizations:
    URL, profile image, avatar, name, verified, type, likes, followers, story, contact information, address, website, category, username, related pages informations

How to start scraping Facebook?

ScrapingBot is here to help you scrape Facebook profiles and organizations pages as easily and efficiently as possible.

Start scraping Facebook in 3 steps:

1. Create an account

Want to start scraping Facebook right now? No problem, ScrapingBot offers FREE ACCESS with 100 credits per month to get started. No payment information required, and no any engagement.
If you already have an account, just log in.

Landing page of Scraping Bot API
From the homepage, click on "FREE PLAN" or "Register" to create a free account.

2. Configure your scraping

Once your account has been created, go to Documentation, to the "Data Scraper API" section to be able to start scraping what you want.

Setting up the endpoint is a two-step process with two API calls.
It's a little longer than usual because social networks have many protections to avoid robots and get scraped. These two calls make it possible to recover the data without being blocked.

Step 1 : Get your Response ID

First, you must make a first POST request to get the ResponseID which will be used later.
To do this, you must enter the following parameters in the body, then run a first API call:

  • scraper
    ("facebookProfile" to scrape Facebook profiles, or "facebookOrganization" to scrape Facebook organization pages)
  • url
    The URL of the Facebook profile or organization page you want to scrape.

Here is the Request Endpoint:
http://api.scraping-bot.io/scrape/data-scraper

Step 2 : Configure your second request

Now that you have your responseId, you will be able to configure a GET request to ask for the response.

Here is the Response Endpoint:
http://api.scraping-bot.io/scrape/data-scraper-response?responseId=xxxx&scraper=name

Complete the Response Endpoint with these parameters:

  • responseId
    Insert here the Response ID that you had with the POST API call
  • scraper
    You must fill in the same as that used previously for the POST API call ("facebookProfile" or "facebookOrganization")

When it's ready, execute the API call. The result you will get will tell you if the scraping is ready to use or not.
If it's not, you will get this pending message:

{status: "pending", message: "Scraping is not finished for this request, try again in a few"}

In this case, you have to try again until it's ready.

3. Let's scraping!

Your web scraping setup is now ready to use!
You can start collecting data from Facebook Profile and Company Pages.


NB: If you need more help, a sample code to execute the call to this API is available in the documentation right here ("Data Scraper API" section).

Comments are closed.