# Facebook People, Pages, Places & Events Search (`data-wan/facebook-search-pages`) Actor

Search public Facebook People, Pages, Places or Events by keyword. Run up to 100 queries, choose a city, Places price tier or Events date range, and export results with their query and rank.

- **URL**: https://apify.com/data-wan/facebook-search-pages.md
- **Developed by:** [Data Wan](https://apify.com/data-wan) (community)
- **Categories:** Social media
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.2% runs succeeded, 2 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $0.99 / 1,000 saved pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
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 People, Pages, Places & Events Search

Find public Facebook results by keyword. Choose one result type for the run and submit up to 100 queries. Every saved result includes the query that found it and its rank within that query. Pages is the default for existing inputs.

### Start a search

```json
{
  "type": "places",
  "queries": ["coffee roasters", "specialty coffee"],
  "searchCountry": "LV",
  "searchCity": "riga",
  "placePrice": 2,
  "maxPagesPerQuery": 50
}
```

This example requests Facebook's second price tier for Places in Riga. Each query can save up to 50 results. Open the dataset after the run to inspect the rows or export them as CSV, Excel or JSON. The overview and full details views cover every run. The Pages, People, Places and Events views display columns for the selected type.

### Choose a result type

| `type` | Filters | Fields specific to this type |
|---|---|---|
| `pages` (default) | City | `pageId`, equal to `id`, and `verified` |
| `people` | City | `profileId`, `verified` and `snippet`. Public profile details can include location or workplace text when Facebook supplies it |
| `places` | City and `placePrice`, an integer from 1 through 4 | `verified`. The price tier affects retrieval and is absent from result cards |
| `events` | `eventStartDate` and `eventEndDate` | Event search cards provide a name, link and cover picture when available. Event time, venue and host require information beyond these cards |

For Events, supply both dates as `YYYY-MM-DD`, with the start on or before the end. Use the same date for a single day. Facebook applies the filter. A sample of public event details matched the requested days. The Actor reads search cards and makes no event-detail requests.

### Input options

| Option | Default | Behavior |
|---|---|---|
| `queries` | Required | 1–100 keywords in input order. Each trimmed and normalized query accepts 1–200 characters without controls |
| `type` | `pages` | One of `pages`, `people`, `places` or `events` for the whole run |
| `maxPagesPerQuery` | `50` | Maximum results per query, from 1 to 200. This legacy API key applies to all four types |
| `proxyCountry` | `US` | Two uppercase letters selecting the residential proxy country independently of any city filter |
| `searchCountry` | Omitted | Supported country key for Pages, People or Places. With a blank or omitted city it selects the configured capital |
| `searchCity` | Omitted | One supported city key within the selected country |
| `placePrice` | Omitted | Facebook price tier, 1 through 4, for Places |
| `eventStartDate`, `eventEndDate` | Omitted | Inclusive calendar dates for Events |

For example, `"searchCountry": "LV"` selects Riga. Add `"searchCity": "liepaja"` to select Liepaja. Choose keys from [Supported search locations](#supported-search-locations). A city influences retrieval. Facebook can return results outside the selected city. Unknown or incompatible filters fail before collection. Omit both city fields to search without a city filter.

### Dataset rows

| Field | Meaning |
|---|---|
| `type`, `id` | Selected type and the observed Facebook numeric identifier as a string |
| `name`, `url`, `avatarUrl` | Observed display name, result URL and image URL. Image links can expire |
| `issues` | Observed field uncertainties. Missing optional values appear as null |
| `query`, `inputIndex` | Normalized query and its zero-based position in the input |
| `rank` | One-based result position within that query |
| `cityId` | Selected city identity where applicable, otherwise null. This describes the search input |
| `verified` | Observed boolean for Pages, People and Places, or null when absent |

People can have an opaque `profileId` alongside their numeric `id`. The result holds only observations from the public search card. For Pages, all legacy fields retain their names. The dataset remains accessible through the existing `pages` output link for every result type.

Illustrative Pages row with synthetic values:

```json
{
  "pageId": "1001",
  "name": "Example Coffee Roasters",
  "url": "https://example.invalid/page",
  "avatarUrl": null,
  "issues": [{"field": "avatarUrl", "reason": "not_exposed"}],
  "query": "coffee roasters",
  "inputIndex": 0,
  "cityId": null,
  "rank": 1,
  "type": "pages",
  "id": "1001",
  "verified": false
}
```

### Pricing

| Your Apify plan | Price per 1,000 saved rows |
|---|---:|
| Free / Starter | $1.49 |
| Scale | $1.19 |
| Business and higher | $0.99 |

The existing **Saved Page** event counts one saved result of the selected type. At the Starter rate, 50 saved rows cost **$0.0745**. Proxy and platform usage are included. Each result is saved once within a query. A match across two queries or in another run can be saved and billed again. A query with zero results incurs zero result-event charges.

### Check the run summary

The `summary` link opens the `OUTPUT` record with saved and charged counts and one outcome per query. `complete` means Facebook reported the end. `limit_reached` means your per-query cap was reached. For `incomplete`, `failed`, `invalid_source` or `skipped` items, inspect the reason before using the results. Only Facebook's temporary rate-limit refusal (error 1675004) of a query's first results page, before any result, is retried: the Actor waits and retries once, then once more through a new proxy session, at most once per run. Any other refusal (for example a block page), or a refusal that persists, ends collection and acknowledged rows are retained. A run can end early on the shared time or monetary budget. A new run starts a fresh search, and each query can read up to 50 result pages.

The summary and its query items include the effective `searchCountry`, `searchCity`, `cityId` and `selectionMode`, including empty results. Invalid geography for a type supporting city selection produces the existing structured `inputError`. A filter incompatible with the selected type produces a field-specific failed-run status. Logs report counts and outcomes without query text, profile details or continuation tokens.

### Supported search locations

Choose a `searchCountry` key from this reference. Leave `searchCity` blank for the listed
default, or enter that default key or one additional city key from the same row. Other
keys fail validation; country-only selects one city, not national coverage. This is the
selection vocabulary shipped with this Actor, not proof of exact geographic boundaries
or complete results in every listed context.

| Country/territory key | Default city key | Display | Additional city keys |
|---|---|---|---|
| AD | andorra-la-vella | Andorra la Vella | — |
| AE | abu-dhabi | Abu Dhabi | — |
| AF | kabul | Kabul | — |
| AG | saint-johns | Saint John's | — |
| AI | the-valley | The Valley | — |
| AL | tirana | Tirana | — |
| AM | yerevan | Yerevan | — |
| AO | luanda | Luanda | — |
| AR | buenos-aires | Buenos Aires | — |
| AS | pago-pago | Pago Pago | — |
| AT | vienna | Vienna | — |
| AU | canberra | Canberra | — |
| AW | oranjestad | Oranjestad | — |
| AX | mariehamn | Mariehamn | — |
| AZ | baku | Baku | — |
| BA | sarajevo | Sarajevo | — |
| BB | bridgetown | Bridgetown | — |
| BD | dhaka | Dhaka | — |
| BE | brussels | Brussels | — |
| BF | ouagadougou | Ouagadougou | — |
| BG | sofia | Sofia | — |
| BH | manama | Manama | — |
| BI | gitega | Gitega | — |
| BJ | porto-novo | Porto-Novo | — |
| BL | gustavia | Gustavia | — |
| BM | hamilton | Hamilton | — |
| BN | bandar-seri-begawan | Bandar Seri Begawan | — |
| BO | sucre | Sucre | — |
| BR | brasilia | Brasília | — |
| BS | nassau | Nassau | — |
| BT | thimphu | Thimphu | — |
| BW | gaborone | Gaborone | — |
| BY | minsk | Minsk | — |
| BZ | belmopan | Belmopan | — |
| CA | ottawa | Ottawa | — |
| CD | kinshasa | Kinshasa | — |
| CF | bangui | Bangui | — |
| CG | brazzaville | Brazzaville | — |
| CH | bern | Bern | — |
| CI | yamoussoukro | Yamoussoukro | — |
| CK | avarua | Avarua | — |
| CL | santiago | Santiago | — |
| CM | yaounde | Yaoundé | — |
| CN | beijing | Beijing | — |
| CO | bogota | Bogotá | — |
| CR | san-jose | San Jose | — |
| CU | havana | Havana | — |
| CV | praia | Praia | — |
| CW | willemstad | Willemstad | — |
| CY | nicosia | Nicosia | — |
| CZ | prague | Prague | — |
| DE | berlin | Berlin | — |
| DJ | djibouti | Djibouti | — |
| DK | copenhagen | Copenhagen | — |
| DM | roseau | Roseau | — |
| DO | santo-domingo | Santo Domingo | — |
| DZ | algiers | Algiers | — |
| EC | quito | Quito | — |
| EE | tallinn | Tallinn | — |
| EG | cairo | Cairo | — |
| EH | el-aaiun | El-Aaiun | — |
| ER | asmara | Asmara | — |
| ES | madrid | Madrid | — |
| ET | addis-ababa | Addis Ababa | — |
| FI | helsinki | Helsinki | — |
| FJ | suva | Suva | — |
| FM | palikir | Palikir | — |
| FO | torshavn | Tórshavn | — |
| FR | paris | Paris | — |
| GA | libreville | Libreville | — |
| GB | london | London | — |
| GD | saint-georges | Saint George's | — |
| GE | tbilisi | Tbilisi | — |
| GF | cayenne | Cayenne | — |
| GG | saint-peter-port | Saint Peter Port | — |
| GH | accra | Accra | — |
| GI | gibraltar | Gibraltar | — |
| GL | nuuk | Nuuk | — |
| GM | banjul | Banjul | — |
| GN | conakry | Conakry | — |
| GP | basse-terre | Basse-Terre | — |
| GQ | ciudad-de-la-paz | Ciudad de la Paz | — |
| GR | athens | Athens | — |
| GS | grytviken | Grytviken | — |
| GT | guatemala-city | Guatemala City | — |
| GU | hagatna | Hagatna | — |
| GW | bissau | Bissau | — |
| GY | georgetown | Georgetown | — |
| HK | hong-kong | Hong Kong | — |
| HN | tegucigalpa | Tegucigalpa | — |
| HR | zagreb | Zagreb | — |
| HT | port-au-prince | Port-au-Prince | — |
| HU | budapest | Budapest | — |
| IE | dublin | Dublin | — |
| IL | jerusalem | Jerusalem | — |
| IM | douglas | Douglas | — |
| IQ | baghdad | Baghdad | — |
| IR | tehran | Tehran | — |
| IS | reykjavik | Reykjavík | — |
| IT | rome | Rome | — |
| JE | saint-helier | Saint Helier | — |
| JM | kingston | Kingston | — |
| JO | amman | Amman | — |
| KE | nairobi | Nairobi | — |
| KG | bishkek | Bishkek | — |
| KH | phnom-penh | Phnom Penh | — |
| KM | moroni | Moroni | — |
| KN | basseterre | Basseterre | — |
| KP | pyongyang | Pyongyang | — |
| KR | seoul | Seoul | — |
| KW | kuwait-city | Kuwait City | — |
| KY | george-town | George Town | — |
| KZ | astana | Astana | — |
| LA | vientiane | Vientiane | — |
| LB | beirut | Beirut | — |
| LC | castries | Castries | — |
| LI | vaduz | Vaduz | — |
| LK | kotte | Sri Jayewardenepura Kotte | colombo |
| LR | monrovia | Monrovia | — |
| LS | maseru | Maseru | — |
| LT | vilnius | Vilnius | — |
| LU | luxembourg | Luxembourg | — |
| LV | riga | Riga | liepaja |
| LY | tripoli | Tripoli | — |
| MA | rabat | Rabat | — |
| MC | monaco | Monaco | — |
| MD | chisinau | Chișinău | — |
| ME | podgorica | Podgorica | — |
| MF | marigot | Marigot | — |
| MG | antananarivo | Antananarivo | — |
| MH | majuro | Majuro | — |
| MK | skopje | Skopje | — |
| ML | bamako | Bamako | — |
| MM | nay-pyi-taw | Nay Pyi Taw | — |
| MN | ulaanbaatar | Ulaanbaatar | — |
| MO | macao | Macao | — |
| MP | saipan | Saipan | — |
| MQ | fort-de-france | Fort-de-France | — |
| MR | nouakchott | Nouakchott | — |
| MS | plymouth | Plymouth | — |
| MT | valletta | Valletta | — |
| MU | port-louis | Port Louis | — |
| MV | male | Malé | — |
| MW | lilongwe | Lilongwe | — |
| MX | mexico-city | Mexico City | — |
| MY | kuala-lumpur | Kuala Lumpur | — |
| MZ | maputo | Maputo | — |
| NA | windhoek | Windhoek | — |
| NC | noumea | Nouméa | — |
| NE | niamey | Niamey | — |
| NF | kingston | Kingston | — |
| NG | abuja | Abuja | — |
| NI | managua | Managua | — |
| NL | amsterdam | Amsterdam | — |
| NO | oslo | Oslo | — |
| NP | kathmandu | Kathmandu | — |
| NU | alofi | Alofi | — |
| NZ | wellington | Wellington | — |
| OM | muscat | Muscat | — |
| PA | panama-city | Panama City | — |
| PE | lima | Lima | — |
| PF | papeete | Papeete | — |
| PG | port-moresby | Port Moresby | — |
| PH | manila | Manila | — |
| PK | islamabad | Islamabad | — |
| PL | warsaw | Warsaw | — |
| PM | saint-pierre | Saint-Pierre | — |
| PN | adamstown | Adamstown | — |
| PR | san-juan | San Juan | — |
| PS | east-jerusalem | East Jerusalem | — |
| PT | lisbon | Lisbon | — |
| PY | asuncion | Asunción | — |
| QA | doha | Doha | — |
| RE | saint-denis | Saint-Denis | — |
| RO | bucharest | Bucharest | — |
| RS | belgrade | Belgrade | — |
| RU | moscow | Moscow | — |
| RW | kigali | Kigali | — |
| SA | riyadh | Riyadh | — |
| SB | honiara | Honiara | — |
| SC | victoria | Victoria | — |
| SD | khartoum | Khartoum | — |
| SE | stockholm | Stockholm | — |
| SG | singapore | Singapore | — |
| SH | jamestown | Jamestown | — |
| SI | ljubljana | Ljubljana | — |
| SJ | longyearbyen | Longyearbyen | — |
| SK | bratislava | Bratislava | — |
| SL | freetown | Freetown | — |
| SM | san-marino | San Marino | — |
| SN | dakar | Dakar | — |
| SO | mogadishu | Mogadishu | — |
| SR | paramaribo | Paramaribo | — |
| SS | juba | Juba | — |
| ST | sao-tome | São Tomé | — |
| SV | san-salvador | San Salvador | — |
| SX | philipsburg | Philipsburg | — |
| SY | damascus | Damascus | — |
| SZ | mbabane | Mbabane | — |
| TC | cockburn-town | Cockburn Town | — |
| TD | ndjamena | N'Djamena | — |
| TF | port-aux-francais | Port-aux-Français | — |
| TG | lome | Lomé | — |
| TH | bangkok | Bangkok | — |
| TJ | dushanbe | Dushanbe | — |
| TL | dili | Dili | — |
| TM | ashgabat | Ashgabat | — |
| TN | tunis | Tunis | — |
| TO | nuku-alofa | Nuku'alofa | — |
| TR | ankara | Ankara | — |
| TT | port-of-spain | Port of Spain | — |
| TV | funafuti | Funafuti | — |
| TW | taipei | Taipei | — |
| TZ | dodoma | Dodoma | — |
| UA | kyiv | Kyiv | — |
| UG | kampala | Kampala | — |
| US | washington-dc | Washington D.C. | — |
| UY | montevideo | Montevideo | — |
| UZ | tashkent | Tashkent | — |
| VA | vatican-city | Vatican City | — |
| VC | kingstown | Kingstown | — |
| VE | caracas | Caracas | — |
| VG | road-town | Road Town | — |
| VI | charlotte-amalie | Charlotte Amalie | — |
| VN | hanoi | Hanoi | — |
| VU | port-vila | Port Vila | — |
| WF | mata-utu | Mata Utu | — |
| WS | apia | Apia | — |
| YE | sanaa | Sanaa | — |
| YT | mamoudzou | Mamoudzou | — |
| ZA | pretoria | Pretoria | — |
| ZM | lusaka | Lusaka | — |
| ZW | harare | Harare | — |

Location names/context associations derive from [GeoNames](https://www.geonames.org/),
adapted under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). The producer
selects default associations and city keys; GeoNames does not endorse the configuration.

# Actor input Schema

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

Choose one kind of Facebook result for all queries in this run.

## `queries` (type: `array`):

1–100 keyword queries, run one after another. Each is trimmed and must then hold 1–200 characters without control characters; an invalid query is reported in OUTPUT and not run.

## `maxPagesPerQuery` (type: `integer`):

Limit saved results independently for each query. The API key maxPagesPerQuery applies to all result types.

## `searchCountry` (type: `string`):

For Pages, People and Places, select a supported uppercase country key. A blank city selects the configured capital. See Supported search locations in the Actor README.

## `searchCity` (type: `string`):

For Pages, People and Places, select one supported city key within searchCountry. A blank city selects the configured capital.

## `proxyCountry` (type: `string`):

Two uppercase letters (ISO 3166-1 alpha-2 country code, such as US or LV). Facebook search results depend on the egress country; the run uses residential Apify Proxy in this country. A country Apify Proxy cannot serve fails the run before any search.

## `placePrice` (type: `integer`):

Request one Facebook price tier, from 1 through 4.

## `eventStartDate` (type: `string`):

Enter both calendar dates as YYYY-MM-DD. Use the same day for a one-day search.

## `eventEndDate` (type: `string`):

Enter both calendar dates as YYYY-MM-DD. Use the same day for a one-day search.

## Actor input object example

```json
{
  "type": "pages",
  "queries": [
    "renewable energy storage"
  ],
  "maxPagesPerQuery": 20,
  "proxyCountry": "US"
}
```

# Actor output Schema

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

No description

## `pages` (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 = {
    "queries": [
        "renewable energy storage"
    ],
    "maxPagesPerQuery": 20,
    "proxyCountry": "US"
};

// Run the Actor and wait for it to finish
const run = await client.actor("data-wan/facebook-search-pages").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 = {
    "queries": ["renewable energy storage"],
    "maxPagesPerQuery": 20,
    "proxyCountry": "US",
}

# Run the Actor and wait for it to finish
run = client.actor("data-wan/facebook-search-pages").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 '{
  "queries": [
    "renewable energy storage"
  ],
  "maxPagesPerQuery": 20,
  "proxyCountry": "US"
}' |
apify call data-wan/facebook-search-pages --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,data-wan/facebook-search-pages"
        }
    }
}
```

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/IPCIhHKMiqcvLjgPb/builds/3YUTTG2GEPi4Q6J4a/openapi.json
