# MarocAnnonces Morocco Classifieds

> Search MarocAnnonces.com, Morocco's general classifieds site: job offers and CVs, used cars, apartments and villas for sale or rent, phones, computers, household goods and services. Free text plus the site's own filters: category, city, price range, photos only; for used cars make, year, mileage and fuel; for apartments bedrooms, bathrooms and surface. Nothing is required: no parameters browses the whole site newest first.
> ReefAPI engine `marocannonces` · 4 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/marocannonces/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed calls are free except verified SHEIN NOT_FOUND on product/detail and price (4 credits).
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http). Send the key as `Authorization: Bearer <key>`, or put it in the URL (`?key=<key>`) when the client has no header field, as ChatGPT does.

## Endpoints

### POST https://api.reefapi.com/marocannonces/v1/search — 2 credits
Search MarocAnnonces.com, Morocco's general classifieds site: job offers and CVs, used cars, apartments and villas for sale or rent, phones, computers, household goods and services. Free text plus the site's own filters: category, city, price range, photos only; for used cars make, year, mileage and fuel; for apartments bedrooms, bathrooms and surface. Nothing is required: no parameters browses the whole site newest first.

**Parameters:**
- `query` (string, optional) — Free-text keywords as a Moroccan buyer types them (French, Arabic or Darija), e.g. `comptable`, `dacia logan`, `appartement agdal`.
- `category` (string, optional) — Category id or French name, e.g. `309` / `Offres emploi`, `314` / `Voitures occasion`, `315` (apartments for sale), `321` (apartments for rent), `359` (mobile phones). Top-level ids (304 Emploi, 15 Auto-Moto, 16 Vente immobilier, 305 Location immobilier, 307 Multi Services, 308 Ventes diverses, 306 Multimédia) cover all their subcategories. Full list: the `categories` action.
- `city` (string, optional) — City id or name as MarocAnnonces spells it (Casablanca, Rabat, Marrakech, Tanger, Fès, Agadir …; accents optional). Full list: the `cities` action.
- `min_price` (integer, optional) — Minimum price in Moroccan dirhams (MAD).
- `max_price` (integer, optional) — Maximum price in Moroccan dirhams (MAD).
- `with_photos` (boolean, optional, default false) — Only listings that have at least one photo.
- `make` (string, optional) — Cars only (category 314): make as the site lists it, e.g. `Dacia`, `Renault`, `Volkswagen`, `Mercedes-Benz`. Full list: the `cities`/`categories` actions do not carry it; the error message for an unknown make lists all 55.
- `year_min` (integer, optional) — Cars only (314): model year from.
- `year_max` (integer, optional) — Cars only (314): model year up to.
- `mileage_min` (integer, optional) — Cars only (314): kilometres from.
- `mileage_max` (integer, optional) — Cars only (314): kilometres up to.
- `fuel` (enum, optional) — Cars only (314): fuel type. [one of: Diesel, Essence]
- `bedrooms` (string, optional) — Apartments only (315 sale / 321 rent): number of bedrooms, 1-5, or `+5`.
- `bathrooms` (string, optional) — Apartments only (315 / 321): number of bathrooms, 1-4, or `+4`.
- `surface_min` (integer, optional) — Apartments only (315 / 321): surface from, m².
- `surface_max` (integer, optional) — Apartments only (315 / 321): surface up to, m².
- `page` (integer, optional, default 1) — 1-based page, 20 listings per page. MarocAnnonces serves at most 100 pages (2,000 rows) of any search; `has_more` says whether a next page exists.
- `include_pii` (boolean, optional, default true) — Accepted for compatibility; this API never masks anything. Seller names and phone numbers are returned exactly as the page publishes them.

**Returns:** {page, has_more, page_ceiling_reached, filters_applied, listings[]}. The site does not publish a result count on search pages, so no total is returned. Each listing: id, url, title, price_mad (null when the ad shows no price), price_text, currency, city, district, category_id, category_name, parent_category_id, parent_category_name, image, published_text, published_at (Moroccan local time; null on paid placements, which show no date), is_premium (paid placement shown above the results).

**Example request body:**
```json
{
  "query": "dacia",
  "category": "314"
}
```

### POST https://api.reefapi.com/marocannonces/v1/listing — 2 credits
One MarocAnnonces ad in full: title, full description, price, every photo, city and district, publication date, view count, all structured attributes (make, model, year, mileage, fuel, bedrooms, surface, job sector, contract, education level …), the advertiser's name and phone number, the recruiter or shop page when there is one, and for job offers the posting's validity date.

**Parameters:**
- `id` (string, optional) — MarocAnnonces listing number, as `search` returns it in `id`.
- `url` (string, optional) — Or the listing URL (marocannonces.com/categorie/…/annonce/<id>/….html).
- `include_pii` (boolean, optional, default true) — Accepted for compatibility; this API never masks anything. Seller names and phone numbers are returned exactly as the page publishes them.

**Returns:** {id, url, title, price_mad, price_text, currency, category_id, category_name, parent_category_id, parent_category_name, city, city_id, district, published_text, published_at, views, description, attributes[{label, value}], attributes_map, images[], images_count, seller{name, phone, phone_masked, shop{name, url, logo, description}}, job{date_posted, valid_through, employment_type, industry, hiring_organization, salary_text, salary_unit, region}}. Either `id` or `url` is required.

**Example request body:**
```json
{
  "id": "7675527"
}
```

### POST https://api.reefapi.com/marocannonces/v1/categories — 1 credit
MarocAnnonces' category tree: 7 top-level categories and 53 subcategories with the ids `search` accepts.

**Parameters:**
- `category` (string, optional) — Only this top-level category and its subcategories (id or name).

**Returns:** {category_count, categories[{id, name, subcategories[{id, name}]}]}

**Example request body:**
```json
{
  "category": "304"
}
```

### POST https://api.reefapi.com/marocannonces/v1/cities — 1 credit
The 81 Moroccan cities MarocAnnonces filters on, with their ids.

**Parameters:** none

**Returns:** {city_count, cities[{id, name}]}

## At scale
- **Volume:** 5M+ requests a day, measured at 60 requests a second across the fleet with no
  central bottleneck. Per-key limits are raised for high-volume accounts; volume pricing on request.
- **Missing a source:** tell us a site we do not cover and it becomes an engine. A customer asked
  for bestprice.gr on 21 Sep 2026 and it was in the catalog on 22 Sep.
- **Support:** 2 minute median time from a question in the live chat to the first answer. Setup
  help included, no support tier to buy.
- **One key, one credit pool** across every API. No per-site plans, no separate subscriptions.

## More
- Try it live, no code: https://reefapi.com/playground?engine=marocannonces
- Human docs page: https://reefapi.com/docs/marocannonces
- Overview page: https://reefapi.com/marocannonces-api
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
