# Facebook Pages Search Scraper - Contacts, Followers & Ratings (`topapi/facebook-pages-search-scraper`) Actor

Search Facebook Pages by keyword and location: name, Page ID, category, followers, rating, phone, email, website, address with coordinates, hours, price range, social links, creation date and ad status. Facebook's own search, no login. $1.60 per 1,000 Pages, $3.60 with the profile.

- **URL**: https://apify.com/topapi/facebook-pages-search-scraper.md
- **Developed by:** [Top Api](https://apify.com/topapi) (community)
- **Categories:** Social media, Lead generation
- **Features:** Limited permissions
- **Stats:** 10 total users, 8 monthly users, 98.6% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.60 / 1,000 pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

### What does Facebook Pages Search Scraper do?

**Facebook Pages Search Scraper** searches Facebook Pages by keyword (with a city or country in the same words) and returns one row per Page found: name, URL, Facebook ID, Page ID, category, followers, rating, phone, email, website, address with coordinates, opening-hours state, price range, services, social links, the date the Page was created and whether it is running ads. Built for lead lists, local-market research and agency prospecting.

Facebook page search scraper · Facebook business page finder · Facebook pages by keyword

- **Facebook's own Pages search:** the list a Facebook visitor sees for your words, in Facebook's order (`searchRank`), read signed out
- **The Page profile in the same row:** the Page's own About tab and Page transparency tab, read for every Page found
- **Coordinates, WhatsApp, creation date and ad status:** from the Page itself, plus every About field as Facebook prints it (`aboutFields`)
- **Filters before the charge:** category, followers, email / phone / website present or absent, recommendation %, ad status, creation date, verified, location mentioned
- **Monitor mode:** schedule the same search and get only the Pages that are new (or changed) since the last run
- **No login, cookies or Facebook API key:** plain HTTP, no browser
- **Pay only for delivered rows:** no start fee; a filtered-out or already-delivered Page is never charged
- **Export anywhere:** JSON, CSV, Excel, XML; schedules, webhooks, Make, Zapier, n8n, Google Sheets; the Apify API and MCP server for AI agents

### What data can you get from Facebook Pages?

<table>
<tr><td>📛 Page name, title (`title`: "Name | City ST")</td><td>🔗 Page URL, username (`pageName`)</td><td>🆔 Facebook ID + classic Page ID</td></tr>
<tr><td>🏷️ Categories</td><td>👥 Followers, following, talking about, were here</td><td>⭐ Rating line, recommend %, review count</td></tr>
<tr><td>☎️ Phone(s)</td><td>📧 Email(s)</td><td>🌐 Website(s)</td></tr>
<tr><td>📍 Address + latitude / longitude</td><td>🕒 Hours state ("Open now")</td><td>💲 Price range + level 1-4</td></tr>
<tr><td>🛎️ Services, service area</td><td>📱 Instagram, TikTok, X, YouTube... (`socialLinks`), WhatsApp</td><td>📝 Intro</td></tr>
<tr><td>📅 Page creation date</td><td>📢 Ad status (`isRunningAds`) + Ad Library link</td><td>🏢 Confirmed owner (when Facebook names one)</td></tr>
<tr><td>✅ Verified badge</td><td>🖼️ Profile picture + cover photo</td><td>🔎 Search term, location, rank</td></tr>
</table>

Measured over 305 Pages read with their profile (2026-10-28, US / Canada / UK searches): category 100%, followers 96%, creation date and ad status 95%, rating line 75%, address 64% (coordinates 45%), phone 63%, email 51%, website 50%, hours 45%, price range 28%, social links 12%, WhatsApp 4%. Empty means the Page shows nothing there.

### How to scrape Facebook Pages with Facebook Pages Search Scraper

1. [Create a free Apify account](https://console.apify.com/sign-up): $5 of monthly credit, no card needed.
2. Open [Facebook Pages Search Scraper](https://apify.com/topapi/facebook-pages-search-scraper) and click **Try for free**.
3. Type your **Search terms** (one per line, e.g. `dentist`) and, optionally, a **Location** (`Austin, TX`).
4. Set **Maximum Pages in total** and leave **Page profile** on for phones, emails and the rest.
5. Click **Start**. Rows stream into the dataset as Pages are found.
6. Open the **Storage** tab and **Export** as JSON, CSV or Excel, or let a schedule run it for you.

### ⬇️ Input

| Field | What it does | Default |
|---|---|---|
| `categories` (Search terms) | Words to search, one per line. Facebook matches them against Page names: "plumber austin" finds Pages with those words in their name. Also accepted: `searchQueries`, `searchTerms`, `queries`, `query`, `keywords`. | sample "pizza" |
| `locations` | City, region or country added to each search term ("pizza New York"); each term runs once per location. | none |
| `searchType` | `pages` (Facebook's Pages search) or `places` (its Places search). Same row either way. | `pages` |
| `resultsLimit` | Stop after this many Pages in the whole run (0 = no limit). Also `maxItems`. | 100 |
| `maxResultsPerSearch` | Stop each term x location after this many Pages. | none |
| `startUrls` | Facebook search links (`facebook.com/search/pages/?q=...`, `/search/places/?q=...`). | none |
| `includeDetails` | Read each Page's About tab for its profile (charged as `page-details`). Off = search result only. | on |
| `includeTransparency` | With the profile, also read the Page transparency tab: Page ID, creation date, ad status, owner. | on |
| `includeAboutText` | With the profile, also read the "Details about" tab for the full About text (`about_me`). | off |
| `categoryContains`, `verifiedOnly`, `minFollowers`, `maxFollowers` | Keep only matching Pages. | off |
| `withEmailOnly`, `withPhoneOnly`, `withWebsiteOnly`, `withoutWebsiteOnly` | Keep only Pages that show (or lack) these. | off |
| `minRatingPercent` | Keep only Pages recommended by at least this share of reviewers. | off |
| `adsStatus` | `any`, `running` (advertising now) or `notRunning`. | `any` |
| `createdAfter`, `createdBefore` | Keep only Pages created in this window (YYYY-MM-DD). | off |
| `strictLocation` | Keep only Pages whose title, address, name or intro mentions the location. | off |
| `excludePageIds` | Facebook IDs never to deliver. | none |
| `monitorMode`, `monitorChanges`, `monitorStoreName` | Deliver only new (and, optionally, changed) Pages since the last run. | off |
| `maxConcurrency` | Profiles read at the same time. | 5 |
| `requestDelayMs` | Spacing between About-tab requests on one IP. | 500 |
| `residentialProfiles` | When Facebook refuses profiles on the container IP and every datacenter IP of the run, read the rest over one residential IP (About tab only). | off |
| `proxyConfiguration` | Your own proxy replaces the built-in IP ladder for every request. | Apify Proxy |

Every filter except `verifiedOnly` reads the profile, so it turns `includeDetails` on. A filtered-out Page is not charged.

#### Example input

```json
{
    "categories": ["dentist", "orthodontist"],
    "locations": ["Austin, TX"],
    "resultsLimit": 200,
    "withPhoneOnly": true,
    "strictLocation": true
}
```

### ⬆️ Output

One item per Page. A real row from a run on 2026-10-28 (picture links shortened, `info`, `intro`, `emails`, `phones`, `aboutFields` and the empty fields left out here):

```json
{
    "facebookUrl": "https://www.facebook.com/Grandladyaustin",
    "pageUrl": "https://www.facebook.com/Grandladyaustin",
    "pageName": "Grandladyaustin",
    "facebookId": "100060740657114",
    "pageId": "109933917042138",
    "name": "The Grand Lady",
    "title": "The Grand Lady | Manor TX",
    "isVerified": false,
    "description": "Family-run Austin wedding venue in Manor, TX: a restored 1881 mansion, a modern 3,400 sq ft hall, a half-acre flower farm and oak-grove grounds on 20 acres. Up to 250 guests, 25 min from downtown Austin. In-house florist. Tours by appointment.",
    "categories": ["Wedding Venue"],
    "category": "Wedding Venue",
    "followers": 1766,
    "followersText": "1.7K followers",
    "followings": 0,
    "talkingAbout": 51,
    "wereHere": 4324,
    "rating": "100% recommend (8 reviews)",
    "ratingPercent": 100,
    "ratingCount": 8,
    "email": "info@grandladyaustin.com",
    "phone": "(737) 210-1519",
    "address": "19704 Hog Eye Rd, Manor, TX, United States, 78653",
    "latitude": 30.29632,
    "longitude": -97.50597,
    "website": "https://grandladyaustin.com/",
    "websites": ["https://grandladyaustin.com/", "https://www.tiktok.com/@grandladyaustin", "https://www.theknot.com/marketplace/grand-lady-austin-manor-tx-2030167", "https://www.youtube.com/@GrandLadyAustin", "https://www.zola.com/wedding-vendors/wedding-venues/the-grand-lady", "https://www.pinterest.com/GrandLadyAustin/", "https://www.weddingwire.com/biz/grand-lady-austin/8b3a7d327c0ae319.html"],
    "socialLinks": [{ "platform": "instagram", "handle": "grandladyaustin", "url": "https://www.instagram.com/grandladyaustin" }],
    "instagram": "grandladyaustin",
    "hours": "Closed now",
    "priceRange": "$$",
    "priceLevel": 2,
    "creation_date": "August 23, 2019",
    "creationDate": "2019-08-23",
    "ad_status": "This Page is currently running ads.",
    "isRunningAds": true,
    "pageAdLibrary": { "id": "109933917042138", "is_business_page_active": false },
    "adLibraryUrl": "https://www.facebook.com/ads/library/?active_status=all&ad_type=all&country=ALL&view_all_page_id=109933917042138",
    "profilePictureUrl": "https://scontent-iad6-1.xx.fbcdn.net/v/t39.30808-1/361092691_...jpg",
    "coverPhotoUrl": "https://scontent-iad6-1.xx.fbcdn.net/v/t39.30808-6/487027268_...jpg",
    "searchType": "pages",
    "searchQuery": "florist",
    "searchLocation": "Austin",
    "searchRank": 25,
    "detailsIncluded": true,
    "transparencyIncluded": true,
    "detailsError": null,
    "scrapedAt": "2026-10-28T12:16:56.764Z"
}
```

Every row also carries `aboutFields`: each About field as Facebook prints it (`{type, value, label, url}`), so a field this README does not name is still in the data. The dataset has three views: **Pages**, **Contacts** and **Transparency**. Each run writes a `RUN_SUMMARY` record: per search, the result pages read, Pages listed and delivered and why it stopped; the filters; the IPs used.

### How much does it cost to scrape Facebook Pages?

Pay per event, no start fee, no monthly rent:

| Event | Price | When |
|---|---|---|
| `page` | **$0.0016** ($1.60 per 1,000) | every Page row delivered |
| `page-details` | **$0.002** ($2.00 per 1,000) | a row that carries the Page profile |

A row with the profile is **$3.60 per 1,000**; search results only, $1.60 per 1,000. Measured on 2026-10-28: 100 Pages for "hair salon" and "auto repair" in Phoenix took 113 s (60 with the profile: $0.28); 91 search-result rows took 70 s ($0.15). Set **Maximum cost per run** in the Console (or `maxTotalChargeUsd` in the API) and the run stops there: a 0.008 USD limit delivered exactly 2 full rows.

### How many Pages does one run return?

- **Search depth is Facebook's.** Its list for one term ended at 45 Pages ("gym Toronto"), 75 ("plumber austin"), 202 ("dentist london") and went past 338 ("restaurant"). More terms or more locations give more Pages.
- **Search per IP.** Facebook's signed-out search answers about 27 result pages (~200 Pages) per IP before it says "Rate limit exceeded". A run climbs from the Apify container IP to one datacenter IP and then a residential IP; when Facebook refuses that residential IP, the search moves to a fresh one, up to 3 times a run. Since November 2026 Facebook refuses the signed-out search from the container and datacenter IPs on the first call, so the search runs on residential IPs. Schedule several runs, or give it your own proxy, for more.
- **Profiles per IP.** After a few dozen profiles Facebook answers its login page to a signed-out IP: measured 11-60 profiles on the container IP and 10-49 on a datacenter IP. When the datacenter IP is refused the run takes a fresh one, up to 4 times. Pages found after all of them are refused are delivered as search results (charged `page` only, `detailsError` says why) unless `residentialProfiles` is on.

### Run it on a schedule

Turn on **Monitor mode**, keep the same search terms and add a schedule in the Console (Schedules → Create, e.g. every Monday 09:00). Each run delivers, and charges, only Pages no earlier run delivered (remembered in the named key-value store `monitorStoreName`). With **Also deliver changed Pages**, a known Page comes back when its followers, category, rating, phone, email, website or ad status changed, with `monitorStatus: "changed"` and `previousStats`. Pair it with **Page created on or after** to collect new local businesses every week.

API call (Node.js):

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('topapi/facebook-pages-search-scraper').call({
    categories: ['roofing contractor'],
    locations: ['Denver'],
    resultsLimit: 100,
    monitorMode: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

### Use cases

- **Local lead lists:** every dentist, roofer or salon Facebook lists for a city, with phone, email and website
- **Agency prospecting:** `withoutWebsiteOnly` finds businesses with no website; `adsStatus: notRunning` finds ones not advertising
- **Ad intelligence:** `adsStatus: running` + the Ad Library link for every advertiser in a niche
- **New-business alerts:** monitor mode + `createdAfter`
- **Market maps:** followers, rating and price level per category per city, with coordinates for a map

### FAQ

**Do I need a Facebook account or cookies?** No. The actor reads what Facebook shows a signed-out visitor.

**Why do some rows have no phone or email?** The Page does not show one. Empty is never filled in or guessed.

**Why are some rows search results only?** Facebook stopped serving Page profiles to the run's IPs (see "How many Pages does one run return?"). Those rows are charged $0.0016, not $0.0036; run again later or turn on `residentialProfiles`.

**Can I filter by city?** Facebook offers no location filter to signed-out visitors (its Pages location filter answers 0 results signed out), so the location is added to the search words. Turn on `strictLocation` to drop Pages from elsewhere with similar names.

**Why does the same search return a different list tomorrow?** Facebook's ranking changes between visits. Monitor mode keeps track by Facebook ID.

**Is `followers` exact?** Yes, from the Page's own description ("965,805 followers"); `followersText` is the rounded header ("965K followers").

**What is the difference between `facebookId` and `pageId`?** `facebookId` is the profile ID (the number in `profile.php?id=`), stable for the key. `pageId` is the classic Page ID used by the Ad Library and the transparency tab.

**Why no likes count?** Facebook's current Page layout shows followers only: none of 305 profiles read printed a likes count.

**Why no star rating?** Facebook shows a recommendation share ("98% recommend (27 reviews)"), kept as `rating`, `ratingPercent` and `ratingCount`.

**Why no Messenger link, payment methods or recent posts?** Facebook does not print a Messenger link or payment methods on the signed-out About tab (none of 305 profiles had one), and recent posts are a posts scraper's row.

**Can I give it Page URLs instead of keywords?** This actor finds Pages by searching. For a list of Page URLs use a Facebook Page scraper.

### Other Facebook scrapers

- [Facebook Search Posts Scraper](https://apify.com/topapi/facebook-search-posts-scraper): public posts by keyword
- [Facebook Posts Scraper](https://apify.com/topapi/facebook-page-posts-scraper): a Page's posts with reactions
- [Facebook Reviews Scraper](https://apify.com/topapi/facebook-reviews-scraper): a Page's recommendations and reviews
- [Facebook Events Scraper](https://apify.com/topapi/facebook-events-scraper): events by keyword, city or Page
- [Facebook Photos Scraper](https://apify.com/topapi/facebook-photos-scraper): a Page's photos and albums

# Actor input Schema

## `categories` (type: `array`):

What to search for, one per line: a kind of business ("dentist"), a brand or a Page name. Each term is searched on its own with Facebook's own Pages search, the list a Facebook visitor sees. Facebook matches the words against Page names, so "plumber austin" finds Pages with those words in their name. Facebook search URLs (facebook.com/search/pages/?q=...) can go in "Facebook search URLs" below.

## `locations` (type: `array`):

Optional city, region or country, one per line, e.g. "New York" or "Austin, TX". Each search term is searched once per location, with the location added to its words ("pizza New York"), as the leader does. Facebook offers no location filter to signed-out visitors (measured: its Pages location filter answers 0 results signed out), so turn on "Only Pages that mention the location" to drop Pages from elsewhere.

## `searchType` (type: `string`):

Pages = Facebook's Pages search (businesses, brands, organisations, creators). Places = Facebook's Places search (Pages with a physical location). Both return the same Page row.

## `resultsLimit` (type: `integer`):

Stop the run after this many Pages across every search. You pay only for Pages delivered. 0 = no limit.

## `maxResultsPerSearch` (type: `integer`):

Stop each search term (x location) after this many Pages. Empty = only the total limit applies. Facebook's own list ends sooner for narrow terms: measured 75 Pages for "plumber austin", 202 for "dentist london", 338+ for "restaurant".

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

Facebook search links such as https://www.facebook.com/search/pages/?q=coffee%20roaster or /search/places/?q=... The words in q= are searched like a search term.

## `includeDetails` (type: `boolean`):

On: each Page's own About tab is read for its profile: category, followers, talking about, were here, intro, phone, email, website, address with coordinates, social links, rating, hours, price range and services. Charged as the page-details event on the rows that carry it. Off: the search result only (name, URL, ID, verified badge and picture), a lighter row at its own lower price.

## `includeTransparency` (type: `boolean`):

With the profile: also read the Page transparency tab for the Page ID, the date the Page was created, whether it is running ads now and the confirmed owner. Included in the page-details price.

## `includeAboutText` (type: `boolean`):

With the profile: also read the Page's "Details about" tab for its full About text and the links in it (about_me). Included in the page-details price; it is a third tab per Page, so it uses up Facebook's per-IP allowance for profiles 50% sooner.

## `categoryContains` (type: `array`):

Keep only Pages whose Facebook category contains one of these words, e.g. "Dentist" or "Pizza place". Not case sensitive. Reads the profile (charged as page-details).

## `verifiedOnly` (type: `boolean`):

Keep only Pages with Facebook's verified badge.

## `minFollowers` (type: `integer`):

Keep only Pages with at least this many followers.

## `maxFollowers` (type: `integer`):

Keep only Pages with at most this many followers (small local businesses).

## `withEmailOnly` (type: `boolean`):

Keep only Pages that show an email address.

## `withPhoneOnly` (type: `boolean`):

Keep only Pages that show a phone number.

## `withWebsiteOnly` (type: `boolean`):

Keep only Pages that link a website.

## `withoutWebsiteOnly` (type: `boolean`):

Keep only Pages that link no website (businesses that may need one).

## `minRatingPercent` (type: `integer`):

Keep only Pages whose reviewers recommend them at least this often ("94% recommend" = 94). Pages not yet rated are dropped when this is set.

## `adsStatus` (type: `string`):

Keep only Pages that are running ads now, or only Pages that are not (from the Page transparency tab).

## `createdAfter` (type: `string`):

Keep only Pages created on or after this date (YYYY-MM-DD), from the Page transparency tab. Use it with monitor mode to collect new businesses on a schedule.

## `createdBefore` (type: `string`):

Keep only Pages created on or before this date (YYYY-MM-DD).

## `strictLocation` (type: `boolean`):

Keep only Pages whose title, address, name or intro mentions the location's first part ("Austin" for "Austin, TX"). Facebook's search also lists same-named Pages from elsewhere; this drops them before the charge.

## `excludePageIds` (type: `array`):

Facebook IDs (facebookId) never to deliver, e.g. Pages you already have.

## `monitorMode` (type: `boolean`):

Deliver only Pages that no earlier monitor run delivered (remembered in the named key-value store below). Schedule the same input daily or weekly: each run returns, and charges, only the new Pages.

## `monitorChanges` (type: `boolean`):

In monitor mode, also deliver a known Page again when its followers, category, rating, phone, email, website or ad status changed (with monitorStatus "changed" and previousStats).

## `monitorStoreName` (type: `string`):

Named key-value store that remembers the Pages delivered. Use one name per watch list.

## `maxConcurrency` (type: `integer`):

How many Page profiles are read at the same time.

## `requestDelayMs` (type: `integer`):

Facebook answers a signed-out IP with its login page after a few dozen Page profiles read in a burst. The run spaces the About-tab requests by this many milliseconds (one IP at a time). Lower is faster; higher keeps more profiles per IP.

## `residentialProfiles` (type: `boolean`):

Facebook answers its login page to a signed-out IP after a few dozen Page profiles (measured: ~20-40 on the Apify container IP and on one datacenter IP). A refused datacenter IP is replaced by a fresh one up to 4 times a run. On: when all of them have been refused, the remaining profiles are read over one Apify residential IP (the About tab only: no transparency or details tab). Off: the remaining Pages are delivered as search results without the page-details charge.

## `proxyConfiguration` (type: `object`):

Leave as is: the run starts on the Apify container's own IP and climbs to one Apify datacenter session (and, for the search only, a residential session, plus up to 3 fresh residential IPs) when Facebook refuses. Your own proxy (custom URLs or Apify groups) replaces that ladder for every request.

## Actor input object example

```json
{
  "categories": [
    "pizza",
    "dentist"
  ],
  "locations": [
    "New York",
    "Austin, TX"
  ],
  "searchType": "pages",
  "resultsLimit": 10,
  "startUrls": [],
  "includeDetails": true,
  "includeTransparency": true,
  "includeAboutText": false,
  "verifiedOnly": false,
  "withEmailOnly": false,
  "withPhoneOnly": false,
  "withWebsiteOnly": false,
  "withoutWebsiteOnly": false,
  "adsStatus": "any",
  "strictLocation": false,
  "monitorMode": false,
  "monitorChanges": false,
  "monitorStoreName": "facebook-pages-search-monitor",
  "maxConcurrency": 5,
  "requestDelayMs": 500,
  "residentialProfiles": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One item per Facebook Page found by the searches, with its profile when the profile is on.

## `summary` (type: `string`):

Per-search counts (calls, Pages listed and delivered, why each search stopped), filters, the egress used, charges.

# 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 = {
    "categories": [
        "pizza"
    ],
    "locations": [
        "New York"
    ],
    "resultsLimit": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/facebook-pages-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 = {
    "categories": ["pizza"],
    "locations": ["New York"],
    "resultsLimit": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/facebook-pages-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 '{
  "categories": [
    "pizza"
  ],
  "locations": [
    "New York"
  ],
  "resultsLimit": 10
}' |
apify call topapi/facebook-pages-search-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,topapi/facebook-pages-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/X0mBqsKGwdcO8Zqah/builds/HWsVRLvQTi2EWOlvh/openapi.json
