# Morocco Procurement Awards Monitor (`mohamedbr/my-actor-8`) Actor

Watches Morocco's public procurement portal and reports only NEW contract awards: winning company, awarded amount TTC and buyer — never the same award twice. For suppliers tracking Moroccan public contracts. Part of Mohamed Bourim's 12 MENA monitors on Apify.

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

## Pricing

from $20.00 / 1,000 award records

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 Procurement Awards Monitor — Bons de Commande Results (نتائج أوامر الشراء)

**Who won Morocco's public purchase orders, and for how much?** This Actor collects **award results** for *bons de commande* (purchase orders) from Morocco's official procurement portal [marchespublics.gov.ma](https://www.marchespublics.gov.ma) — the winning company, the awarded amount (**Montant TTC**), the number of competing quotes, the buyer and the exact result publication date — as a clean, machine-readable dataset.

Other Morocco tender tools sell the *open* tender list. Award amounts are the data the market actually pays for — the leading local aggregator hides them behind a membership paywall. Here they are a dataset field, sourced from the official portal, whose records are the authoritative ones.

### What you get

One record per published award result (338,000+ results published since 2023, newest first):

| Field | Description |
|---|---|
| `awardId` | Stable identity of the result (hash of reference, buyer, result date, object) |
| `reference` | Purchase-order reference, e.g. `62/2026` |
| `object` | What was purchased |
| `buyer` | Public buyer, e.g. `ECOLE NORMALE SUPERIEURE MARRAKECH` |
| `outcome` | `awarded` or `infructueux` (unsuccessful — a first-class result, not a gap) |
| `resultPublishedAt` | When the result was published on the portal (ISO datetime) |
| `quotesReceived` | Number of competing quotes received — a competition-intensity signal nobody else publishes |
| `winner` | Winning company (`entreprise attributaire`), or `null` when unpublished/infructueux |
| `amountTTC` | Awarded amount, taxes included, exactly as published (MAD); `null` when not published — never zero-filled |
| `currency` | `MAD` |
| `sourceUrl` | The official results listing this record was read from |

### Monitor mode

Set **onlyNew** and the Actor returns only awards 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 awards as seen, and every successful run refreshes the baseline (even a plain sweep). Schedule it daily and you have a live feed of who is winning Moroccan public money in your sector.

### Inputs

| Input | Description |
|---|---|
| `maxResults` | How many of the newest results to fetch (1–5000, default 50) |
| `onlyNew` | Monitor mode: only awards not seen in previous runs with the same filters |
| `buyerKeyword` | Only buyers whose name contains this text |
| `keyword` | Only objects containing this word/phrase |
| `outcome` | `all`, `awarded` or `infructueux` |

### Notes

- **Source**: official portal only (`marchespublics.gov.ma`, BDC results listing). Amounts are republished exactly as printed — TTC, in dirhams.
- **Portal hours**: the portal operates roughly **07:30–24:00 Morocco time**. Runs outside the window fail cleanly with an error instead of returning partial data — schedule inside the window.
- A result whose winner or amount was not published carries `null` for those fields; an *infructueux* result is reported as its own outcome, never dropped.

### Pricing

Pay per event: **$0.05 per run + $0.02 per award record** ($20 / 1,000 records). Platform usage is free.

***

*Built by Mohamed Bourim — Gulf & MENA public-procurement data tools: Saudi Etimad tenders, Qatar Monaqasat tenders, and now Moroccan award results.*

# Actor input Schema

## `buyerKeyword` (type: `string`):

Full or partial buyer name, e.g. "ONEE" or "Commune". Empty = all buyers.

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

Word or phrase that must appear in the purchase object, e.g. "informatique". Empty = all objects.

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

Maximum number of award records to fetch in this run (1–5000).

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

Return only awards not seen in previous runs with the same filters. State is kept per filter set; a failed run never marks awards as seen.

## `outcome` (type: `string`):

Award outcome: all results, only awarded, or only infructueux (unsuccessful).

## Actor input object example

```json
{
  "buyerKeyword": "",
  "keyword": "",
  "maxResults": 50,
  "onlyNew": false,
  "outcome": "all"
}
```

# Actor output Schema

## `awards` (type: `string`):

Structured award records (winner, amount TTC, quotes received, buyer, result date).

# 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 = {
    "buyerKeyword": "",
    "keyword": "",
    "maxResults": 50,
    "onlyNew": false,
    "outcome": "all"
};

// Run the Actor and wait for it to finish
const run = await client.actor("mohamedbr/my-actor-8").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 = {
    "buyerKeyword": "",
    "keyword": "",
    "maxResults": 50,
    "onlyNew": False,
    "outcome": "all",
}

# Run the Actor and wait for it to finish
run = client.actor("mohamedbr/my-actor-8").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 '{
  "buyerKeyword": "",
  "keyword": "",
  "maxResults": 50,
  "onlyNew": false,
  "outcome": "all"
}' |
apify call mohamedbr/my-actor-8 --silent --output-dataset

```

## MCP server setup

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

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/orYaMeRsEhrmWyIyY/builds/lrsrsw2VnqiDRbqEb/openapi.json
