Avito.ma Scraper – Morocco Listings, Cars & Real Estate avatar

Avito.ma Scraper – Morocco Listings, Cars & Real Estate

Pricing

from $0.28 / 1,000 listing scrapeds

Go to Apify Store
Avito.ma Scraper – Morocco Listings, Cars & Real Estate

Avito.ma Scraper – Morocco Listings, Cars & Real Estate

Scrape Avito.ma (Avito Maroc) annonces: cars, real estate, phones, jobs and more. Prices, photos, descriptions, seller info and phone numbers as JSON/CSV/Excel. Filter by category, keyword, city and price.

Pricing

from $0.28 / 1,000 listing scrapeds

Rating

0.0

(0)

Developer

kata Kuri

kata Kuri

Maintained by Community

Actor stats

0

Bookmarked

13

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Fast and reliable Apify actor that scrapes annonces from Avito.ma (Avito Maroc) — Morocco's largest classifieds marketplace. Get cars (voitures), real estate (immobilier), phones, jobs (emploi), services and more as clean JSON, CSV or Excel.

Features

  • Two input modes: choose from 50+ predefined categories OR paste custom Avito.ma URLs
  • Search filters: keyword, city, min/max price (applied in the URL and double-checked on the results)
  • Full detail scraping: description, HD images, seller info, seller phone number (when the seller shows it), attributes
  • Smart limits: maxResults stops scraping as soon as it is reached — no wasted requests
  • Works out of the box: Apify datacenter proxy is the default and works for Avito.ma; with the RESIDENTIAL group selected, only requests the datacenter proxy cannot fetch go over residential
  • Honest runs: a run that gets blocked or finds nothing fails with a clear message instead of "succeeding" with an empty dataset
  • Live progress in the run status message (pages, listings pushed / max)
  • Structured JSON output ready for analysis

Pricing

Simple all-in pay-per-event pricing — platform usage and proxy are included, nothing else is billed:

  • $0.40 per 1,000 listings ($0.0004 per result)
  • From 3 Dec 2026: listing details +$1.00 per 1,000 (scrapeDetails, the default: full description, all photos, phone, seller info and every attribute) — so $1.40 per 1,000 listings with details
  • $0.002 per run start (the actor runs in 512 MB by default)
  • Lower prices on paid Apify plans (up to 30% off)

Example: 1,000 listings with full details = $0.002 + $0.40 + $1.00 = $1.40 (until 2 Dec 2026: $0.40). Without details: $0.40. That is still about 3x cheaper than other Avito.ma scrapers ($4–5 per 1,000). Use maxResults to cap your cost; the run also stops cleanly at your maximum charge per run. Listings whose details could not be loaded are returned with basic data and are not charged the details price. If a run returns 0 listings it is marked as failed.

Input

Categories & URLs

ParameterTypeDefaultDescription
categoriesstring[]—Select from 50+ predefined Avito.ma categories
categoryUrlsstring[]—Paste any avito.ma category/search URLs directly (other domains are rejected)

At least one of categories or categoryUrls is required. You can use both together.

Search Filters

ParameterTypeDefaultDescription
searchKeywordstring—Filter by keyword (e.g. "iphone 15", "mercedes")
citystring—Filter by city (e.g. "Casablanca", "Rabat", "Fès")
minPriceinteger—Minimum price in MAD (listings without a price are excluded when a price filter is set)
maxPriceinteger—Maximum price in MAD (must be >= minPrice)
sortBystring—Ignored: Avito.ma always lists the newest ads first and has no sort option in its URLs

The city filter is applied to nationwide URLs (/fr/maroc/...). For custom URLs that already target a city, the city is not changed.

Scraping Limits

ParameterTypeDefaultDescription
maxResultsintegerunlimitedStop after this many results (across all URLs)
maxPagesinteger5Max pages per category (~38 listings/page)
scrapeDetailsbooleantrueFetch each listing's details (description, all photos, phone, attributes). From 3 Dec 2026: +$1.00 per 1,000 listings
maxConcurrencyinteger5Parallel requests (1-20)
proxyConfigurationobject{"useApifyProxy": true}Apify proxy settings. Datacenter proxy works and is the default. With the RESIDENTIAL group, requests still start on datacenter and fall back to residential when blocked

Example Input

{
"categories": ["smartphones", "ordinateurs-portables"],
"searchKeyword": "iphone 15",
"city": "Casablanca",
"minPrice": 5000,
"maxPrice": 15000,
"maxResults": 50,
"maxPages": 10,
"scrapeDetails": true,
"proxyConfiguration": {
"useApifyProxy": true
}
}

Output

Each result contains:

FieldTypeDescription
avitoIdstringUnique Avito listing ID
titlestringListing title
pricenumberPrice value
currencystringCurrency (MAD)
citystringCity name
locationstringArea and city, e.g. "Hay Riad, Rabat"
categorystringCategory name
descriptionstringFull description
imagesstring[]Image URLs (HD when available)
imageUrlstringFirst image URL
detailsobjectCategory-specific attributes
sellerNamestringSeller display name
sellerPhonestringSeller phone number; null when the seller hides it
sellerIdstringSeller Avito ID
sellerProfileUrlstringSeller profile URL (shops/stores when available)
sellerMemberSincestringYear seller joined
sellerLocationstringSeller location
sellerTotalListingsnumberSeller's total active ads
listingUrlstringDirect link to listing
publishedAtstringISO date with detail pages; relative text such as "il y a 2 heures" in basic mode
scrapedAtstringScrape timestamp (ISO 8601)
_completenessstringfull (details loaded, charged as listing details from 3 Dec 2026) or basic (category-page data only, also used if the details could not be loaded)

Example Output

{
"avitoId": "59080409",
"title": "iPhone 8 normal",
"price": 750,
"currency": "MAD",
"city": "Agadir",
"location": "Autre secteur, Agadir",
"category": "Smartphone et Téléphone",
"description": "iPhone 8 en bon état...",
"images": ["https://content.avito.ma/classifieds/images/..."],
"imageUrl": "https://content.avito.ma/classifieds/images/...",
"details": { "Marque": "Apple", "Modèle": "iPhone 8", "Capacité de Stockage": "64 GB" },
"sellerName": "Mouhcine",
"sellerPhone": "0600960524",
"sellerId": "10434202",
"listingUrl": "https://www.avito.ma/fr/autre_secteur/smartphone_et_téléphone/iPhone_8_normal_59080409.htm",
"publishedAt": "2026-11-15T16:29:05Z",
"scrapedAt": "2026-11-15T16:40:00.000Z",
"_completeness": "full"
}

Use cases

  • Price monitoring of cars, phones or apartments in Morocco
  • Real estate market research: prices per city and neighbourhood (appartements, villas, terrains)
  • Lead generation for dealers, agencies and service providers (annonces with seller contact)
  • Resale / arbitrage: find under-priced items by category and city
  • Datasets for analysis: Moroccan classifieds trends, listing volumes, seasonality

FAQ

Do I need a proxy? Yes on the Apify platform. The default Apify datacenter proxy works. Without a proxy Avito.ma serves a captcha / 403 and the run fails. If you select the RESIDENTIAL group, the actor still tries the datacenter proxy first and retries only blocked requests over residential (logged in the run log).

Why did my run fail with "0 listings"? Either Avito blocked the requests (the message says so; try the RESIDENTIAL proxy group or a lower maxConcurrency) or the search matched nothing (check the category, keyword, city and price). Failed requests are saved in the FAILED_REQUESTS record of the run's key-value store.

Why fewer results than maxResults? There were not enough matching listings within maxPages, or some requests failed. The run's status message tells you which.

Are phone numbers included? Yes, when the seller displays one on the ad (sellerPhone). Hidden numbers are null.

Can I scrape in French or Arabic? The actor uses the French site (/fr/). Annonces are returned in the language they were written in.

Mots-clés: Avito Maroc, annonces Maroc, scraper Avito, voitures à vendre Maroc, immobilier Maroc, appartements à louer, téléphones, emploi Maroc.

How It Works

  1. Resolves category slugs to Avito.ma URLs and applies filters (keyword, city, price)
  2. Loads the category pages over plain HTTP with browser-like headers and Apify Proxy sessions (a real Playwright browser is only used as a fallback)
  3. Extracts listing data from Next.js __NEXT_DATA__ (no HTML parsing — fast & reliable)
  4. Paginates one page at a time up to maxPages, stopping as soon as maxResults is reached
  5. Optionally loads each listing's details (full description, HD images, seller info, attributes) from the same JSON data Avito.ma's own ad page is built from — about 2 KB per listing instead of a full page; if that fails the ad page itself is loaded, and if it keeps failing the listing is still returned with basic data
  6. Outputs structured JSON to the Apify dataset

Tips

  • Keep the default proxy; switch to RESIDENTIAL only if you are blocked
  • Set scrapeDetails: false for faster runs when you only need basic listing info (seller name, phone and image are included there too)
  • Use maxResults to control costs — the scraper stops as soon as the limit is hit
  • Each category page has ~38 listings, so maxPages=10 gives ~380 results per URL
  • Combine categories with searchKeyword, city and price filters for precise targeting

Local development

npm install
npm test
# run with your own Chrome instead of the Playwright browser (optional):
LOCAL_CHROME_PATH="/path/to/chrome" apify run --purge --input '{"categories":["smartphones"],"maxResults":5,"proxyConfiguration":{"useApifyProxy":false}}'