# CanadaBuys Tenders Scraper – Canada Government Contracts (`flets_sv/canadabuys-tenders`) Actor

Search open Canadian federal tenders from the official CanadaBuys open data: buyer, closing date, category, UNSPSC and notice link. No personal contact data.

- **URL**: https://apify.com/flets_sv/canadabuys-tenders.md
- **Developed by:** [FlEtsv](https://apify.com/flets_sv) (community)
- **Categories:** Lead generation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 tender notice returneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## CanadaBuys Tenders Scraper – Canada Government Contracts

Get open Canadian federal tenders from the official CanadaBuys open data (Government of Canada): filter by keyword, category, buyer and publication date, and receive clean JSON with buyer, closing date, UNSPSC codes, trade agreements and a link to each notice. *Versión en español más abajo.*

***

### Use cases

- Bid managers and exporters: a list of open Canadian federal opportunities in your keywords
- IT, consulting and construction suppliers: find buyers and closing dates early
- Market intelligence: tenders by buyer, category and UNSPSC
- Alerts: schedule the Actor with Apify Schedules and send the results to Slack, email or your CRM

### English

#### What does it do?

The Actor downloads the open tender notices CSV that CanadaBuys publishes as open data, applies your filters and returns one record per notice: reference, solicitation number, title (in your chosen language, plus the other language in `tituloAlternativo`), publication and closing dates, days left, status, category, procurement method, contracting entity, city and province, UNSPSC codes with descriptions, trade agreements, a description excerpt (first 600 characters, HTML removed) and the notice link. Results are sorted by publication date, newest first.

**Privacy (GDPR / PIPEDA):** the source file also holds contact data of the contracting officer. The Actor never reads those columns (`aFila` in `logic.ts`), so no names, emails or phones appear in the output.

#### Input

Filters are combined: a notice must pass all of them.

- `palabrasClave`: all words must appear in the title (English or French), the description excerpt or the UNSPSC description. Ignores case and accents.
- `categoria`: `any`, `goods`, `services`, `construction` or `servicesRelatedToGoods`.
- `entidad`: part of the buyer name, e.g. `National Defence`. Ignores case and accents.
- `estado`: `any` or `Open`. It is compared with the status text of the output language, so with `idioma` set to `fr` the value `Open` will not match; leave it on `any` for French output.
- `diasAtras`: only notices published in the last N days (1 to 3650, default 90).
- `soloAbiertos`: skip notices whose closing date has passed (default true). Notices without a closing date are kept.
- `idioma`: `en` (default) or `fr`, for title, description, status, method, buyer and address fields.
- `maxItems`: maximum notices returned (1 to 5000, default 10).

The default input (`software`, last 90 days, 10 notices) works as is: press **Start**.

Example 1, open software tenders (`ejemplos/software-90-dias.json`):

```json
{"palabrasClave":"software","diasAtras":90,"maxItems":10}
```

Example 2, construction notices from a National Defence buyer, in French (`ejemplos/construccion-defensa-fr.json`):

```json
{"palabrasClave":"","categoria":"construction","entidad":"Defence","idioma":"fr","maxItems":10}
```

Note for example 2: with French output the buyer name is the French one, so `Defence` may not match a department whose French name does not contain it; the Actor falls back to the other language only when one is empty.

#### Output (illustrative example, not copied from a run)

```json
{
  "referencia": "cb-157-75573891",
  "numeroSolicitud": "ESC-2627-118",
  "titulo": "Collection Management System for AAFC national living biological collections under the Service as a Software (SaaS) model",
  "fechaPublicacion": "2026-11-03",
  "fechaCierre": "2026-12-02",
  "diasRestantes": 27,
  "estado": "Open",
  "categoria": "SRV",
  "metodo": "Competitive - Open bidding",
  "entidad": "Department of Agriculture and Agri-Food (AAFC)",
  "ciudad": "Montreal",
  "provincia": "Quebec",
  "unspsc": ["43230000"],
  "unspscDescripcion": ["Software"],
  "urlAviso": "https://canadabuys.canada.ca/en/tender-opportunities/tender-notice/cb-157-75573891"
}
```

Fields: `referencia`, `numeroSolicitud`, `titulo`, `tituloAlternativo`, `fechaPublicacion`, `fechaCierre`, `diasRestantes` (negative if already closed and `soloAbiertos` is off), `estado`, `categoria`, `metodo`, `entidad`, `ciudad`, `provincia`, `unspsc`, `unspscDescripcion`, `acuerdosComerciales`, `descripcion`, `urlAviso`. List fields keep at most 15 items.

#### Errors and retries

- The CSV download is tried up to 3 times with a 120 second timeout each, waiting 2 and then 4 seconds between attempts (`descargar` in `main.ts`). Any failure is retried, HTTP errors and network errors alike.
- If all 3 attempts fail the run fails with "CanadaBuys no responde" and the last error.
- Not retried, the run fails at once: the file has fewer than 2 rows (empty), or the header lacks `referenceNumber` (format changed).
- If the maximum spend per run is reached the Actor stops and keeps what it already saved.
- A search with no matches ends successfully with an empty dataset.

#### Pricing (pay per event)

| Event | Price | Per 1,000 |
|---|---|---|
| Tender notice returned (`tender-notice`) | $0.003 | $3.00 |

You pay for each notice returned. Set a maximum spend per run; the Actor stops when the limit is reached.

#### Integrations (Make, Zapier, Google Sheets)

- **Make**: add the Apify module "Run an Actor" (Actor `Flets_sv/canadabuys-tenders`), paste the input JSON, chain "Get Dataset Items" and map the fields to Google Sheets, Slack, Airtable or your CRM.
- **Zapier**: the Apify app offers "Run Actor" and "Fetch Dataset Items". Add a Schedule trigger and send each row to Gmail, Slack or Notion.
- **Google Sheets**: enable the official Google Sheets integration in the Actor's Integrations tab, or call `https://api.apify.com/v2/acts/Flets_sv~canadabuys-tenders/run-sync-get-dataset-items?format=csv` with POST and your input from Apps Script (`UrlFetchApp`).
- **API and webhooks**: start the Actor from the REST API, use Schedules for recurring runs and add a webhook to be notified when a run finishes.

The Actor has no "new only" mode: a scheduled run returns again the notices that still match. De-duplicate by `referencia` in your tool.

#### FAQ

**Does it need an API key?** No. It reads the public CanadaBuys open data file.

**Does it include provincial or municipal tenders?** No, only the notices in that CanadaBuys file.

**Where are the buyer contacts?** Deliberately left out; open the notice link to see what is published there.

**Why is `urlAviso` sometimes built by the Actor?** When the file has no notice link, the Actor builds the CanadaBuys page from the reference number (English or French path by `idioma`).

***

### Español

#### ¿Qué hace?

El Actor descarga el CSV de avisos de licitación abiertos que CanadaBuys publica como datos abiertos, aplica tus filtros y devuelve un registro por aviso: referencia, número de solicitud, título (en el idioma elegido y el otro idioma en `tituloAlternativo`), fechas de publicación y cierre, días restantes, estado, categoría, método, organismo comprador, ciudad y provincia, códigos UNSPSC con descripción, acuerdos comerciales, un extracto de la descripción (600 caracteres, sin HTML) y el enlace al aviso. Salen ordenados por fecha de publicación, los más recientes primero.

**Privacidad (RGPD):** el fichero original incluye datos de contacto del responsable. El Actor no lee esas columnas (`aFila` en `logic.ts`): la salida no contiene nombres, correos ni teléfonos.

#### Input

Los filtros se combinan: un aviso debe cumplirlos todos.

- `palabrasClave`: todas las palabras deben aparecer en el título (inglés o francés), el extracto de la descripción o la descripción UNSPSC. Sin distinguir mayúsculas ni acentos.
- `categoria`: `any`, `goods` (bienes), `services` (servicios), `construction` (obra) o `servicesRelatedToGoods` (servicios ligados a bienes).
- `entidad`: parte del nombre del comprador, p. ej. `National Defence`.
- `estado`: `any` u `Open`. Se compara con el texto de estado del idioma de salida: con `idioma` en `fr`, el valor `Open` no coincidirá; déjalo en `any` para salida en francés.
- `diasAtras`: solo avisos publicados en los últimos N días (1 a 3650, por defecto 90).
- `soloAbiertos`: omite los avisos cuyo cierre ya pasó (por defecto sí). Los avisos sin fecha de cierre se mantienen.
- `idioma`: `en` (por defecto) o `fr`.
- `maxItems`: máximo de avisos devueltos (1 a 5000, por defecto 10).

Con la entrada por defecto (`software`, 90 días, 10 avisos) basta pulsar **Start**. Los dos ejemplos de la sección inglesa están en `ejemplos/software-90-dias.json` y `ejemplos/construccion-defensa-fr.json`.

#### Output

Un registro por aviso con los campos del ejemplo ilustrativo de arriba (no copiado de una ejecución real). Las listas llevan como máximo 15 elementos.

#### Errores y reintentos

- La descarga del CSV se intenta hasta 3 veces, con 120 segundos de límite cada una y esperas de 2 y 4 segundos entre intentos (`descargar` en `main.ts`). Se reintenta cualquier fallo, de HTTP o de red.
- Si fallan los 3 intentos la ejecución falla con «CanadaBuys no responde» y el último error.
- No se reintentan y la ejecución falla de inmediato: el fichero llega con menos de 2 filas (vacío) o falta la columna `referenceNumber` (formato cambiado).
- Si se alcanza el gasto máximo por ejecución, el Actor para y conserva lo ya guardado.
- Una búsqueda sin coincidencias termina bien con el dataset vacío.

#### Precios (pago por evento)

Aviso devuelto (`tender-notice`): $0.003 ($3.00 por cada 1.000). Pagas por cada aviso devuelto y puedes fijar un gasto máximo por ejecución.

#### Integraciones (Make, Zapier, Google Sheets)

- **Make**: módulo de Apify «Run an Actor» (`Flets_sv/canadabuys-tenders`), pega el input y encadena «Get Dataset Items» hacia Sheets, Slack o tu CRM.
- **Zapier**: «Run Actor» y «Fetch Dataset Items» con un disparador de horario.
- **Google Sheets**: integración oficial en la pestaña Integrations, o Apps Script con `UrlFetchApp` contra `run-sync-get-dataset-items?format=csv`.
- **API y webhooks**: lanza el Actor por REST, programa ejecuciones y avisa con un webhook al terminar.

El Actor no tiene modo «solo nuevos»: una ejecución programada vuelve a devolver los avisos que siguen cumpliendo el filtro. Deduplica por `referencia` en tu herramienta.

#### Preguntas frecuentes

**¿Necesito clave?** No, es un fichero público de datos abiertos.

**¿Incluye licitaciones provinciales?** No, solo los avisos de ese fichero de CanadaBuys.

**¿Dónde están los contactos?** Se omiten a propósito; abre el enlace del aviso para ver lo que se publica allí.

### Related Actors / Actores relacionados

Public tenders family by Flets_sv / Familia de licitaciones:

- [EU tenders (TED)](https://apify.com/flets_sv/ted-eu-tenders): above-threshold tenders of all EU countries.
- [Spain tenders (PLACSP)](https://apify.com/flets_sv/licitaciones-placsp): Spanish national and regional public tenders.
- [UK public tenders](https://apify.com/flets_sv/uk-public-tenders): Find a Tender and Contracts Finder.
- [France tenders (BOAMP)](https://apify.com/flets_sv/boamp-france-tenders): French marchés publics.
- [Australia government contracts (AusTender)](https://apify.com/flets_sv/austender-australia-contracts): federal contracts awarded.

### Also by the same author

Tracking Europe too? **[Public Tenders API: Spain, EU & UK](https://apify.com/flets_sv/public-tenders-spain-eu-uk)** puts Spanish, EU and UK tenders into one JSON format with a daily new-only alert mode. It does not cover Canada or Australia; use this Actor for those.

# Actor input Schema

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

All words must appear in the title (English or French), the description excerpt (first 600 characters) or the UNSPSC description. Ignores case and accents. Empty returns everything that matches the other filters.

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

Nature of the requirement.

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

Part of the buyer name, e.g. "National Defence", "Health Canada", "PSPC". Empty for all buyers.

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

Compared with the status text of the output language (see Output language), ignoring case and accents. With French output the English value Open will not match.

## `diasAtras` (type: `integer`):

Only notices published in this window (1 to 3650). Notices without a publication date are not filtered out by it.

## `soloAbiertos` (type: `boolean`):

Skip notices whose closing date has already passed. Notices without a closing date are kept.

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

Language of title, description and buyer fields. The other language title is always kept in tituloAlternativo.

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

Maximum number of notices returned (1 to 5000), newest publication date first. At the default price it caps the run at about 0.03 USD for 10 notices.

## Actor input object example

```json
{
  "palabrasClave": "software",
  "categoria": "any",
  "entidad": "",
  "estado": "any",
  "diasAtras": 90,
  "soloAbiertos": true,
  "idioma": "en",
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "palabrasClave": "software",
    "diasAtras": 90,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("flets_sv/canadabuys-tenders").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 = {
    "palabrasClave": "software",
    "diasAtras": 90,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("flets_sv/canadabuys-tenders").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 '{
  "palabrasClave": "software",
  "diasAtras": 90,
  "maxItems": 10
}' |
apify call flets_sv/canadabuys-tenders --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,flets_sv/canadabuys-tenders"
        }
    }
}
```

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/VPfK0C9EC1DtaDBap/builds/fnOAwv0Ox3iA8LJDb/openapi.json
