# Morocco Emploi.ma Jobs Monitor (`mohamedbr/my-actor`) Actor

Watches Emploi.ma and reports only NEW Morocco job offers: company, role, city and contract type — never the same offer twice. For job boards, recruiters and hiring-market watchers. Part of Mohamed Bourim's 12 MENA monitors on Apify.

- **URL**: https://apify.com/mohamedbr/my-actor.md
- **Developed by:** [Mohamed Bourim](https://apify.com/mohamedbr) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 12.5% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 job offers

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

## Morocco Emploi.ma Jobs Monitor

**Every fresh job offer from Emploi.ma — one of Morocco's largest job boards — as clean structured data.** Employers across Morocco post their openings on Emploi.ma (25 offers per page, 26 pages at first capture), and this Actor collects them all: title, company, region, education level, experience, contract type and key skills from every card, then enriches each record from its own detail page with the sector, city, number of positions, the full description — and the **salary range when the employer publishes one** («12 000 - 15 000 DH»), a field most Moroccan job boards never show.

Every record is keyed by the portal's own offer ID, and each detail page is verified against the list identity before merging — a mismatched page is never merged. Where a card and its detail page disagree, the detail page's values win. Employers the portal hides stay hidden: records for confidential offers carry no invented company name.

### What you get

One record per published offer (newest first):

| Field | Description |
|---|---|
| `offerId` | The portal's own numeric offer ID — the record identity, e.g. `9678755` |
| `title` | Job title as published, e.g. `Ingénieur Qualité Process et Projet - Berrechid` |
| `company` | Employer as published, e.g. `King Pélagique Groupe` (`null` when the portal hides it) |
| `city` | City as published, e.g. `Berrechid` |
| `region` | Region as published, e.g. `Casablanca-Mohammedia` |
| `sector` | Job sector as published, e.g. `Equip. électriques, électroniques, optiques, précision` |
| `contractType` | As published, e.g. `CDI`, `CDD` |
| `educationLevel` | Required education as published, e.g. `Bac+5 et plus` |
| `experience` | Required experience as published, e.g. `Expérience entre 2 ans et 5 ans` |
| `salaryText` | The published salary range, verbatim, e.g. `12 000 - 15 000 DH` (`null` when none is published) |
| `skills` | Key skills as published, e.g. `AMDEC - Amélioration Continue - …` |
| `positionsCount` | Number of open positions when the offer states it |
| `publishedDate` | Publication date, ISO format |
| `descriptionText` | The full poste + profile description from the detail page |
| `offerUrl` | The official detail page the record was read from |
| `source` | Always `emploi.ma` |
| `firstSeenAt` | Monitor mode only: when this offer was first emitted as new |

### Monitor mode

Set **onlyNew** and the Actor returns only offers that are new since your last run with the same filters — the baseline is kept per filter set in a persistent store, a failed run never marks offers as seen, and every successful run refreshes the baseline (even a plain sweep). The first monitor run for a filter set only establishes the baseline and returns nothing, so a new schedule never floods you with the portal's backlog. Schedule it daily and you have a live feed of Moroccan hiring in your sector or region.

### Inputs

| Input | Description |
|---|---|
| `keyword` | Only offers whose job title contains this text |
| `region` | Only offers whose region or city contains this text (e.g. `Casablanca`, `Dakhla`, `Tanger`) |
| `maxResults` | Maximum offers to return (newest first, default 100; the console pre-fills 10 so a first test run finishes fast — raise it for a full sweep) |
| `onlyNew` | Monitor mode: only offers new since your last run |
| `includeDetails` | Enrich from detail pages (default on; turn off for a fast list-only sweep) |

### Network note — residential proxy

Emploi.ma blocks Apify's datacenter egress IPs (HTTP 403), so this
Actor routes its requests through **Apify Residential Proxy** by
default (`useResidentialProxy`, Moroccan exit `proxyCountry=MA`, one
sticky session per run). The WAF's block is per-IP: if the session's
IP is blocked (403) before any fetch succeeds, the run rotates to a
fresh sticky session — at most 3 sessions per run — and a session
that works is kept for the whole run. Apify bills residential traffic separately
($8/GB on the Free plan): a 100-offer run transfers ~8 MB (~$0.07 of
proxy traffic); a full ~650-offer sweep ~55 MB (~$0.45). Turning the
proxy off only makes sense outside Apify's datacenter egress.

### Pricing

Pay per event: **$0.05 per run start + $0.02 per job offer record** ($20 / 1,000 records). Platform usage is included.

# Actor input Schema

## `includeDetails` (type: `boolean`):

Fetch each offer's detail page for sector, city, salary range, positions and the full description (identity verified against the list record before merging; detail values win over card values).

## `keyword` (type: `string`):

Only offers whose job title contains this text (e.g. Comptable, Ingénieur). Empty = all.

## `maxResults` (type: `integer`):

Maximum number of offers to return (newest first, 1-5000). Prefilled with 10 so a first run finishes fast; the default for API runs is 100.

## `onlyNew` (type: `boolean`):

Return only offers not seen in previous runs with the same filters. The first monitor run with a given filter set only establishes the baseline and returns nothing.

## `proxyCountry` (type: `string`):

Two-letter country for the residential proxy exit. MA (Morocco) is recommended for this Moroccan portal. Empty = any country.

## `region` (type: `string`):

Only offers whose region or city contains this text (e.g. Casablanca, Dakhla, Tanger). Empty = all.

## `useResidentialProxy` (type: `boolean`):

Route requests through Apify Residential Proxy. Required on Apify: emploi.ma blocks the platform's datacenter egress IPs (HTTP 403). Residential traffic is billed by Apify at $8/GB on the Free plan — a full ~650-offer scan transfers ~55 MB (~$0.45); a 100-offer run ~$0.07.

## Actor input object example

```json
{
  "includeDetails": true,
  "keyword": "",
  "maxResults": 10,
  "onlyNew": false,
  "proxyCountry": "MA",
  "region": "",
  "useResidentialProxy": true
}
```

# Actor output Schema

## `offers` (type: `string`):

Structured job offer records (title, company, city, region, sector, contract, education, experience, salary, skills, 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 = {
    "includeDetails": true,
    "keyword": "",
    "maxResults": 10,
    "onlyNew": false,
    "proxyCountry": "MA",
    "region": "",
    "useResidentialProxy": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohamedbr/my-actor").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 = {
    "includeDetails": True,
    "keyword": "",
    "maxResults": 10,
    "onlyNew": False,
    "proxyCountry": "MA",
    "region": "",
    "useResidentialProxy": True,
}

# Run the Actor and wait for it to finish
run = client.actor("mohamedbr/my-actor").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 '{
  "includeDetails": true,
  "keyword": "",
  "maxResults": 10,
  "onlyNew": false,
  "proxyCountry": "MA",
  "region": "",
  "useResidentialProxy": true
}' |
apify call mohamedbr/my-actor --silent --output-dataset

```

## MCP server setup

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

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/nQi89dDGWDSozRa7o/builds/tJeLfFrLecFOlj79d/openapi.json
