# ToDoCanada Events & Attractions Scraper (`crawlerbros/todocanada-scraper`) Actor

Scrape ToDoCanada.ca - Canadian events and attractions for 11 cities (Toronto, Vancouver, Calgary, Ottawa, ...). Browse events by city or category, search, fetch single event pages (JSON-LD Event schema: dates, venues, addresses, images), and read attraction/things-to-do articles.

- **URL**: https://apify.com/crawlerbros/todocanada-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Travel, Developer tools
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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

## ToDoCanada Events & Attractions Scraper

Scrape [ToDoCanada.ca](https://www.todocanada.ca/) — Canada's events and attractions site. Browse events by **city** (Toronto, Vancouver, Calgary, Ottawa, …) or **category** (adults-only, drive-thru, exhibitions, family, nightlife, food & drink, …), run site search, fetch single event pages, or read attractions / things-to-do articles. Event detail pages carry structured JSON-LD `Event` data (start/end dates, venue, address, image, ticket link).

### What this actor does

- **Five modes:** `byCity` (default), `byCategory`, `search`, `byEventUrl`, `attractions`
- **12 cities** as a dropdown: all (whole country), toronto, vancouver, calgary, edmonton, ottawa, winnipeg, banff, jasper, regina, saskatoon, central-alberta
- **12 event categories** as a dropdown: adults-only, drive-thru-events, exhibitions, familyevents, festival-events, food-drink-events, free-events, fundraising-gala-events, miscellaneous, nightlife, online, sports-2
- **Time-window filter** (`etype`): upcoming / this week / this weekend / current / this month / next month / past
- **Filters:** event date range (client-side on JSON-LD dates), title/description keyword
- **Auto-escalation:** curl\_cffi (chrome131 impersonation) first; lazy-engages Apify AUTO datacenter proxy + backoff on 403/429/5xx
- **Empty fields are omitted**; every record carries `sourceUrl`, `scrapedAt`, `recordType`

### Output per event

- `eventId`, `title`, `description`
- `startDate`, `endDate` (ISO, from JSON-LD)
- `venueName`, `addressStreet`, `addressLocality`, `addressRegion`, `addressPostalCode`, `addressCountry`
- `imageUrl`, `ticketUrl`, `price` (when the site publishes a number)
- `eventUrl`, `city`, `category` (mode-scoped)
- `recordType: "event" | "attraction" | "error"`, `scrapedAt`

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `mode` | select | `byCity` | `byCity` / `byCategory` / `search` / `byEventUrl` / `attractions` |
| `city` | select | `toronto` | City slug (12 options, incl. `all` for whole country) |
| `category` | select | `exhibitions` | Event category slug (12 options) |
| `searchQuery` | string | `toronto festival` | Site search query (mode=search) |
| `eventUrls` | array | – | Event page URLs (mode=byEventUrl) |
| `etype` | select | `upcoming` | Listing time window |
| `dateFrom` / `dateTo` | string | – | Client-side date range filter (ISO) |
| `containsKeyword` | string | – | Title/description substring filter |
| `maxItems` | int | `20` | Hard cap (1–1000) |

#### Example: upcoming exhibitions in Vancouver

```json
{
  "mode": "byCategory",
  "city": "vancouver",
  "category": "exhibitions",
  "etype": "upcoming",
  "maxItems": 30
}
```

#### Example: a single event

```json
{
  "mode": "byEventUrl",
  "eventUrls": ["https://www.todocanada.ca/city/toronto/event/bd-beats-2026/"]
}
```

### Anti-bot notes

Plain `curl` gets 403 (UA-sensitive); `curl_cffi` with chrome131 impersonation returns 200 with full content (verified locally). If the cloud run is blocked, the actor lazy-engages the free Apify AUTO datacenter proxy and retries with exponential backoff.

### Data source

HTML/JSON-LD from todocanada.ca (WordPress). Event pages embed `schema.org/Event` JSON-LD. Listing pages paginate at `/city/{slug}/events/page/N/`. No login required.

### Limitations

- Event dates come from the site's JSON-LD, which uses both ISO and MM/DD/YYYY formats (both are normalized to ISO); some listings lack start/end dates (omitted, never sentinel).
- `search` mode returns event records only. The site search also matches roundup *articles* (e.g. `festival`, `weekend`); when a query's results are articles only, the run emits 0 records with a status message — use `byCity`/`byCategory` or `attractions` for article content.
- The site's JSON-LD emits `addressCountry: "AF"` as a country-code default on Canadian events (source-data defect) — this value is omitted instead of shipped.
- Attraction image URLs come from `og:image`; site-logo/icon URLs are rejected. Some articles have no real image (omitted).
- Image URLs are WordPress CDN paths from the site's JSON-LD — served with `200 image/jpeg` from a clean shell (site is UA-sensitive; the browser UA returns 200, no Referer needed).
- Invalid inputs produce typed `recordType: "error"` records (no silent drops); duplicate/aliased event URLs in `byEventUrl` are normalized and deduped to single records.

# Actor input Schema

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

What to fetch.

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

ToDoCanada city slug.

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

ToDoCanada event category slug.

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

Free-text query for site search.

## `eventUrls` (type: `array`):

Full ToDoCanada event page URLs, e.g. https://www.todocanada.ca/city/toronto/event/bd-beats-2026/

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

Constrain listing to a time window (site-native filter).

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

Drop events that end before this date (YYYY-MM-DD or full ISO).

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

Drop events that start after this date (YYYY-MM-DD or full ISO).

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

Only keep records whose title or description contains this substring (case-insensitive).

## `maxItems` (type: `integer`):

Hard cap on emitted records.

## Actor input object example

```json
{
  "mode": "byCity",
  "city": "toronto",
  "category": "exhibitions",
  "searchQuery": "toronto festival",
  "eventUrls": [],
  "etype": "upcoming",
  "maxItems": 20
}
```

# Actor output Schema

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

Dataset containing all scraped events and attractions.

# 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 = {
    "mode": "byCity",
    "city": "toronto",
    "category": "exhibitions",
    "searchQuery": "toronto festival",
    "eventUrls": [],
    "etype": "upcoming",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/todocanada-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 = {
    "mode": "byCity",
    "city": "toronto",
    "category": "exhibitions",
    "searchQuery": "toronto festival",
    "eventUrls": [],
    "etype": "upcoming",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/todocanada-scraper").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 '{
  "mode": "byCity",
  "city": "toronto",
  "category": "exhibitions",
  "searchQuery": "toronto festival",
  "eventUrls": [],
  "etype": "upcoming",
  "maxItems": 20
}' |
apify call crawlerbros/todocanada-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/todocanada-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/Xi2Md8zuX4WJ4rIwH/builds/CjS8N2MmdhEf8eKdf/openapi.json
