Apify Facebook Page Search Scraper avatar
Apify Facebook Page Search Scraper
Try for free

2 hours trial then $25.00/month - No credit card required now

View all Actors
Apify Facebook Page Search Scraper

Apify Facebook Page Search Scraper

memo23/apify-facebook-page-search-scraper
Try for free

2 hours trial then $25.00/month - No credit card required now

Scrape facebook pages from search and get important details such as page name, description, photo url, is verified, tag or category, reviews, price range, location, hours open, number of followers and page link.

Facebook Search Pages Scraper

How it works

This actor allows you to scrape facebook pages from search and get important details such as page name, description, photo url, is verified, tag or category, reviews, price range, location, hours open, number of followers and page link.

Features

Multiple Search Queries: Supports scraping based on multiple search URLs, formatted as https://www.facebook.com/search/pages/?q=your_query. Required Authentication over cookies: Users can log in to access a broader range of questions and answers. Customizable: Flexible configuration options to suit various scraping needs.

How to Use

  1. Set Up: Ensure you have an Apify account and access to the Apify platform.
  2. Install EditThisCookie chrome extension.
  3. Login to your facebook account
  4. While you are on facebook tab, Click on the extension and export the cookies
  5. Paste the cookies to this actor's Cookie input field
  6. Specify the Facebook page URL you want to scrape. Input your search URLs in the format https://www.facebook.com/search/pages/?q=your_query. You can add multiple URLs for a broader search scope.
  7. Set Max pages to scrape limits to determine the number of pages to scrape.
  8. Set Min delay for scroll and Max delay for scroll to ensure facebook doesn't block you and to get maximum results.
  9. (Optional) Configure proxy settings for enhanced reliability.
  10. Run the actor and obtain the extracted data in your preferred format.
  11. Data Collection: The scraper will output data in your chosen format, which can include JSON, HTML, CSV, Excel, or others as supported by Apify.

Input Data

Here's a simple example of how to set up a search for "medical" pages in Facebook:

1{
2    "cookies": [
3        {
4            "domain": ".facebook.com",
5            "expirationDate": 1740231415.466268,
6            "hostOnly": false,
7            "httpOnly": false,
8            "name": "c_user",
9            "path": "/",
10            "sameSite": "no_restriction",
11            "secure": true,
12            "session": false,
13            "storeId": "0",
14            "value": "1248804295",
15            "id": 1
16        }
17    ],
18    "maxDelay": 5,
19    "maxPages": 100,
20    "minDelay": 2,
21    "proxyConfiguration": {
22        "useApifyProxy": true,
23        "apifyProxyGroups": [
24            "RESIDENTIAL"
25        ]
26    },
27    "startUrls": [
28        {
29            "url": "https://www.facebook.com/search/pages/?q=medical"
30        }
31    ]
32}

Output Structure

The output data typically includes:

1[
2    {
3        "photoURL": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.30808-1/306846814_423362846571327_4917551001442052445_n.jpg?stp=dst-jpg_p120x120&_nc_cat=111&ccb=1-7&_nc_sid=596444&_nc_ohc=2NrfcAKSvHsAX85YZ9j&_nc_ht=scontent-dfw5-1.xx&oh=00_AfD26kE60OJpcolr8-EFnQhtUDNz7p1MXcd1MVpj0c3suw&oe=65E9609C",
4        "pageName": "Medical Doctor",
5        "isVerified": "no",
6        "tag": "Interest",
7        "reviews": null,
8        "priceRange": null,
9        "location": null,
10        "hoursOpen": null,
11        "followers": "70K followers",
12        "description": "Very informative page DR.M YOUNAS YOUN",
13        "pageLink": "https://www.facebook.com/DrMYounasYoun?__tn__=%3C"
14    },
15    {
16        "photoURL": "https://scontent-dfw5-1.xx.fbcdn.net/v/t39.30808-1/291913655_448178280648528_8458411385390160351_n.png?stp=dst-png_p120x120&_nc_cat=105&ccb=1-7&_nc_sid=596444&_nc_ohc=NDa4IochBh0AX9yOoZ1&_nc_ht=scontent-dfw5-1.xx&oh=00_AfCvFjgGw-H8imQNORUWh4QJMeGxKgsXIPYo_6RsVgTugQ&oe=65E8977A",
17        "pageName": "Medical",
18        "isVerified": "no",
19        "tag": "Medical Company",
20        "reviews": "5 out of 5 (1 Review)",
21        "priceRange": null,
22        "location": "43.9 mi",
23        "hoursOpen": "Closed now",
24        "followers": "269 followers",
25        "description": "MEDICAL d.o.o. represents, sells, and services medical equipment of the world's largest manufacturers.",
26        "pageLink": "https://www.facebook.com/medical.mostar?__tn__=%3C"
27    },
28    ...
29]

Best Practices

  • Rate Limiting: Respect facebooks's terms of service by avoiding overly frequent requests.
  • Ensure min and max delay so facebook doesn't block you.
  • Error Handling: Implement robust error handling to manage request failures or unexpected data formats.
  • Data Storage: Utilize Apify's data storage solutions for efficient data management.
Developer
Maintained by Community
Actor metrics
  • 8 monthly users
  • 100.0% runs succeeded
  • 39.7 days response time
  • Created in Feb 2024
  • Modified 11 days ago