# Facebook User Search Scraper (`lexis-solutions/facebook-user-search-scraper`) Actor

The Facebook User Search Scraper can obtain public data of profiles given a profile URL or a name to search. You can use it as a Facebook user matcher, user finder, or user enricher to connect your apps.

- **URL**: https://apify.com/lexis-solutions/facebook-user-search-scraper.md
- **Developed by:** [Lexis Solutions](https://apify.com/lexis-solutions) (community)
- **Categories:** Lead generation, Social media
- **Security:** Limited permissions
- **Stats:** 1,018 total users, 7 monthly users, 100.0% runs succeeded, 41 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $10.40 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Facebook User Search Scraper

![banner](https://lexis-solutions-apify.fra1.cdn.digitaloceanspaces.com/facebook-user-search/banner.jpg)

### What is the Facebook User Search Scraper?

The Facebook User Search Scraper is a web scraping tool that allows you to scrape Facebook user search results. It can be used obtain public data of a profile given profile URL, or a list of profiles given a search query (name).

[Video tutorial](https://www.youtube.com/watch?v=toUxSsLKadk "Scraping Facebook Users on Apify with Facebook User Search Scraper")

### 🔎 Using the Actor as a Facebook Profile Matcher

Do you have a list of users in your database and want to match them with their Facebook profiles? Simply enter the name of the user from your database, and the scraper will return matching Facebook profiles.

### 🔦 Using the actor as a Facebook Profile Finder

Find a public Facebook profile by entering the profile URL. The scraper will return the profile data in JSON, XML or CSV format.

### 💎 Using the actor as a Facebook Profile Enricher

The Facebook User Search Scraper can be used to enrich your existing user database with Facebook profiles. You can connect your backend to the actor via API and automatically enrich your user database with Facebook profiles.

### What data can the Facebook User Search Scraper extract?

The Facebook User Search Scraper can extract the following data from Facebook user search results:

- Name
- Profile URL
- Profile Picture URL
- Cover Photo URL
- Uploaded Image URLs
- Education History
- Work History

### What use cases does the Facebook User Search Scraper?

- 👍 **Profile Matching** - you can use the facebook user to enrich your existing user database with Facebook profiles. This can be useful for matching users across different platforms.
- 📈 **Market Research** - you can use the facebook user to obtain data about your competitors' customers. This can be useful for market research and competitor analysis.
- 📊 **Lead Generation** - you can use the facebook user to understand your target audience better. This can be useful for lead generation and sales.

### How to use the Facebook User Search Scraper?

1. Create a free Apify account
2. Open Facebook User Search Scraper
3. Add either a profile URL or a search query
4. Click Start and wait for the results
5. Download the results in JSON, XML or CSV format or connect the actor to your backend via API

### 📥 Input

To run the actor, simply enter either a:

- **Profile URL** - the URL of the profile you want to scrape (e.g. https://www.facebook.com/zuck)

- **Search Query** - the name of the person you want to search for (e.g. Mark Zuckerberg)

If you enter both a profile URL and a search query, the actor will use the profile URL.

## 📤 Output

The results are stored in the default dataset associated with the actor. Each item is an ad, having the following format:

```json
{
  "name": "Mark Zuckerberg",
  "profileImage": "https://scontent-bos5-1.xx.fbcdn.net/v/t31.18172-8/19575079_10103832396388711_8894816584589808440_o.jpg?stp=dst-jpg_p480x480&_nc_cat=109&ccb=1-7&_nc_sid=e3f864&_nc_ohc=eqDM8yh9GWsAX-TfaBE&_nc_ht=scontent-bos5-1.xx&oh=00_AfDscZ8EhrdqknNoPoOWRmQr56-zPwtioanbMu-cp4TjDA&oe=6541E03D?f=.jpg",
  "coverImage": "https://scontent-bos5-1.xx.fbcdn.net/v/t31.18172-8/19575079_10103832396388711_8894816584589808440_o.jpg?stp=dst-jpg_p480x480&_nc_cat=109&ccb=1-7&_nc_sid=e3f864&_nc_ohc=eqDM8yh9GWsAX-TfaBE&_nc_ht=scontent-bos5-1.xx&oh=00_AfDscZ8EhrdqknNoPoOWRmQr56-zPwtioanbMu-cp4TjDA&oe=6541E03D",
  "images": [
    "https://scontent-bos5-1.xx.fbcdn.net/v/t39.30808-6/305639385_10114682386840871_3268767058260494617_n.jpg?stp=c0.18.160.160a_dst-jpg_p160x160&_nc_cat=105&ccb=1-7&_nc_sid=ce01d1&_nc_ohc=I_opInkXph4AX-nMjL_&_nc_ht=scontent-bos5-1.xx&oh=00_AfAzk9yL8vnDcBXzo9c9Zc-pI-JZVrZEL4Q5w2RutfmqHA&oe=651EEE21"
  ],
  "userId": "4",
  "profileUrl": "https://www.facebook.com/profile.php?id=4",
  "userData": [
    {
      "type": "work",
      "text": "Works at Chan Zuckerberg Initiative",
      "icon": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.30808-1/311294933_477853641045896_6686128975185982862_n.jpg?stp=cp0_dst-jpg_p24x24&_nc_cat=100&ccb=1-7&_nc_sid=5fac6f&_nc_ohc=RA0Dim8hGOYAX-hfI5a&_nc_ht=scontent-bos5-1.xx&oh=00_AfDi_RMA9ejHQa3OxE5CvFv0Vi5CK7KmoRgQ-hnECc5G9A&oe=651E64E5"
    },
    {
      "type": "work",
      "text": "Founder and CEO at Meta",
      "icon": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.30808-1/249340936_460684055493192_7689068624385396462_n.png?stp=cp0_dst-png_p24x24&_nc_cat=1&ccb=1-7&_nc_sid=5fac6f&_nc_ohc=O2bjKiwVdAkAX8nzTzK&_nc_ht=scontent-bos5-1.xx&oh=00_AfCSG_IluQ6fqd_wS9W-dIjaN8yHnliFgMSyv04o1tsBJg&oe=651EDE63"
    },
    {
      "type": "education",
      "text": "Studied Computer Science and Psychology at Harvard University",
      "icon": "https://scontent-bos5-1.xx.fbcdn.net/v/t39.30808-1/279079571_364449472388453_298263262942608273_n.jpg?stp=cp0_dst-jpg_p24x24&_nc_cat=1&ccb=1-7&_nc_sid=5fac6f&_nc_ohc=olAe-Z0BBIoAX9u82ol&_nc_ht=scontent-bos5-1.xx&oh=00_AfAYx_ymfJzgbJFaX1v1oJ4ZgIue46kf5H7Qm5oL-swOog&oe=651FD3FD"
    },
    {
      "type": "education",
      "text": "Went to Phillips Exeter Academy",
      "icon": "https://scontent-bos5-1.xx.fbcdn.net/v/t1.30497-1/83245568_1845797888897938_3274147281632231424_n.png?stp=c7.0.24.24a_cp0_dst-png_p24x24&_nc_cat=1&ccb=1-7&_nc_sid=dbb9e7&_nc_ohc=LCeoeytjcgwAX_Lp8Mo&_nc_ht=scontent-bos5-1.xx&oh=00_AfBBt1zAZ9IZF8kujxCvgNPAa_0XUQGuQsVi7axgx3v7Ow&oe=6541C214"
    },
    {
      "type": "education",
      "text": "Went to Ardsley High School",
      "icon": "https://scontent-bos5-1.xx.fbcdn.net/v/t1.30497-1/83245568_1845797888897938_3274147281632231424_n.png?stp=c7.0.24.24a_cp0_dst-png_p24x24&_nc_cat=1&ccb=1-7&_nc_sid=dbb9e7&_nc_ohc=LCeoeytjcgwAX_Lp8Mo&_nc_ht=scontent-bos5-1.xx&oh=00_AfBBt1zAZ9IZF8kujxCvgNPAa_0XUQGuQsVi7axgx3v7Ow&oe=6541C214"
    }
  ]
}
```

### How many results can I scrape?

The user search currently uses infinite scroll to load all the profiles on the page. This means that the actor will keep scrolling until it reaches the end of the page, and then it will start extracting the profiles. To control the number of scrolls, you can use the `scrollsAmount` input field.

### Why use the Facebook User Search Scraper?

- ⚡️ **Fast** - The scraper is fast and efficient, allowing you to scrape profiles in a programmatic way.

- 🤙 **Easy to use** - The scraper is easy to use and requires no coding knowledge. All you need to do is input the query you want to scrape and the scraper will do the rest.

- ☑️ **Well-Maintained** - The scraper is maintained by the Lexis Solutions team, ensuring that it is always up-to-date and working properly.

### FAQ

- **Is Scraping Facebook Profiles Legal?**

  The current scraper only scrapes public data from Facebook profiles. This means that the data is publicly available and can be accessed by anyone. However, we recommend that you check Facebook's Terms of Service before using the scraper.

- **How much does it cost?**

  The cost for using the Facebook User Search Scraper is shown on the top of this page. You can also check the Apify Store page for more information.

- **I can't visualize images from the dataset. What do I do?**

  Facebook has strict privacy policies and might not allow images to be visualized on sites different than Meta's platforms. To visualize the images, you can download the images from a non-browser environment, e.g Node.js, and copy the assets into your own storage.

### Related Scrapers by Lexis Solutions

- [Facebook Videos Search Scraper](https://apify.com/lexis-solutions/facebook-videos-watch-scraper) - Scrape Facebook videos.
- [Bluesky Users Scraper](https://apify.com/lexis-solutions/bluesky-users-scraper) - Scrape Bluesky users.
- [Bluesky Posts Scraper](https://apify.com/lexis-solutions/bluesky-posts-scraper) - Scrape Bluesky posts.

***

👀 p.s.

Got feedback or need an extension?

Lexis Solutions is a [certified Apify Partner](https://apify.com/partners/find). We can help you with custom solutions or data extraction projects.

Contact us over [Email](mailto:scraping@lexis.solutions) or [LinkedIn](https://www.linkedin.com/company/lexis-solutions)

### Support Our Work 💝

If you're happy with our work and scrapers, you're welcome to leave us a company review [here](https://apify.com/partners/find/lexis-solutions/review) and leave a review for the scrapers you're subscribed to. It will take you less than a minute but it will mean a lot to us!

# Actor input Schema

## `startUrls` (type: `array`):

Facebook Profile URLs

## `query` (type: `string`):

Name of the person you want to search for

## `maxItems` (type: `integer`):

Maximum number of profiles to scrape

## `scrollsAmount` (type: `integer`):

Number of scrolls to perform on the list

## Actor input object example

```json
{
  "query": "larosalía smith",
  "maxItems": 10,
  "scrollsAmount": 1
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("lexis-solutions/facebook-user-search-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("lexis-solutions/facebook-user-search-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call lexis-solutions/facebook-user-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lexis-solutions/facebook-user-search-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/QPxRUFpewktSum8QR/builds/wtNmdgFLH4uI5ALDj/openapi.json
