# Luma/Cerebral Valley (`petroshong/developer-community-manager-event-search`) Actor

Scrapes Luma and Cerebral Valley for events by city, date range, and keywords. Returns a normalized dataset: title, URL, start/end time, venue, city, organizer, description, price. Deduplicated and filtered so results match your chosen location and dates.

- **URL**: https://apify.com/petroshong/developer-community-manager-event-search.md
- **Developed by:** [Petros Hong](https://apify.com/petroshong) (community)
- **Categories:** Automation, Social media, Other
- **Stats:** 7 total users, 3 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## Events Agent – Apify Actor

Apify Actor that finds events by **location**, **date window**, and **keywords** from **Luma** and **Cerebral Valley**, then outputs a normalized, deduplicated dataset. Use separate actors for Meetup or Google if needed.

### Sources

- **Luma** (lu.ma) – city-specific event pages (SF, NYC, London, etc.)
- **Cerebral Valley** – [cerebralvalley.ai/events](https://cerebralvalley.ai/events), pre-filtered by city
- **Extra URLs** (optional) – any event or list page URLs you add in `sources.extraUrls`

### How location filtering works

| Layer | What it does |
|-------|-------------|
| **Luma city page** | Builds a city-specific URL (e.g. `lu.ma/sf`) so only local events are listed |
| **CV list pre-filter** | Reads event-card text on the global CV page and drops cards that mention a conflicting city or "Online" |
| **Post-crawl city filter** | Rejects events whose location fields clearly belong to a different city |
| **Post-crawl country filter** | Rejects events from a different country (US/UK/CA normalized) |
| **Online detection** | Online-only events are excluded when a physical city is requested; hybrid events pass through |

### Input schema (summary)

| Field | Type | Default |
|-------|------|---------|
| `location` | `{ city?, region?, country? }` | `{}` – city filters by city; country adds secondary filter |
| `keywords` | string[] | `[]` – annotates events with `matchedKeywords` |
| `startDate` | date string | today (America/Los_Angeles) |
| `endDate` | date string | start + 14 days |
| `sources` | `{ luma, cerebralValley, extraUrls[] }` | both on, no extras |
| `maxEventsPerSource` | 1–50 | 25 |
| `headless` | boolean | true |
| `proxyConfiguration` | Apify proxy object | optional |
| `debug` | boolean | false |

Date formats accepted: `YYYY-MM-DD`, `MM/DD/YYYY`, `DD.MM.YYYY`. Start date must be on or before end date.

### Run locally

1. **Install and build**
   ```bash
   npm install
   npm run build
````

2. **Run with local storage**
   ```bash
   ## Linux/Mac
   export APIFY_LOCAL_STORAGE_DIR=./storage

   ## Windows
   set APIFY_LOCAL_STORAGE_DIR=./storage

   npm start
   ```
   Put your input at `./storage/key_value_stores/default/INPUT.json` or use the Apify CLI.

3. **Example input** (see `.actor/input.json`)
   ```json
   {
     "location": { "city": "San Francisco", "region": "CA", "country": "USA" },
     "keywords": ["AI", "startup", "tech"],
     "sources": { "luma": true, "cerebralValley": true, "extraUrls": [] },
     "maxEventsPerSource": 25
   }
   ```

### Run timeout and event count

Default run options: **timeout 3000s** (50 min), **memory 2048 MB**.

- **Quick run:** `maxEventsPerSource: 5` → ~12 requests, finishes in a few minutes.
- **Standard:** `maxEventsPerSource: 25` → ~52 requests, well within 3000s.
- **Maximum:** `maxEventsPerSource: 50` → ~102 requests, fits within 3000s.

### Output (normalized event)

Results are deduplicated (stable ID + fuzzy title/time/city match) and filtered to real events only.

Each dataset item includes:

- **`url`** – event page URL
- **`title`** – event title
- **`date`** – YYYY-MM-DD from start time
- **`time`** – HH:mm from start time
- **`company`** – primary company (organizer or first company involved)
- **`description`** – event description

Plus when available: `startTime`, `endTime`, `venueName`, `address`, `city`, `region`, `country`, `lat`, `lon`, `isOnline`, `attendanceType`, `organizerName`, `companiesInvolved[]`, `speakers[]`, `tags`, `matchedKeywords`, `imageUrl`, `scrapedFromUrls`, and more.

### Scripts

- `npm run build` – compile TypeScript to `dist/`
- `npm start` – run `dist/main.js`
- `npm run lint` – ESLint on `src/`
- `npm test` – run Jest unit tests

### Extending

Add `src/sources/<name>.ts` with `enqueue*` and `parse*Page` functions, then wire them in `main.ts`.

# Actor input Schema

## `location` (type: `object`):

Where to search. City filters results to that city (excluding online-only events). Country adds a secondary filter.

## `keywords` (type: `array`):

Annotate events with matched keywords (matched in title, description, tags). Leave empty to skip keyword matching.

## `daysFromToday` (type: `integer`):

Optional. Single day only: the calendar date N days after today. 1 = tomorrow only, 2 = the day after tomorrow only. Ignored if you set both Start date and End date in the run input.

## `weeksFromToday` (type: `integer`):

Optional. Inclusive. 1 = next 7 days including today. Ignored if Start date / End date are both provided.

## `monthsFromToday` (type: `integer`):

Optional. Inclusive. 1 = through the day before the same date next month. Ignored if Start date / End date are both provided.

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

Start of date range. YYYY-MM-DD, MM/DD/YYYY, or DD.MM.YYYY. Leave empty for today (or use Weeks/Months from today).

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

End of date range. Must be on or after start date. Leave empty for start + 14 days (or use Weeks/Months from today).

## `sortOutputByDate` (type: `boolean`):

When enabled, dataset items are sorted by date then time. When disabled, items are pushed as crawled (resurrection-safe).

## `sources` (type: `object`):

Toggle Luma and Cerebral Valley. Optionally add extra event or list page URLs.

## `maxEventsPerSource` (type: `integer`):

Max event pages to fetch per source. Default 25 fits the 4000s timeout comfortably. Use 50 for maximum coverage.

## `headless` (type: `boolean`):

Run browser in headless mode. Uncheck for visual debugging.

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

Optional Apify proxy to reduce blocking. Leave empty for direct connections.

## `debug` (type: `boolean`):

Include raw extracted data in output and enable verbose logging.

## Actor input object example

```json
{
  "location": {},
  "keywords": [],
  "startDate": "",
  "endDate": "",
  "sortOutputByDate": true,
  "sources": {
    "luma": true,
    "cerebralValley": true,
    "extraUrls": []
  },
  "maxEventsPerSource": 25,
  "headless": true,
  "debug": false
}
```

# Actor output Schema

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

Event records in the 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("petroshong/developer-community-manager-event-search").call(input);

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

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

```

## Python example

```python
from apify_client import ApifyClient

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

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("petroshong/developer-community-manager-event-search").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call petroshong/developer-community-manager-event-search --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=petroshong/developer-community-manager-event-search",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Luma/Cerebral Valley",
        "description": "Scrapes Luma and Cerebral Valley for events by city, date range, and keywords. Returns a normalized dataset: title, URL, start/end time, venue, city, organizer, description, price. Deduplicated and filtered so results match your chosen location and dates.",
        "version": "0.0",
        "x-build-id": "j30a6cmsIGgTeDAQJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/petroshong~developer-community-manager-event-search/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-petroshong-developer-community-manager-event-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/petroshong~developer-community-manager-event-search/runs": {
            "post": {
                "operationId": "runs-sync-petroshong-developer-community-manager-event-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/petroshong~developer-community-manager-event-search/run-sync": {
            "post": {
                "operationId": "run-sync-petroshong-developer-community-manager-event-search",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "location": {
                        "title": "Location",
                        "type": "object",
                        "description": "Where to search. City filters results to that city (excluding online-only events). Country adds a secondary filter.",
                        "properties": {
                            "city": {
                                "type": "string",
                                "title": "City",
                                "description": "City name (e.g. San Francisco, New York, London). Used to filter Luma by city page and exclude events from other cities.",
                                "editor": "textfield",
                                "default": ""
                            },
                            "region": {
                                "type": "string",
                                "title": "Region / State",
                                "description": "State or region code (e.g. CA). Used as metadata on output events.",
                                "editor": "textfield",
                                "default": ""
                            },
                            "country": {
                                "type": "string",
                                "title": "Country",
                                "description": "Country name or code (e.g. USA, UK). Filters out events from other countries.",
                                "editor": "textfield",
                                "default": ""
                            }
                        },
                        "default": {}
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "array",
                        "description": "Annotate events with matched keywords (matched in title, description, tags). Leave empty to skip keyword matching.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "daysFromToday": {
                        "title": "Days from today",
                        "minimum": 1,
                        "maximum": 365,
                        "type": "integer",
                        "description": "Optional. Single day only: the calendar date N days after today. 1 = tomorrow only, 2 = the day after tomorrow only. Ignored if you set both Start date and End date in the run input."
                    },
                    "weeksFromToday": {
                        "title": "Weeks from today",
                        "minimum": 1,
                        "maximum": 52,
                        "type": "integer",
                        "description": "Optional. Inclusive. 1 = next 7 days including today. Ignored if Start date / End date are both provided."
                    },
                    "monthsFromToday": {
                        "title": "Months from today",
                        "minimum": 1,
                        "maximum": 24,
                        "type": "integer",
                        "description": "Optional. Inclusive. 1 = through the day before the same date next month. Ignored if Start date / End date are both provided."
                    },
                    "startDate": {
                        "title": "Start date",
                        "type": "string",
                        "description": "Start of date range. YYYY-MM-DD, MM/DD/YYYY, or DD.MM.YYYY. Leave empty for today (or use Weeks/Months from today).",
                        "default": ""
                    },
                    "endDate": {
                        "title": "End date",
                        "type": "string",
                        "description": "End of date range. Must be on or after start date. Leave empty for start + 14 days (or use Weeks/Months from today).",
                        "default": ""
                    },
                    "sortOutputByDate": {
                        "title": "Sort output by date",
                        "type": "boolean",
                        "description": "When enabled, dataset items are sorted by date then time. When disabled, items are pushed as crawled (resurrection-safe).",
                        "default": true
                    },
                    "sources": {
                        "title": "Sources",
                        "type": "object",
                        "description": "Toggle Luma and Cerebral Valley. Optionally add extra event or list page URLs.",
                        "properties": {
                            "luma": {
                                "type": "boolean",
                                "title": "Luma (lu.ma)",
                                "description": "Include events from Luma city page.",
                                "editor": "checkbox",
                                "default": true
                            },
                            "cerebralValley": {
                                "type": "boolean",
                                "title": "Cerebral Valley",
                                "description": "Include events from cerebralvalley.ai/events (pre-filtered by city).",
                                "editor": "checkbox",
                                "default": true
                            },
                            "extraUrls": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "title": "Extra URLs",
                                "description": "Additional event or list page URLs. Direct event pages (with JSON-LD) are parsed immediately; list pages are crawled for links.",
                                "editor": "stringList",
                                "default": []
                            }
                        },
                        "default": {
                            "luma": true,
                            "cerebralValley": true,
                            "extraUrls": []
                        }
                    },
                    "maxEventsPerSource": {
                        "title": "Max events per source",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Max event pages to fetch per source. Default 25 fits the 4000s timeout comfortably. Use 50 for maximum coverage.",
                        "default": 25
                    },
                    "headless": {
                        "title": "Headless browser",
                        "type": "boolean",
                        "description": "Run browser in headless mode. Uncheck for visual debugging.",
                        "default": true
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional Apify proxy to reduce blocking. Leave empty for direct connections."
                    },
                    "debug": {
                        "title": "Debug mode",
                        "type": "boolean",
                        "description": "Include raw extracted data in output and enable verbose logging.",
                        "default": false
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
