# Canada LMIA Employers Scraper: Positive LMIA List (`kizukidata/canada-lmia-employers`) Actor

Extract Canada's Positive LMIA employer list (ESDC open data) by quarter, province, stream, and NOC code, largest approvals first (2016-present). Track added or removed employers between quarters. No job ads or contacts. Not affiliated with ESDC.

- **URL**: https://apify.com/kizukidata/canada-lmia-employers.md
- **Developed by:** [Kizuki](https://apify.com/kizukidata) (community)
- **Categories:** Jobs, 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

from $0.43 / 1,000 results

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 does Canada LMIA Employers do?

Extract Canada's Positive LMIA employer list (ESDC TFWP open data on `open.canada.ca`) by quarter (`2017Q3` through the latest quarter, plus the `2016` and `2017` January-June files), province, program stream (High Wage, Low Wage, Global Talent Stream, Primary Agriculture), and NOC occupation code, sorted by approved worker positions.

Use `mode: "changes"` to compare two quarters and track added or removed employers (with optional multi-quarter `lookbackQuarters`). Empty input (`{}`) returns the largest approvals from the latest published quarter.

### What data can you get?

Every row has:

| Field | Description |
|---|---|
| `id` | Stable ID of the row (a hash of the values below) |
| `quarter` | Quarter of the row, for example `2026Q2` |
| `province`, `provinceCode` | Province or territory as published, and the two-letter code from the address |
| `city`, `postalCode` | Place and postal code taken from the address (`null` when the address does not give one) |
| `programStream` | Program stream, for example `High Wage`, `Low Wage`, `Primary Agriculture` |
| `employer`, `address` | Employer name and business location as published |
| `occupation` | NOC code and title as published, for example `72310-Carpenters`; `null` when the file marks it `(blank)` |
| `nocCode`, `occupationTitle` | The code and the title split out of `occupation` |
| `nocVersion` | `2011` or `2021`: the NOC version the file is published against |
| `incorporateStatus` | Incorporate status; `null` for files without that column |
| `approvedLmias` | Approved LMIAs in the row; `null` for files without that column |
| `approvedPositions` | Approved positions in the row |
| `sourceLanguage`, `sourceUrl`, `sourceUpdatedAt` | The file the row was read from (English), its URL, and when the publisher last changed it |
| `scrapedAt` | When this run read the file |
| `source` | Always `canada-lmia` |

Every row has every field; a value the source does not give is `null`.

With `mode: "changes"` each row is an employer change instead:

| Field | Description |
|---|---|
| `changeType` | `added` or `removed` |
| `employer`, `employerKey` | The name as published, and the normalised name used to compare quarters |
| `quarter` | `{ "before": ..., "now": ... }`: the two quarters compared |
| `provinces`, `provinceCodes`, `programStreams`, `occupations` | `{ "before": [...], "now": [...] }` lists for the employer |
| `positions`, `approvedLmias`, `rows` | `{ "before": ..., "now": ... }` totals for the employer |
| `sourceUpdatedAt` | `{ "before": ..., "now": ... }` file versions |
| `scrapedAt` | When this run read the files |

### How to use Canada LMIA Employers

1. Leave **Quarters** empty for the latest published quarter, or name quarters as `2026Q2` (up to 8; they are read newest first, and the rows returned are ordered by approved positions).
2. Optionally add **Province or territory** (`Ontario`, `QC`; a city name also matches), **Program stream** (`High Wage`), **NOC code or occupation** (`72310`, `Carpenters`) and **Employer name** words.
3. Set **Maximum results** and run the Actor.

#### Input example

```json
{
    "quarters": ["2026Q2"],
    "provinces": ["Ontario"],
    "programs": ["High Wage"],
    "noc": ["21231"],
    "maxItems": 100
}
```

#### Output example

The largest row of the default output for 2026Q2 (276 approved positions), taken from a real run.

```json
{
    "id": "cb2a87da748c7793d1b0db7b",
    "source": "canada-lmia",
    "quarter": "2026Q2",
    "province": "Quebec",
    "provinceCode": "QC",
    "city": "Mont-Laurier",
    "postalCode": "J9L 3G5",
    "programStream": "Primary Agriculture",
    "employer": "Les Entreprises Pitre Inc.",
    "address": "Mont-Laurier, QC J9L 3G5",
    "occupation": "85101-Harvesting labourers",
    "nocCode": "85101",
    "occupationTitle": "Harvesting labourers",
    "nocVersion": "2021",
    "incorporateStatus": "Sole Proprietorship",
    "approvedLmias": 5,
    "approvedPositions": 276,
    "sourceLanguage": "en",
    "sourceUrl": "https://open.canada.ca/data/dataset/90fed587-1364-4f33-a9ee-208181dc0b97/resource/2b94f80d-fa27-4d2e-9b90-6f67fe69bf50/download/tfwp_2026q2_pos_en.xlsx",
    "sourceUpdatedAt": "2026-10-30T14:09:46.933Z",
    "scrapedAt": "2026-11-05T09:00:00.000Z"
}
```

### Filter rows

All filters run **in memory after the file is read**: they add no request, and **you pay only for the rows that match**.

- **Quarters** (`quarters`): the published quarter files to read, one download each, one at a time. A quarter outside the offered periods (2016, 2017Q1Q2, and 2017Q3 onwards), or a typo, is listed in `OUTPUT` `skippedInputs` and the other quarters still run.
- **Province or territory** (`provinces`): matches the province name, a two-letter code, or a city in the address.
- **Program stream** (`programs`): matches words in the stream; case, spaces and hyphens do not matter (`high-wage` matches `High Wage`).
- **NOC code or occupation** (`noc`): a number matches the **start** of the NOC code (`72` keeps 72310 and 72410); a word or phrase matches the occupation title.
- **Employer name** (`employers`): words in the employer name.

Every field takes a list of up to 20 entries; empty means no filter.

### Changes mode (`mode: "changes"`)

Set `mode` to `"changes"` to compare two quarters of the employer list:

1. Name both quarters in `quarters` (they are put in chronological order). Or name one quarter to compare it with the **previous published quarter**. Or leave `quarters` empty for the **latest two**.
2. The Actor downloads two files (one at a time), aggregates each employer's rows in each quarter and returns:
   - `added`: the employer is in the later quarter and not in the earlier one;
   - `removed`: the employer is in the earlier quarter and not in the later one.
3. Each returned employer is one dataset row (one charged result). Added employers come first, then removed ones; inside each group the employer with the most approved positions comes first (the later quarter's positions for added, the earlier quarter's for removed), so a run capped by `maxItems` keeps the largest changes.
4. The other filters apply to the change rows: an employer kept by `provinces`, `programs`, `noc` or `employers` is returned.

Employers are matched by name, **not by a registry ID** (the list has none): accents, case, punctuation and trailing words such as `Ltd`, `Limited`, `Inc`, `Corp`, `Ltée`, `ULC`, `LP`, `LLP` are ignored, so `X Ltd` and `X Limited` are the same employer. Two different companies with the same core name would read as one; the aggregated provinces and occupations are there to check.

Only additions and removals are reported. The counts of an employer that is in both quarters are not a "change" of the list and are not returned; read the employer's rows in each quarter for that.

#### New in the last N periods (`lookbackQuarters`)

By default an employer counts as `added` if it is in the later quarter and not in the earlier one, so an employer that was absent for one quarter and came back reads as new. Set **Look back (quarters)** (`lookbackQuarters`, 1 to 8, default 1) to require the employer to be absent from that many earlier periods:

- `lookbackQuarters: 4` reports an employer as `added` only if it is in none of the four periods before the later quarter.
- Each extra period is **one more file download**, one at a time: the default run reads two files, `lookbackQuarters: 4` reads five.
- `removed` is always against the most recent earlier quarter, whatever the lookback.
- The periods read for the lookback are named in `OUTPUT` `canadaLmia.lookbackPeriods`.

#### Changes example

```json
{
    "mode": "changes",
    "quarters": ["2026Q1", "2026Q2"],
    "provinces": ["Ontario"],
    "maxItems": 500
}
```

#### Change output example

Values below are illustrative.

```json
{
    "id": "3c1e0e9f5a2b7d6480f1c2a9",
    "source": "canada-lmia",
    "changeType": "removed",
    "employer": "Old Mill Bakery Ltd",
    "employerKey": "old mill bakery",
    "quarter": { "before": "2026Q1", "now": "2026Q2" },
    "provinces": { "before": ["Ontario"], "now": [] },
    "provinceCodes": { "before": ["ON"], "now": [] },
    "programStreams": { "before": ["High Wage"], "now": [] },
    "occupations": { "before": ["6332-Bakers"], "now": [] },
    "positions": { "before": 2, "now": 0 },
    "approvedLmias": { "before": 1, "now": 0 },
    "rows": { "before": 1, "now": 0 },
    "sourceUpdatedAt": { "before": "2026-07-21T21:11:40.257Z", "now": "2026-10-30T14:09:46.933Z" },
    "scrapedAt": "2026-11-05T09:00:00.000Z"
}
```

The same idea as the `registerChanges` mode of **UK Visa Sponsor Jobs**: added and removed entries, with the value before and now. This Actor does not need a saved baseline for it, because both quarter files are public and are named in the input; so it keeps no state, and two runs with the same input return the same answer.

### How much does it cost?

Canada LMIA Employers uses **pay-per-event** pricing: you pay for the rows it returns, not for the time it runs. At the Free tier 1,000 rows cost $0.65; at Business (Gold), $0.43.

| Apify plan (discount tier) | Price per 1,000 rows | Price per row |
|---|---|---|
| **Free** | $0.65 | $0.00065 |
| **Starter (Bronze)** | $0.58 | $0.00058 |
| **Scale (Silver)** | $0.51 | $0.00051 |
| **Business (Gold)** | $0.43 | $0.00043 |

Apify's Free plan includes USD 5 of monthly usage, which covers about 7,692 rows at the Free tier price, run start fees aside.

| Event | Unit |
|---|---|
| `apify-default-dataset-item` | one row returned (one employer row, or one employer change) |

- **Run start fee**: USD 0.00005 per GB of memory per run (a run with up to 1 GB is charged once).
- Rows removed by the filters are **not charged**.
- A run that returns no rows (no match, or no change between the quarters) is **not charged** for rows.
- A quarter file that could not be read, a quarter that is not published, and rows that were not returned are **not charged**.
- **Maximum results** and the run's maximum cost cap the charge.

### How results are limited

- **Maximum results** (`maxItems`, default 20) caps each run. Rows are ordered by `approvedPositions` (largest first), then by employer name, address and occupation; quarters are read newest first. With several quarters the largest approvals come first, whichever quarter they are from.
- One request lists the dataset (the catalogue), then one request per quarter file, one at a time. The 2026Q2 English file is about 450 KB of XLSX with about 7,300 rows; the CSV files of earlier quarters are about 1 MB.
- A file above 30 MB is refused as a source change instead of being read into memory.

### Use it from AI agents (MCP)

Canada LMIA Employers works as a tool for AI agents such as Claude, Cursor and n8n agents through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Load this Actor, plus the tool that reads its input schema and pricing, with this server URL:

```text
https://mcp.apify.com?tools=fetch-actor-details,kizukidata/canada-lmia-employers
```

- **Claude Code**: run `claude mcp add apify "https://mcp.apify.com?tools=fetch-actor-details,kizukidata/canada-lmia-employers" -t http`.
- **Claude (web or desktop app)**: open **Customize → Connectors**, choose **Add custom connector**, name it `Apify` and paste the server URL above.
- **Cursor**: add the server to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```json
{
    "mcpServers": {
        "apify": { "url": "https://mcp.apify.com?tools=fetch-actor-details,kizukidata/canada-lmia-employers" }
    }
}
```

- **n8n**: add the Apify node (on self-hosted n8n, install the community package `@apify/n8n-nodes-apify`) and choose **Run an Actor and get dataset**; for an n8n AI Agent, add **Apify Tool** as a tool.

The server signs you in to Apify with OAuth. A client that cannot use OAuth can send your Apify API token in an `Authorization: Bearer <APIFY_TOKEN>` header instead.

#### What to send from an agent

Calling it with **no arguments** (`{}`) reads the latest published quarter and returns the 20 rows with the largest approvals. Pass `quarters`, `provinces`, `programs`, `noc`, `employers` and `maxItems` as needed, or `mode: "changes"` to compare two quarters. When a run returns nothing, the run's status message says why; the `OUTPUT` record lists skipped quarters and the counts.

### Integrations and API

Run the Actor from your own code or from an automation tool. Replace `<APIFY_TOKEN>` with your API token.

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/kizukidata~canada-lmia-employers/runs?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"quarters":["2026Q2"],"provinces":["Ontario"],"maxItems":100}'
```

Poll `GET https://api.apify.com/v2/actor-runs/<RUN_ID>` for the status, read `defaultDatasetId`, then fetch `GET https://api.apify.com/v2/datasets/<DATASET_ID>/items?format=json`.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("kizukidata/canada-lmia-employers").call(run_input={"quarters": ["2026Q2"], "provinces": ["Ontario"], "maxItems": 100})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["employer"], item["approvedPositions"])
```

#### JavaScript

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

const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('kizukidata/canada-lmia-employers').call({ quarters: ['2026Q2'], provinces: ['Ontario'], maxItems: 100 });
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Zapier, Make and n8n

Use the Apify integration, choose **Run Actor**, and map `quarters`, `provinces`, `programs`, `noc`, `employers`, `mode` and `maxItems`. Add **Get dataset items** and map the flat fields (`employer`, `province`, `programStream`, `occupation`, `approvedPositions`, `quarter`) to your CRM, spreadsheet or alert. A quarterly schedule with `mode: "changes"` gives the added and removed employers as the trigger.

#### LangChain

Load the rows as documents: put `employer`, `occupation` and `address` in `page_content` and the counts, province, NOC and quarter in `metadata`. `ApifyDatasetLoader` from the Apify LangChain integration can read the run's dataset ID directly.

#### MCP

See [Use it from AI agents (MCP)](#use-it-from-ai-agents-mcp). The Actor's input schema is the tool schema an MCP client sees.

### Run status and the OUTPUT record

Each run writes an `OUTPUT` record with the counts, `skippedInputs` (quarters the dataset does not publish, with the reason) and a `canadaLmia` record:

- mode `employers`: the quarters read, the rows read / matched / returned, and when the publisher last changed each file;
- mode `changes`: the two quarters compared, the employers added and removed, the rows read in each quarter, and the file versions.

If a quarter file cannot be read (a changed header, a moved file, a block), the run **fails** and returns no rows rather than returning a partial answer as if it were complete.

### Limitations

- **Independent tool.** Canada LMIA Employers is **not affiliated with, endorsed by or sponsored by** ESDC, the Government of Canada or open.canada.ca; their names are used only to say where the data comes from. An LMIA approval does not mean a job is open now, unfilled, or that a work permit will be issued; this is **not legal or immigration advice**.
- **Periods start at 2016.** The 2016 file and the 2017 January-June file have the same flat header as the quarterly files, except that 2016 has no program-stream column, and are offered as `2016` and `2017Q1Q2` (so `programStream` is `null` for 2016). The 2014 and 2015 files have a different shape (province section headings, columns Employer/Address/Positions only, no occupation) and are not offered.
- **Columns differ by year**: the 2020Q4 file has six columns; the 2021Q4 file has eight, adding `Incorporate Status` and `Approved LMIAs` (the change happened between those two quarters). A column a file does not have is `null` in the rows, never invented.
- **NOC version changes**: files say NOC 2011 up to 2024Q1 and NOC 2021 from 2024Q2 (the resource name says which). Codes are not translated between versions; `nocVersion` tells you which one a row uses.
- **5,000 rows per run.** `maxItems` goes up to 5,000, and one quarter can have more rows than one run returns (2026Q2 has 7,344). To get every row of a quarter, split it across runs by program stream, or by province plus one run with `Head Office outside of Canada` in `provinces` (the category described below). In the province split a head-office row can also match the province of its address, so drop duplicates by `id`.
- Rows are as published: one row is one employer × occupation × province × program stream, with the counts the publisher gives. The Actor does not merge rows across occupations or quarters (except in mode `changes`, where an employer's rows are aggregated per quarter).
- The files write `(blank)` where an occupation is missing; `occupation`, `nocCode` and `occupationTitle` are `null` for those rows. Some rows have an occupation but no NOC code; the title is kept and `nocCode` is `null`.
- A few values in the province column are not provinces: the file has a category "Employers carrying on business in Canada with Head Office outside of Canada". It is returned as published, so `province` carries that text and `provinceCode` is taken from the address.
- The French files are not read. They have the same rows but some accented characters are missing in the published file (`Nouvelle- cosse`); the English file is used instead.
- The publisher removes personal names before publication; this Actor does not add any and does not collect contact details.
- The 2017Q3-2020Q3 CSV files are **Windows-1252**, not UTF-8 (the later XLSX files are UTF-8). The Actor reads UTF-8 first and falls back to Windows-1252, so accented names (`Société`, `Ltée`) are kept and match across quarters and formats.
- **No Job Bank data.** This Actor does not read Job Bank postings and does not combine them with this list.

### Where the data comes from

- **Positive LMIA employers list**: Employment and Social Development Canada, published on open.canada.ca as *Temporary Foreign Worker Program (TFWP): Positive Labour Market Impact Assessment (LMIA) Employers List* (<https://open.canada.ca/data/en/dataset/90fed587-1364-4f33-a9ee-208181dc0b97>).
- The Actor reads the dataset's catalogue through the open data catalogue API and then the English file of each quarter you name. The French files (`-fr`) have the same rows and are not read.
- **Licence**: Open Government Licence - Canada. Contains information licensed under the Open Government Licence - Canada. <https://open.canada.ca/en/open-government-licence-canada>
- **Updates**: a quarter is published some months after it ends (2026Q2 was published on 2026-10-30; 2026Q1 on 2026-07-21; 2025Q4 on 2026-03-16). The catalogue's `last_modified` is reported per file as `sourceUpdatedAt`; a published quarter can be revised.
- The Actor does not log in, does not use residential proxies, and sends one request at a time.

### Corrections

If a row looks wrong, it is most likely how ESDC published it. Check the quarter file linked in `sourceUrl` first. If the Actor read the file wrongly (a column shift, a broken quarter), open an Issue on this Actor's Issues tab with the quarter and the `id` of the row.

### Related Kizuki Actors

Other Actors from Kizuki that work well with this one:

- [UK Visa Sponsor Jobs](https://apify.com/kizukidata/uk-visa-sponsor-jobs) — the UK register of licensed sponsors, with the same added/removed change mode.
- [LinkedIn Company Scraper](https://apify.com/kizukidata/linkedin-company-monitor) — the employer behind an approved LMIA: size, industry, followers and what changed.
- [LinkedIn Jobs Scraper](https://apify.com/kizukidata/linkedin-jobs-feed) — the jobs those employers post, with pay and seniority.
- [ATS Job Scraper](https://apify.com/kizukidata/ats-jobs) — the jobs those employers post on their own boards, across six ATS, with the published pay range and yearly pay.

### FAQ

#### Why is a quarter missing?

The dataset publishes 2017Q3 onwards as quarters; the 2016 file and the 2017 January-June file are offered as `2016` and `2017Q1Q2`. The 2014 and 2015 files have a different shape and are not part of this Actor. A quarter that is not in the catalogue yet (the next one is usually published a few months after it ends) is listed in `skippedInputs`.

#### Why do some rows have `null` for `approvedLmias` or `incorporateStatus`?

Those columns were added to the published files at some point (the 2020Q4 file has six columns; the 2021Q4 file has eight). The Actor reports `null` for a column the file does not have; it does not guess a zero.

#### What does `added` in changes mode mean?

The employer was in the later quarter's list and not in the earlier one. That includes a company that changed its legal name (it reads as one removed and one added). The list is by employer name, and the dataset has no company ID.

#### Is this legal or immigration advice?

No. The list is public data about past LMIA decisions. It does not tell you whether a job is available, whether a work permit will be issued, or what a job pays. Check IRCC's requirements and the employer.

#### Is it legal to use this data?

The list is published by ESDC on open.canada.ca under the Open Government Licence - Canada, which allows reuse, including commercial reuse, with attribution. How you use the data is your responsibility; this is not legal advice.

# Actor input Schema

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

"employers" (default): one row per employer, occupation, province, and stream. "changes": added/removed employers between 2 quarters (empty = latest 2).

## `quarters` (type: `array`):

Up to 8 quarters as YYYYQ# (e.g. \["2026Q1", "2026Q2"], 2017Q3-present, plus 2017Q1Q2 and 2016). Empty uses latest (or latest 2 in changes mode).

## `provinces` (type: `array`):

Up to 20 province/territory names, 2-letter codes (e.g. \["Ontario", "QC"]), or cities (matched against address). Empty keeps all.

## `programs` (type: `array`):

Up to 20 stream keywords (e.g. \["High Wage"], \["Primary Agriculture"]). Case/hyphen-insensitive. Empty keeps all streams.

## `noc` (type: `array`):

Up to 20 NOC code prefixes (e.g. "72" matches 72310) or occupation keywords (e.g. "Carpenters"). Empty keeps all occupations.

## `employers` (type: `array`):

Keep rows whose employer name contains one of these words or phrases, not case-sensitive. Up to 20 entries. Empty keeps every employer.

## `lookbackQuarters` (type: `integer`):

changes mode only: earlier periods an employer must be absent from to count as added (default 1, up to 8; each extra period downloads 1 file).

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

Max rows per run (1-5000, default 20), sorted by approved positions descending then employer name. Each returned row is charged.

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

Proxy settings. The default uses no proxy, which works for these public files. Residential proxies are not available.

## Actor input object example

```json
{
  "mode": "employers",
  "quarters": [
    "2026Q2"
  ],
  "provinces": [
    "Ontario"
  ],
  "programs": [
    "High Wage"
  ],
  "noc": [
    "72310",
    "Carpenters"
  ],
  "employers": [
    "Fisheries"
  ],
  "lookbackQuarters": 4,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

The LMIA employer rows, or (mode changes) the employers that appeared or disappeared between two quarters.

## `runSummary` (type: `string`):

Status code, counters, skipped entries, and the canadaLmia record of this run (quarters, counts, file versions).

# 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": "employers",
    "lookbackQuarters": 1,
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kizukidata/canada-lmia-employers").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": "employers",
    "lookbackQuarters": 1,
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kizukidata/canada-lmia-employers").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 '{
  "mode": "employers",
  "lookbackQuarters": 1,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kizukidata/canada-lmia-employers --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kizukidata/canada-lmia-employers"
        }
    }
}
```

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/TF0C0eVcGAPAq1QA6/builds/KxRdEhHPvBiCfXzvw/openapi.json
