# Facebook Events Scraper (`apify/facebook-events-scraper`) Actor

Facebook Events Scraper extracts data such as event name, location, description or number of users who are interested. You can use URLs of specific events or come up with search queries and explore pretty much unlimited number of events. Search queries can be combined with various search filters.

- **URL**: https://apify.com/apify/facebook-events-scraper.md
- **Developed by:** [Apify](https://apify.com/apify) (Apify)
- **Categories:** Social media
- **Stats:** 4,144 total users, 581 monthly users, 98.7% runs succeeded, 100 bookmarks
- **User rating**: 4.97 out of 5 stars

## Pricing

from $7.00 / 1,000 events

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

### What is Facebook Events Scraper?

This tool is designed to **extract data for events organized and promoted on Facebook**. Use this scraper to analyze event details, track its performance, and monitor trends.

With Facebook Events Scraper, you can:

🗂 Scrape multiple Facebook events **at once**.

🎭 Extract detailed event data from **pages**, **groups**, and **individual events** as well as search results

🔎 Search and scrape Facebook events by **keyword**, **location**, **or both**

🎯 Apply advanced filters like **date**, **city**, **online events**, or **paid-only events** to get structured event data

📝 Extract **key event data**: name, description, location, date and time, tickets information, and more.

🔓 **Access data without logging in**: you don't need a Facebook account to scrape events.

💾 Export event data as **JSON**, **JSONL**, **XML**, **RSS**, **HTML table**, **CSV**, or **Excel**.

🔗 Export via SDKs (Python and Node.js), use API endpoints, webhooks, or integrate with apps and AI workflows

🔍 Explore 20+ other [Facebook scraping tools](https://apify.com/store/collections/facebook-scrapers)

### What Facebook Events data can I extract?

With this Facebook Scraper API, you can extract following data from public events listed on Facebook:

<table>
  <tr>
    <td>💃 Event name and description</td>
    <td>👨‍💼 Organizer and privacy info</td>
  </tr>
  <tr>
    <td>👥 Number of users going, interested, and that responded</td>
    <td>💰 Price and tickets info</td>
  </tr>
  <tr>
    <td>🗺 Location and address</td>
    <td>📅 Event frequency and type</td>
  </tr>
  <tr>
    <td>💰 Paid content</td>
    <td>💻 Online event and recording available</td>
  </tr>
  <tr>
    <td>📆 Start date and time, duration</td>
    <td>⌚ Past or canceled event</td>
  </tr>
  <tr>
    <td>👶 Child events</td>
    <td>📷 Image, its caption and URL</td>
  </tr>
  <tr>
    <td>🔗 External links</td>
    <td>🚩 Group event pinned to featured</td>
  </tr>
  <tr>
    <td>📚 Remote learning class or course</td>
    <td>🎤 Live audio room event</td>
  </tr>
</table>

### How much does scraping Facebook events cost?

Scraping Facebook events costs $13.00 for every 1,000 events, or $0.013 per event. If you're on Apify Free plan, you will be able to scrape up to ~380 events before needing to upgrade.

For more frequent or extensive Facebook events scraping, consider upgrading to the [$19/month Starter plan](https://apify.com/apify/facebook-events-scraper/pricing), where the price drops to $10.00 per 1,000 events and can get you up to ~1,900 events per month from the included credits. For scalable scraping, check out the $199/month Scale plan (from $8.50 per 1,000 events, ~23,400 events/month) or the $999/month Business plan (from $7.00 per 1,000 events, ~142,700 events/month).

### How to use Facebook Events Scraper?

Facebook Events Scraper is easy to use, even if you've never extracted data from the web before:

1. [Create a free Apify account](https://console.apify.com/sign-up).
2. Go to [Facebook Events Scraper.](https://apify.com/apify/facebook-events-scraper)
3. In the **Input** tab, add at least one of the following: search query or event URL.
4. *(Optional)* Set the maximum number of events to return.
5. Click **Start** and wait for the scraper to finish extracting data.
6. Download the results as JSON, JSONL, XML, RSS, HTML table, CSV, or Excel.

### ⬇️ Input

Facebook Events Scraper supports the following types of input:

🔎 **Search query.** Use search queries, for example `comedy`, to explore pretty much unlimited number of events. You can combine multiple key words in a single query, for example `comedy Chicago`, or separate them.

Note that the `maxEvents` variable applies per search query. If you set `maxEvents` to 100 and use 3 search queries, the scraper will extract up to 300 results.

Facebook hides some keywords, for example `party`, from users who are not logged in. For these keywords the scraper uses a different search request. It returns about 10 to 30 events per keyword, and the set of events changes between runs.

🎯 **Search query + Facebook filters.** Combine search queries with Facebook's search filters. When searching for events directly on Facebook, you can filter the results by various criteria, such as paid-only events, online events, specific date ranges, and more. Configure the filters on Facebook's search page, copy the resulting URL, and paste it to the `startUrls` input field. For example:

- [https://www.facebook.com/events/search?q=Comedy\&sde=AbrQ9KopLfqYT7heXVVCxznkZYxRr9hU1JA4cdLbJhjgs56yyeHW3e833A9](https://www.facebook.com/events/search?q=Comedy\&sde=AbrQ9KopLfqYT7heXVVCxznkZYxRr9hU1JA4cdLbJhjgs56yyeHW3e833A9dGP1WlEHOyagjWyFL9Y79gw-Ko1iVuJCILVkpVsHkmSbBFb3SEA\&filters=eyJmaWx0ZXJfZXZlbnRzX2NhdGVnb3J5OjAiOiJ7XCJuYW1lXCI6XCJmaWx0ZXJfZXZlbnRzX2NhdGVnb3J5XCIsXCJhcmdzXCI6XCIyMTA0MTIxMTM5ODUwMTAwXCJ9IiwicnBfZXZlbnRzX2xvY2F0aW9uOjAiOiJ7XCJuYW1lXCI6XCJmaWx0ZXJfZXZlbnRzX2xvY2F0aW9uXCIsXCJhcmdzXCI6XCIxMDg0MjQyNzkxODkxMTVcIn0iLCJmaWx0ZXJfZXZlbnRzX2RhdGVfcmFuZ2U6MCI6IntcIm5hbWVcIjpcImZpbHRlcl9ldmVudHNfZGF0ZVwiLFwiYXJnc1wiOlwiMjAyMy0wMi0yNX4yMDIzLTAyLTI2XCJ9In0%3D)

Then, to narrow down the results even more, add search queries to the `searchQueries` input field.

Note that filtering events on Facebook returns different URLs depending on whether you're logged in or not. This scraper supports only the URLs for users who are not logged in.

🔗 **Event URL.** Provide URLs of specific events and the scraper will extract all the available information for each of them. For example:

- https://www.facebook.com/events/1023978871819924
- https://www.facebook.com/events/search/?q=Party
- https://www.facebook.com/events/explore/fr-paris/110774245616525

For pages, use the following URL patterns:

- https://www.facebook.com/PAGE_NAME/upcoming_hosted_events
- https://www.facebook.com/PAGE_NAME/past_hosted_events

Note that the pattern `https://www.facebook.com/PAGENAME/events` is for logged Facebook users and doesn't work with this scraper.

For groups, use the following URL pattern for scraping both upcoming and past events:

- https://www.facebook.com/groups/GROUP_NAME/events

Note that pages and groups rarely host a lot of events. Facebook Events Scraper will return only recent events that regular Facebook users can see without scrolling. To make sure you don't miss any events, run the scraper on a schedule.

<a href="https://console.apify.com/actors/UZBnerCFBo5FgGouO">
  <img src="https://github.com/apify-projects/actor-readme-images/blob/master/facebook-events-scraper-input.png?raw=true" alt="Input of the Facebook events scraping in Apify platform">
</a>

For detailed explanation of the input example in JSON, go to the [**Input** tab](https://apify.com/apify/facebook-events-scraper/input-schema).

### ⬆️ Output sample

The results are wrapped into a dataset. You can find it in the **Output** tab.

Here's an example output generated for the `comedy` search query:

<a href="https://console.apify.com/actors/UZBnerCFBo5FgGouO">
  <img src="https://github.com/apify-projects/actor-readme-images/blob/master/facebook-events-scraper-output.png?raw=true" alt="Output of the Facebook events scraping in Apify platform">
</a>

Note that the output is not sorted chronologically.

#### 📘 Extracted Facebook events sample

For easier postprocessing, export the results to one of the supported formats: JSON, CSV, XML, RSS, HTML table, JSONL, or Excel spreadsheet. Here's an example of the exported JSON output:

```json
{
  "inputUrl": "/events/search/?q=comedy",
  "url": "https://www.facebook.com/events/1269179411830316/",
  "id": "1269179411830316",
  "name": "Comedy Night",
  "eventFrequency": "SINGLE",
  "imageUrl": "https://scontent-dfw6-1.xx.fbcdn.net/v/t39.30808-6/652981944_1352637046882419_1482894705245879590_n.jpg?stp=dst-jpg_s960x960_tt6&_nc_cat=106&ccb=1-7&_nc_sid=7e0d18&_nc_ohc=MFOFvaFL6tAQ7kNvwGG8C4m&_nc_oc=Adrl-n-LaAWl8NDoQwWkiHvZBUd1DZV_C25CfDE9V9WU5zjueC_ZpfSteCMqPHm476c&_nc_zt=23&_nc_ht=scontent-dfw6-1.xx&_nc_gid=g81S9t6ydEEHfCZJbPvuFg&_nc_ss=7a30f&oh=00_AfwSLflemJFnYIv6OtW_y0E6SRrpHuvWnDcHh7dvImfQPA&oe=69C81A20",
  "imageCaption": "May be an image of text that says 'Brings ypu The COMEDY All-Stars Saturday April 25, 2026 FEATURING COMEDY BY RICKY REYES TWO- TWO-DRINK DRINK MINIMUM UNLESS ORDERING FROM MENU JACOBY BRUTON CRAIG LOYDGREN DOORS OPEN AT 5PM SHOWTIME 6:30 Dinner served from 5pm -6:30p arrive early (Not included in ticket price) For tickets call 352 777 -4334 (Cash Only] 5230 DELACROIX DR, BROOKSVILLE FL 34604 Los Sponsoredby Sponso TICKETS $20.00 QR CODE NextHome Carlos CarlosGonzalez Gonzalez 727 727-755-3766 755 3766 ENTERTAINMENT'",
  "dateTimeSentence": "Friday, April 24, 2026 at 6:30 PM EDT",
  "utcStartDate": "2026-04-24T22:30:00.000Z",
  "startTime": "Fri, Apr 24 at 6:30 PM EDT",
  "isCanceled": false,
  "address": "5230 Delacroix Dr, Brooksville, FL 34604-9112, United States",
  "hasChildEvents": false,
  "childEvents": [],
  "duration": null,
  "description": "Comedy Night & Dinner!",
  "usersGoing": 1,
  "usersInterested": 0,
  "usersResponded": 1,
  "location": {
    "url": null,
    "id": "1352636940215763",
    "name": "5230 Delacroix Dr, Brooksville, FL, United States, Florida 34604",
    "contextualName": null,
    "placeType": "TEXT",
    "latitude": 28.51142,
    "longitude": -82.431,
    "countryCode": "US",
    "streetAddress": null,
    "city": null
  },
  "ticketsInfo": null,
  "organizedBy": "Event by Hernando Oaks Golf Club",
  "organizators": [
    {
    "id": "100064084091419",
    "url": "https://www.facebook.com/HernandoOaksGolfClub",
    "name": "Hernando Oaks Golf Club",
    "isVerified": false
    }
  ],
  "eventType": "PUBLIC",
  "isPast": false,
  "isOnline": false,
  "discoveryCategories": [],
  "externalLinks": [],
  "privacyInfo": "Public · Hosted by Hernando Oaks Golf Club",
  "paidContent": false,
  "isClassEvent": null,
  "isLiveAudioRoom": false,
  "isRemoteLearningClass": null,
  "isRemoteLearningCourse": null,
  "groupEventPinnedToFeatured": false,
  "hasRecordingAvailable": false
},
{
  "inputUrl": "/events/search/?q=comedy",
  "url": "https://www.facebook.com/events/1559468378412380/",
  "id": "1559468378412380",
  "name": "Saratoga Comedy Festival ",
  "eventFrequency": "SINGLE",
  "imageUrl": "https://scontent-lax3-1.xx.fbcdn.net/v/t39.30808-6/578243386_122104095117088197_4144082864263584010_n.jpg?stp=dst-jpg_s960x960_tt6&_nc_cat=108&ccb=1-7&_nc_sid=7e0d18&_nc_ohc=ZbLYBSCh53wQ7kNvwFGfZEB&_nc_oc=AdovsQNMpIUCeKux3SMggROm_M9o7pSwh1WOvHYcrgwuTAijwqnrvdUVzpazX9bpBRU&_nc_zt=23&_nc_ht=scontent-lax3-1.xx&_nc_gid=S3pdrBM0pmhqdlxENTKRlA&_nc_ss=7a30f&oh=00_AfwNz0BsvmRxrzk3gAA-vlx6A7v6FJJAEPi5CrR-pzVwew&oe=69C8309D",
  "imageCaption": "No photo description available.",
  "dateTimeSentence": "Sep 11 at 6:00 PM – Sep 12 at 11:59 PM EDT",
  "utcStartDate": "2026-09-11T22:00:00.000Z",
  "startTime": "Fri, Sep 11 - Sep 12",
  "isCanceled": false,
  "address": "522 Broadway, Saratoga Springs, NY 12866, Saratoga Springs, NY 12866",
  "hasChildEvents": false,
  "childEvents": [],
  "duration": "2 days",
  "description": "The Saratoga Comedy Festival is here to make you laugh! Join us September 11th and 12th 2026, at the Saratoga CIty Center. Shows will be all night on both nights. There will be a chance to see up to 15 shows per night. All of these shows in one convenient place. Tickets range from one day tickets, to VIP all weekend access. The show schedule will be announced 3 weeks before the show. Headliners and other comics will be announced daily on social media and our website. \n\nTickets are available at Saratogacomedyfest.com ",
  "usersGoing": 30,
  "usersInterested": 136,
  "usersResponded": 166,
  "location": {
    "url": "https://facebook.com/saratogaspringscitycenter",
    "id": "108146202560034",
    "name": "Saratoga Springs City Center",
    "contextualName": "Saratoga Springs, NY, United States",
    "placeType": "PLACE",
    "latitude": 43.084901319789,
    "longitude": -73.783486508612,
    "countryCode": "US",
    "streetAddress": "522 Broadway, Saratoga Springs, NY 12866",
    "city": "Saratoga Springs, NY, United States"
  },
  "ticketsInfo": {
    "buyUrl": "http://Saratogacomedyfest.com/",
    "price": null,
    "title": "Tickets",
    "subtitle": "Saratogacomedyfest.com",
    "ticketProvider": null
  },
  "organizedBy": "Event by Saratoga Comedy Festival",
  "organizators": [
    {
    "id": "61582645933961",
    "url": "https://www.facebook.com/people/Saratoga-Comedy-Festival/61582645933961/",
    "name": "Saratoga Comedy Festival",
    "isVerified": false
    }
  ],
  "eventType": "PUBLIC",
  "isPast": false,
  "isOnline": false,
  "discoveryCategories": [],
  "externalLinks": [
    "http://Saratogacomedyfest.com/"
  ],
  "privacyInfo": "Public · Hosted by Saratoga Comedy Festival",
  "paidContent": false,
  "isClassEvent": null,
  "isLiveAudioRoom": false,
  "isRemoteLearningClass": null,
  "isRemoteLearningCourse": null,
  "groupEventPinnedToFeatured": false,
  "hasRecordingAvailable": false
}
```

### Want to scrape other types of Facebook data?

To scrape specific Facebook data, use the dedicated scrapers:

<table>
  <tr>
    <td>🕵️‍♀️ <a href="https://apify.com/apify/facebook-search-scraper">Facebook Search Scraper</a></td>
    <td>🗓 <a href="https://apify.com/apify/facebook-events-scraper">Facebook Events Scraper</a></td>
    <td>🚩 <a href="https://apify.com/apify/facebook-pages-scraper">Facebook Pages Scraper</a></td>
  </tr>
  <tr>
    <td>🕹 <a href="https://apify.com/apify/facebook-games-scraper">Facebook Games Scraper</a></td>
    <td>👀 <a href="https://apify.com/apify/facebook-marketplace-scraper">Facebook Marketplace Scraper</a></td>
    <td>🎞 <a href="https://apify.com/apify/facebook-reels-scraper">Facebook Reels Scraper</a></td>
  </tr>
  <tr>
    <td>👥 <a href="https://apify.com/apify/facebook-groups-scraper">Facebook Groups Scraper</a></td>
    <td>📝 <a href="https://apify.com/apify/facebook-posts-scraper">Facebook Posts Scraper</a></td>
    <td>📹 <a href="https://apify.com/apify/facebook-video-search-scraper">Facebook Video Search Scraper</a></td>
  </tr>
  <tr>
    <td>💬 <a href="https://apify.com/apify/facebook-comments-scraper">Facebook Comments Scraper</a></td>
    <td>👍 <a href="https://apify.com/apify/facebook-likes-scraper">Facebook Likes and Reactions Scraper</a></td>
    <td>ℹ️ <a href="https://apify.com/apify/facebook-page-contact-information">Facebook Page Contact Information</a></td>
  </tr>
  <tr>
    <td>🏞 <a href="https://apify.com/apify/facebook-photos-scraper">Facebook Photos Scraper</a></td>
    <td>#️⃣ <a href="https://apify.com/apify/facebook-hashtag-scraper">Facebook Hashtag Scraper</a></td>
    <td>👥 <a href="https://apify.com/apify/facebook-followers-following-scraper">Facebook Followers Following Scraper</a></td>
  </tr>
  <tr>
    <td>📢 <a href="https://apify.com/apify/facebook-ads-scraper">Facebook Ads Library Scraper</a></td>
    <td>📱 <a href="https://apify.com/apify/facebook-page-contact-information">Facebook Pages Info Scraper</a></td>
    <td>🧲 <a href="https://apify.com/apify/social-media-leads-analyzer">Social Media Leads Analyzer</a></td>
  </tr>
</table>

### ❓ FAQ

#### Are there other social media scrapers?

Apify offers many scrapers for extracting data from social media, such as:

- [Instagram Scraper](https://apify.com/jaroslavhejlek/instagram-scraper)
- [Twitter Scraper](https://apify.com/quacker/twitter-scraper)
- [TikTok Scraper](https://apify.com/clockworks/tiktok-scraper)
- [Reddit Scraper](https://apify.com/trudax/reddit-scraper)

For even more scrapers, browse the [**Social media** category](https://apify.com/store/categories/social-media) in Apify Store.

#### Can I export Facebook Events data using API?

You can access the extracted Facebook data through the Apify API. The API is organized around RESTful HTTP endpoints that enable you to manage, schedule, and run Apify actors. You can also programmatically access datasets, monitor actor performance, fetch results, and more.

To access the API using Node.js, use the `apify-client` NPM package. To access the API using Python, use the `apify-client` PyPI package.

For details, see the <a href="https://docs.apify.com/api/v2" target="_blank">Apify API docs</a>.

#### Does Facebook Events Scraper integrate with other services?

You can connect Facebook Events Scraper with almost any cloud service or web app</a>. For example, you can **integrate with Make, Zapier, Slack, Airbyte, GitHub, Google Sheets, Google Drive,** <a href="https://docs.apify.com/integrations"  target="_blank">and more</a>.

You can also use <a href="https://docs.apify.com/integrations/webhooks" target="_blank">webhooks</a> to perform an action whenever an event occurs, for example, to get a notification once Facebook Events Scraper successfully finishes a run.

#### Do I need to be logged in to Facebook to scrape events?

You don't need to be logged in or provide credentials because anyone can browse public events listed on Facebook. Facebook's recommendations on events depend on your location and other criteria.

#### Do I need proxies to scrape Facebook Events?

In general, yes, you need [proxies](https://apify.com/proxy?pricing=residential-ip#pricing). However, you don't have to apply them yourself if you run the scraper on the Apify platform. For successful Facebook events scraping, Apify runs residential proxies in the background. These proxies are included in the monthly Starter plan.

#### Not your cup of tea? Build your own scraper!

Facebook Events Scraper doesn’t exactly do what you need? You can always build your own! To get you started, Apify offers various [scraper templates](https://apify.com/templates) in Python, JavaScript, and TypeScript. You can also write a scraper from scratch using our [open-source library Crawlee](https://crawlee.dev/).

If you don't want to keep the scraper to yourself, make it public by adding it to Apify Store. See our blog post on [how to make passive income by developing Actors](https://blog.apify.com/make-regular-passive-income-developing-web-automation-actors-b0392278d085/).

If you need a [custom scraping solution](https://apify.com/custom-solutions), contact us.

#### Is it legal to scrape Facebook Events data?

Apify's [Facebook scrapers](https://apify.com/store?search=facebook) are ethical and **do not extract any private user data, such as email addresses, gender, or location**. They only extract what the user has chosen to share publicly.

However, you should be aware that the results that you get might contain personal data. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

See also our blog posts on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/) and [ethical scraping](https://blog.apify.com/what-is-ethical-web-scraping-and-how-do-you-do-it/).

#### Facebook Events Scraper not working?

We're always working on improving the performance of our Actors. If you have technical feedback or found a bug, create an issue on the Actor's [**Issues** tab](https://apify.com/apify/facebook-events-scraper/issues/open).

# Actor input Schema

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

Search you want to use to discover new events. You can provide search for topics, such as 'Sport', or for places, such as 'New York', or combine them 'Sport New York'.

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

URLs to start with. You can provide URLs of event details here or search/explore URLs, e.g. 'https://www.facebook.com/events/1023978871819924' or 'https://www.facebook.com/events/search/?q=Party' or 'https://www.facebook.com/events/explore/fr-paris/110774245616525' or 'https://www.facebook.com/events/search?q=Comedy\&sde=AbrQ9KopLfqYT7heXVVCxznkZYxRr9hU1JA4cdLbJhjgs56yyeHW3e833A9dGP1WlEHOyagjWyFL9Y79gw-Ko1iVuJCILVkpVsHkmSbBFb3SEA\&filters=eyJmaWx0ZXJfZXZlbnRzX2NhdGVnb3J5OjAiOiJ7XCJuYW1lXCI6XCJmaWx0ZXJfZXZlbnRzX2NhdGVnb3J5XCIsXCJhcmdzXCI6XCIyMTA0MTIxMTM5ODUwMTAwXCJ9IiwicnBfZXZlbnRzX2xvY2F0aW9uOjAiOiJ7XCJuYW1lXCI6XCJmaWx0ZXJfZXZlbnRzX2xvY2F0aW9uXCIsXCJhcmdzXCI6XCIxMDg0MjQyNzkxODkxMTVcIn0iLCJmaWx0ZXJfZXZlbnRzX2RhdGVfcmFuZ2U6MCI6IntcIm5hbWVcIjpcImZpbHRlcl9ldmVudHNfZGF0ZVwiLFwiYXJnc1wiOlwiMjAyMy0wMi0yNX4yMDIzLTAyLTI2XCJ9In0%3D'.

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

Maximum number of events you want to extract data for. If you leave this field empty, the number of events won't be limited.

## Actor input object example

```json
{
  "searchQueries": [
    "Sport New York"
  ],
  "startUrls": [
    "https://www.facebook.com/events/1023978871819924"
  ],
  "maxEvents": 30
}
```

# Actor output Schema

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

Dataset containing all scraped data

# 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": [
        "Sport New York"
    ],
    "startUrls": [],
    "maxEvents": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("apify/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": ["Sport New York"],
    "startUrls": [],
    "maxEvents": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("apify/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": [
    "Sport New York"
  ],
  "startUrls": [],
  "maxEvents": 30
}' |
apify call apify/facebook-events-scraper --silent --output-dataset

```

## MCP server setup

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