# Facebook Events Scraper: Comments & Engagement Insights (`api-empire/facebook-events-scraper`) Actor

Scrape Facebook Events with event details, dates, locations, descriptions, comments, reactions, and engagement metrics. Analyze audience activity, event performance, and engagement trends for market research, lead generation, competitor analysis, and social media intelligence.

- **URL**: https://apify.com/api-empire/facebook-events-scraper.md
- **Developed by:** [API Empire](https://apify.com/api-empire) (community)
- **Categories:** Social media, Agents, Automation
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 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.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

### Facebook Events Scraper — Extract Events, Comments & Engagement Data

Facebook Events Scraper: Comments & Engagement Insights turns a list of keywords into structured public Facebook event data — event details, attendance counts, a computed engagement rate, and a best-effort discussion-comments feed per event. Every response is typed, normalized JSON — no HTML, no selectors, no manual parsing. Results stream into the Apify dataset row by row as each event finishes, ready to export as JSON, CSV, Excel, XML, or HTML. Read on for exactly which fields are live and which the platform currently blocks.

### 🧭 What is Facebook Events Scraper: Comments & Engagement Insights?

Facebook Events Scraper: Comments & Engagement Insights is an Apify Actor that searches Facebook's public event pages by keyword and returns structured event records enriched with attendance-based engagement analytics and a best-effort discussion-comments feed. It reads only publicly viewable event pages — no Facebook account, login, or cookies are required or accepted.

- Discover public Facebook events by keyword, one query per line
- Compute an engagement rate from live going/responded counts on every event
- Attempt a best-effort discussion-comments feed per event
- Filter results by minimum attendance thresholds before they're written
- Export as JSON, CSV, Excel, XML, or HTML from the Apify platform

### 📦 What data does Facebook Events Scraper: Comments & Engagement Insights collect?

The Actor returns one enriched event record per discovered event, each carrying nested discussion-comment, recurring-occurrence, and organizer objects.

| Data Type | Key Fields | JSON Field Names |
| --- | --- | --- |
| Events | name, date/time text, address, attendance | `name`, `dateTimeSentence`, `address`, `usersGoing`, `usersInterested` |
| Engagement analytics | going-to-responded ratio | `engagementRate`, `usersResponded` |
| Discussion comments | comment text, author, timestamp | `discussionComments`, `discussionCommentsAvailable`, `discussionCommentsCount` |
| Recurring occurrences | linked child events in a series | `childEvents`, `hasChildEvents` |
| Organizers / hosts | organizer name, id, verification | `organizedBy`, `organizators` |

#### Need more Facebook data?

This variant is purpose-built for the engagement and discussion-comments layer on top of standard event data — if all you need is the base event record without that layer, the base Facebook Events Scraper in the same family covers it. Its discussion-comments mechanism was ported from Facebook Comments Scraper, which is the actor to reach for if you need comment threads on Facebook posts rather than events.

### 🛠️ Why not build a Facebook events scraper yourself?

Facebook does not currently offer a usable public API for keyword-based public event search. Meta locked down most public-search permissions on the Graph API in 2018, requiring formal app review for anything beyond an app's own Page data (confirmed via [Auth0's migration notes](https://auth0.com/docs/troubleshoot/product-lifecycle/past-migrations/facebook-graph-api-changes) and [Meta's permissions reference](https://developers.facebook.com/docs/permissions/), checked 2026-08-04). Facebook's own anonymous events-search GraphQL endpoint — the one this project used before — also went login-gated platform-wide as of 2026-08-01, confirmed independently across multiple IPs during this Actor's own testing.

Building and maintaining this yourself means tracking those changes, resolving fresh GraphQL `doc_id` values as Facebook rotates them, rotating proxies when Facebook starts blocking your IPs, and re-implementing discovery every time a door closes. This Actor already does that work: it discovers events through Google's public search index (`site:facebook.com/events`) instead of Facebook's own gated search, and every real fetch against Facebook itself runs through Apify's residential proxy pool automatically.

### 🎯 Why do developers and teams scrape Facebook events?

#### For AI engineers and agent builders

Feed `discussionComments`, `engagementRate`, and `discoveryCategories` straight into a RAG index or an agent tool without writing a parser. A local-events agent can call this Actor with a city + niche query, filter on `minGoing`, and hand the resulting JSON rows directly to an LLM to draft a "what's happening this week" summary — the schema is stable field-to-field, so the same prompt template works across runs.

#### For marketers and event/community teams

Track attendance momentum for competing or partner events by comparing `usersGoing`, `usersInterested`, and `engagementRate` across a niche or city, and flag events worth boosting promotion on before they happen using each event's real attendance signal rather than guesswork.

#### For researchers and analysts

Study public event activity for a city, topic, or organizer type at scale — `discoveryCategories`, `organizedBy`, and attendance fields support academic or market research into what kinds of public events draw engagement, using only publicly accessible listings.

#### For developers building data products

Build a scheduled event-discovery pipeline that feeds a local-events app, newsletter, or dashboard: run the Actor on a schedule per city/niche, dedupe on `id`, and let `isUpcomingSoon`-style downstream logic (computed from your own date parsing, see the Output section below) drive what surfaces.

### 🚀 How to scrape Facebook events (step by step)

1. Open **Facebook Events Scraper: Comments & Engagement Insights** on its Apify Store listing and click **Try for free** or **Run**.
2. Provide the required input: `searchQueries` — one keyword phrase per line (e.g. `jazz night`, `tech meetup Chicago`).
3. Set `maxEvents` for coverage per query, and optionally `minGoing` / `minInterested` to drop low-attendance events, and `fetchDiscussionComments` / `maxDiscussionComments` to control comment collection.
4. Start the run from the Console, or trigger it programmatically via the Apify API / `apify_client`.
5. Download results as JSON, CSV, Excel, XML, or HTML from the run's Output tab, or read them via the Dataset API.

#### What to do when Facebook changes its structure

This Actor is maintained, and the output schema stays stable — field names and types don't change on your end when Facebook alters its markup or endpoints underneath. No specific turnaround time is promised for any given break.

### 📰 What changed in Facebook event scraping recently?

The most significant recent shift is that Facebook's own anonymous events-search GraphQL endpoint went login-gated platform-wide as of 2026-08-01, confirmed during this Actor's own testing across multiple IPs, fresh GraphQL tokens, and both its GraphQL-POST and server-rendered access paths.

- **What changed technically:** the search endpoint that used to return going/interested counts, dates, and locations for a keyword query now returns a login wall instead of results.
- **What this means for DIY scrapers:** anything hardcoding that endpoint's `doc_id` or query shape breaks outright and has no drop-in replacement on Facebook's side.
- **What this means for users of this Actor:** discovery was rebuilt on Google's public search index instead, so keyword search keeps working against the same enriched event-page pipeline.
- **What remains publicly accessible:** individual event detail pages (`facebook.com/events/<id>/`) are still viewable anonymously and still carry name, date sentence, attendance, description, and organizer data in their page HTML.

This followed the broader 2018 Graph API lockdown of public-search permissions on Facebook's official API (see the section above) — the pattern of public search access narrowing over time, while individual public pages stay reachable, is likely to continue, so this Actor is maintained on an ongoing basis rather than treated as a one-time build.

### ⬇️ Input

| Parameter | Required | Type | Description | Example Value |
| --- | --- | --- | --- | --- |
| `searchQueries` | Yes | array of strings | Keyword phrases to search for, one per line. Every query is processed and results are merged into one dataset. | `["jazz night", "tech meetups"]` |
| `maxEvents` | No | integer | Stop after this many events for each query. Minimum 1, maximum 1000, default 10. | `10` |
| `minGoing` | No | integer | Drop events where `usersGoing` is below this number. Minimum 0, default 0 (no filter). | `0` |
| `minInterested` | No | integer | Drop events where `usersInterested` is below this number. Minimum 0, default 0 (no filter). | `0` |
| `fetchDiscussionComments` | No | boolean | Attempt to detect and collect each event's discussion-comments feed. Default `true`. | `true` |
| `maxDiscussionComments` | No | integer | Cap on comments collected per event, only when a feed is detected. Minimum 0, maximum 200, default 20. | `20` |
| `proxyConfiguration` | No | object | Shown for interface consistency with sibling Actors — **not actually used**. Every request against Facebook itself always routes through Apify's `RESIDENTIAL` proxy group, enforced in code; any group or "no proxy" selection here is ignored. | `{"useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"]}` |

Example input:

```json
{
  "searchQueries": ["jazz night", "tech meetups"],
  "maxEvents": 10,
  "minGoing": 0,
  "minInterested": 0,
  "fetchDiscussionComments": true,
  "maxDiscussionComments": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

The most common input mistake is raising `maxEvents` expecting proportionally more results per query — discovery is capped by how many event pages Google's index actually returns for that keyword (see "How many events can you scrape" below), so a higher `maxEvents` on a narrow query often returns the same count as a lower one.

### ⬆️ Output

Every run writes one typed JSON row per discovered event to the Apify dataset, exportable as JSON, CSV, Excel, XML, or HTML.

#### Scraped event

```json
{
  "inputUrl": "/events/search/?q=jazz%20night",
  "url": "https://www.facebook.com/events/1202620635007207/",
  "id": "1202620635007207",
  "name": "Late Night Jazz Session",
  "eventFrequency": "SINGLE",
  "dateTimeSentence": "SATURDAY, NOVEMBER 15 2026",
  "utcStartDate": null,
  "startTime": "Saturday, November 15 2026",
  "imageUrl": "https://scontent.xx.fbcdn.net/v/event-cover.jpg",
  "imageCaption": null,
  "duration": null,
  "description": "Live jazz quartet, doors at 8pm, all ages welcome.",
  "address": "12 Riverside Ave, Cairns QLD, Australia",
  "isCanceled": false,
  "hasChildEvents": false,
  "childEvents": [],
  "usersGoing": 76,
  "usersInterested": 527,
  "usersResponded": 603,
  "location": {
    "url": "https://www.facebook.com/places/Shangri-La-The-Marina-Cairns/112233445566/",
    "id": "112233445566",
    "name": "Shangri-La The Marina, Cairns",
    "contextualName": "Shangri-La The Marina, Cairns",
    "placeType": "PLACE",
    "latitude": -16.91993058397,
    "longitude": 145.78028848415,
    "countryCode": "AU",
    "streetAddress": "12 Riverside Ave",
    "city": "Cairns, QLD, Australia"
  },
  "ticketsInfo": null,
  "organizedBy": "Kellie Grace Live Music",
  "organizators": [
    {
      "name": "Kellie Grace Live Music",
      "id": "987654321",
      "url": "https://www.facebook.com/profile.php?id=987654321",
      "isVerified": false
    }
  ],
  "eventType": "PUBLIC",
  "privacyInfo": "Public · Hosted by Kellie Grace Live Music",
  "isPast": false,
  "isOnline": false,
  "discoveryCategories": [
    { "url": "https://www.facebook.com/events/discovery/?q=music", "label": "Music" }
  ],
  "externalLinks": [],
  "externalLinksSource": null,
  "engagementRate": 0.126,
  "daysUntilEvent": null,
  "isUpcomingSoon": false,
  "discussionCommentsAvailable": false,
  "discussionCommentsCount": null,
  "discussionComments": null,
  "scrapedAt": "2026-08-04T09:00:00.000Z",
  "discoverySource": "google_serp"
}
```

When a discussion feed is detected on an event's own page, `discussionComments` fills in with entries shaped like:

```json
[
  {
    "id": "Y29tbWVudDoxMjM0NQ==",
    "text": "Can't wait for this one!",
    "date": "2026-08-01T14:22:03.000Z",
    "authorName": "Jamie Rivera",
    "authorId": "100004455667788",
    "authorUrl": "https://www.facebook.com/jamie.rivera",
    "likesCount": 4,
    "eventUrl": "https://www.facebook.com/events/1202620635007207/"
  }
]
```

⚠️ `utcStartDate` is not populated in this build, so `daysUntilEvent` and `isUpcomingSoon` — which are both derived from it — return `null` and `false` on every row today. `engagementRate` does not depend on `utcStartDate` and is always computed live from `usersGoing`/`usersResponded`. Use `dateTimeSentence` or `startTime` (both populated from the event page's own date text) for the human-readable date, and compute upcoming-vs-past logic yourself from that text if you need it.

A handful of other fields are present in every row for schema consistency but currently always hold the same constant value rather than a live-scraped one: `eventType` is always `"PUBLIC"` (only public events are discoverable anonymously in the first place), `eventFrequency` is always `"SINGLE"`, `isPast`/`isOnline`/`isCanceled` are always `false`, and `ticketsInfo`/`imageCaption`/`externalLinksSource` are always `null`. `discoverySource` is always `"google_serp"`, reflecting how every event was found. Everything else in the row above — including `location`, `organizators`, `childEvents`, `discoveryCategories`, `externalLinks`, and the discussion-comments fields — is populated per event from that event's own live page.

### 📊 How does Facebook Events Scraper: Comments & Engagement Insights compare to other Facebook event scrapers?

| Feature | This Actor | Generic alternative |
| --- | --- | --- |
| Output format | Typed, normalized JSON with a stable schema | Raw HTML/DOM scraping, typically needs a custom parser per site change |
| Discovery method | Google-index-based public event discovery, unaffected by Facebook's own search lockdown | Often relies on Facebook's native search UI/API, which is login-gated for anonymous public event search |
| Discussion-comment coverage | Explicit `discussionCommentsAvailable` flag — honest null when no feed exists | Commonly omitted, or silently returns an empty array indistinguishable from "checked, found none" |
| Engagement signal | `engagementRate` computed live from going/responded counts on every event | Usually raw going/interested counts only, no computed ratio |
| Proxy handling | Residential proxy enforced automatically on every Facebook request, cannot be misconfigured | Proxy selection often left to the user; datacenter IPs get blocked quickly on Facebook |

If you're building an AI agent or RAG pipeline, the output-format row is the decision-maker — parsing HTML inside an agent loop is a reliability failure mode, not a feature.

### 🔢 How many events can you scrape with Facebook Events Scraper: Comments & Engagement Insights?

`maxEvents` accepts 1–1000 per search query, but the real ceiling is set by Google's public index, not by that setting: discovery pages through Google's search results in batches of 10 and stops once it has paged through roughly 7 pages (up to ~70 result links) for that query, or as soon as two consecutive pages return no new event URLs — whichever happens first. Setting `maxEvents` above what a given keyword's Google results actually contain will not produce more rows; it simply stops once the index runs out for that query. There is no additional cap in the Actor itself beyond `maxEvents` × the number of `searchQueries` you provide.

### 🔌 Integrate Facebook Events Scraper: Comments & Engagement Insights and automate your workflow

Facebook Events Scraper: Comments & Engagement Insights works with any language or tool that can send an HTTP request — it's a standard Apify Actor, callable through the Apify API or any Apify client SDK.

#### REST API integration

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_API_TOKEN>")

run_input = {
    "searchQueries": ["jazz night", "tech meetups"],
    "maxEvents": 10,
    "minGoing": 0,
    "fetchDiscussionComments": True,
    "maxDiscussionComments": 20,
}

run = client.actor("API-Empire/facebook-events-scraper-comments-and-engagement-insights").call(run_input=run_input)

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["name"], item["usersGoing"], item["engagementRate"])
```

Works in Python, Node.js, Go, Ruby, cURL.

#### Automation platforms (n8n, Make, LangChain)

Trigger runs from n8n with its built-in Apify node, pointing it at this Actor's ID and passing `searchQueries` as JSON input. In Make, the Apify module's "Run an Actor" action does the same. In a LangChain pipeline, wrap the call with LangChain's Apify integration to pull dataset items straight into a document loader for an agent or RAG chain, with no HTML parsing step in between.

### ⚖️ Is it legal to scrape Facebook events?

Yes — scraping publicly available Facebook event pages is generally legal, and this Actor returns only data visible on public event pages, without logging in or accessing gated content. Event and attendance data is business/public-listing information, not personal data on its own. The discussion-comments feature, when a feed is detected, does return commenters' names, profile IDs, and profile URLs, which are personal data under GDPR and CCPA — you need a lawful basis to store and use that data, particularly for any commercial use. Organizer names and profile URLs carry the same consideration. Consult legal counsel for commercial use cases involving bulk personal data.

### ❓ Frequently asked questions

#### Does Facebook Events Scraper: Comments & Engagement Insights work without a Facebook account?

Yes. No login, cookies, or Facebook credentials are required or accepted — every request reads publicly viewable pages anonymously through Apify's proxy.

#### How often is the scraped data updated?

Every run fetches live: each event's page is fetched fresh, and attendance/description/comment data reflects that moment. Nothing is served from a cache between runs. Discovery itself depends on Google having indexed the event page, so a very recently created event may not surface via keyword search until Google crawls it, even though the event page itself is already live.

#### What happens if a search query finds no events, or an event page no longer exists?

Both are handled as honest empty results, not errors. If Google's index has no matches for a query, the Actor logs a warning and moves to the next query. If an individual event page can't be fetched after retries, that event is skipped and the run continues with the rest.

#### Can I scrape private or login-gated Facebook events?

No. Only publicly accessible event pages are read — private events, and events only visible to logged-in members of a closed group, are out of scope.

#### Can I run multiple search queries in one job?

Yes. `searchQueries` accepts one query per line, and every query's results are merged into a single dataset for the run.

#### Does Facebook Events Scraper: Comments & Engagement Insights work for AI agent workflows and LLM pipelines?

Yes. It's callable as an HTTP endpoint by any agent framework via the Apify API, and every response is typed JSON with a stable schema — no parsing step before passing rows to an LLM or a vector store.

#### How does it handle Facebook's anti-bot system?

Every request against Facebook itself is forced through Apify's `RESIDENTIAL` proxy group, non-overridable by design. On a blocked-looking response (403/429, "rate limit", connection-reset style errors), it retries up to 3 times with exponential backoff and rotates to a fresh proxy IP between attempts. Discovery avoids Facebook's own search entirely, using Google's public index instead, since Facebook's anonymous events-search endpoint is login-gated as of 2026-08-01.

#### Are `engagementRate`, `daysUntilEvent`, and `isUpcomingSoon` always populated?

`engagementRate` is, computed live on every event from `usersGoing`/`usersResponded`. `daysUntilEvent` and `isUpcomingSoon` are not — both depend on `utcStartDate`, which this build never populates, so they return `null`/`false` on every row. Use `dateTimeSentence`/`startTime` for the actual date.

#### Does Facebook Events Scraper: Comments & Engagement Insights return data in a format LLMs can use directly?

Yes. Typed, normalized JSON with stable field names — no HTML, no selectors, no parsing required before passing it into an LLM context window or an agent tool.

#### Can I use it without managing proxies?

Yes. Every Facebook request is automatically routed through Apify's residential proxy pool; there's no proxy setup for you to get wrong, and the `proxyConfiguration` input cannot override it for this site.

#### What happens when Facebook changes its structure or blocks the scraper?

This Actor is maintained, and the output schema stays stable on your end — field names and types don't change when Facebook's markup or endpoints change underneath. No specific turnaround time is promised for any individual break.

### 💬 Your feedback

Found a bug, or a field that should be populated but isn't? We want to know. Reach out through the Actor's page on the Apify Store or open an issue with the API-Empire team — reports like this are how fields such as the constant/placeholder ones documented above get prioritized for a real fix.

# Actor input Schema

## `searchQueries` (type: `array`):

Words your audience would type into Facebook event search.

Examples: jazz night · running club · tech meetups · art fair · wine tasting · stand-up comedy.

One query per line — every query is processed in order and results are merged into one dataset.

## `maxEvents` (type: `integer`):

Stop after this many events for EACH search query.

Lower = faster/cheaper test runs. Higher = broader coverage.

Allowed: 1–1000. Default 10.

## `minGoing` (type: `integer`):

Only keep events where usersGoing is at least this number. Set 0 to disable this filter.

Default 0 (no filter).

## `minInterested` (type: `integer`):

Only keep events where usersInterested is at least this number. Set 0 to disable this filter.

Default 0 (no filter).

## `fetchDiscussionComments` (type: `boolean`):

When enabled, the actor checks each event's own page (already fetched for enrichment, so this adds no extra page load unless comments are actually found) for a public discussion/comments feed and collects any comments it detects.

Honest coverage note: Facebook does not expose a discussion feed on every public event the same way it does on posts — many events will legitimately come back with discussionCommentsAvailable=false and a null comments list. That is a correct, verified result, not a bug. See the README for measured coverage.

Default ON (the check itself is cheap even when no feed is found).

## `maxDiscussionComments` (type: `integer`):

Cap on discussion comments collected per event, only relevant when a discussion feed is actually detected on that event (see fetchDiscussionComments above).

Allowed: 0–200. Default 20.

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

Shown for interface consistency with sibling actors, but Facebook requests in this actor always route through Apify's RESIDENTIAL proxy group -- this is enforced in code and is NOT overridable via this input (datacenter/no-proxy selections here are ignored). This is a deliberate reliability decision: Facebook blocks non-residential IPs aggressively.

## Actor input object example

```json
{
  "searchQueries": [
    "travel",
    "comedy"
  ],
  "maxEvents": 10,
  "minGoing": 0,
  "minInterested": 0,
  "fetchDiscussionComments": true,
  "maxDiscussionComments": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

All scraped items in the Actor's default dataset.

# 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 = {
    "searchQueries": [
        "travel",
        "comedy"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("api-empire/facebook-events-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 = {
    "searchQueries": [
        "travel",
        "comedy",
    ],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("api-empire/facebook-events-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 '{
  "searchQueries": [
    "travel",
    "comedy"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call api-empire/facebook-events-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,api-empire/facebook-events-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/c4N2gnFs5TwDqXrfu/builds/i5FzCKgZHnguVeBoj/openapi.json
