# Avito.ma Scraper: Listings, Prices, Sellers & Phones (`dltik/avito-scraper`) Actor

Scrape Avito.ma, Morocco's #1 classifieds: real estate, cars, jobs, goods. Search by keyword, category, city or price, or paste a URL. Get price, seller phone, images, area and niche fields (flat surface/rooms, car mileage/year/fuel). No browser, no captcha.

- **URL**: https://apify.com/dltik/avito-scraper.md
- **Developed by:** [Walid](https://apify.com/dltik) (community)
- **Categories:** Real estate, E-commerce, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 listing scrapeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Avito.ma Scraper — Morocco Classifieds Data (Real Estate, Cars, Jobs)

> Scrape [Avito.ma](https://www.avito.ma), Morocco's #1 classifieds site. Get price, seller phone, images, location and category-specific fields for real estate, cars, jobs and goods. No browser, no captcha.

⭐ **Bookmark this actor** to keep it on top of your Apify dashboard.

### What is the Avito.ma Scraper?

The **Avito.ma Scraper** turns any Avito search into clean JSON or CSV. Search by keyword, category, city or price range, or paste an Avito search URL, and the actor returns every listing with its price (in MAD), seller name and **phone number**, images, area, posting date and the structured fields that matter for its category. Real-estate ads come back with surface, rooms, bathrooms, floor and amenities; car ads with year, mileage, fuel and gearbox; vacation rentals with capacity, check-in hours and booking calendar. It reads Avito's own page data directly, so there is no browser to babysit and no captcha to solve.

This makes the Avito scraper a fast, cheap source for **Morocco real estate data**, **used-car data**, lead lists and market research that no official Avito API exposes.

### Use cases

- **Real estate deal-finding**: Pull every apartment or villa for sale in Casablanca, Marrakech or Tanger under a price ceiling, with surface and price-per-m² to spot underpriced listings.
- **Lead generation**: Build call lists of sellers (name + phone) by category and city for agencies, brokers and B2B outreach.
- **Used-car market intelligence**: Track make/model/year/mileage/price across Morocco to price inventory or find arbitrage.
- **Short-term rental research**: Collect vacation rentals with capacity and amenities to benchmark ADR against Airbnb comps.
- **Price monitoring**: Re-run daily to watch how prices and inventory move in a city or category.

### Input

Give a keyword, or a category + city + price range, or paste a full Avito search URL. Full reference in the input schema.

```json
{
  "mode": "search",
  "category": "ventes_immobilieres",
  "city": "Casablanca",
  "priceMin": 1000000,
  "priceMax": 2000000,
  "maxResults": 200,
  "proxyConfig": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
````

For specific ads, use detail mode with `startUrls` to get all images, amenities and the seller phone.

### Output

Each listing is one dataset record. Category-specific attributes are normalized into `niche` and the raw set is kept in `attributes`.

```json
{
  "ad_id": "58249883",
  "title": "Appartement 92 m² à Gauthier",
  "price": 1650000,
  "currency": "DH",
  "transaction": "à vendre",
  "category": "Appartements",
  "location": { "city": "Casablanca", "area": "Gauthier" },
  "seller": { "name": "B C Real Estate", "type": "shop", "phone": "0661xxxxxx" },
  "niche": { "surface_m2": 92, "rooms": 2, "bathrooms": 1, "floor": 3 },
  "amenities": ["Ascenseur", "Parking", "Meublé"],
  "images": ["https://content.avito.ma/classifieds/images/..."],
  "url": "https://www.avito.ma/fr/casablanca/appartements/..._58249883.htm"
}
```

### Pricing

This actor uses **PAY\_PER\_EVENT**: you are charged per listing returned. No charge for failed runs. Search and detail listings are billed the same way, so you only pay for the data you keep.

### Automate & schedule

Schedule the Avito scraper to run daily or hourly for fresh listings, and wire it to Google Sheets, Slack, a webhook or your CRM via Apify integrations. Recurring runs keep your deal-finder, lead list or price tracker current, set it once and forget it. Combine it with the actor's `publishedWithinHours` filter to alert only on brand-new ads.

### FAQ

**Is there an official Avito.ma API?** No. Avito.ma does not publish a public data API, so scraping the site is the practical way to get its listings programmatically. This actor does that for you.

**Does it return the seller's phone number?** Yes, when the ad exposes it. Avito ships the phone in the page data, so you get it without any extra reveal step.

**Which categories are supported?** All of them: real estate (sale, rent, vacation, flatshare), vehicles (cars, motorcycles, bikes, trucks, boats), Avito Market goods, and business/jobs/services. Filter by a friendly key or paste any Avito URL.

**How do I scrape Avito real estate in a specific city?** Set `category` to `ventes_immobilieres` (or `locations_immobilieres`) and `city` to the town name, then add `priceMin`/`priceMax`.

**Do I need a proxy?** Avito often works without one, but a residential IP is the most reliable and is the default. You can also pass your own proxy via `customProxyUrl`.

**What are the best alternatives for Morocco classifieds data?** Avito is the largest, so this is the primary source. For France, see the related Leboncoin scraper below.

***

⭐ **Found this useful? Bookmark it** — Apify ranks actors by bookmarks, and it keeps the actor visible for you.

#### Related actors

- [Leboncoin Scraper (France classifieds)](https://apify.com/dltik/leboncoin-scraper)

# Actor input Schema

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

search = find listings by keyword/category/city/price. detail = fetch full records for specific Avito ad URLs (all images, amenities, phone).

## `keywords` (type: `string`):

Free-text search (Avito `q=`), e.g. 'villa piscine', 'iphone 15', 'clio 4'. Spans every category unless you also set a category.

## `category` (type: `string`):

Optional category filter. Use a friendly key (immobilier, ventes\_immobilieres, locations\_immobilieres, locations\_vacances, voitures, motos, market, emploi, services...) or a raw Avito slug. Leave empty to search all categories.

## `city` (type: `string`):

Restrict to a Moroccan city or area, e.g. 'Casablanca', 'Marrakech', 'Tanger', 'Agadir', 'Rabat'. Leave empty for all of Morocco.

## `priceMin` (type: `integer`):

Minimum price in Moroccan dirham.

## `priceMax` (type: `integer`):

Maximum price in Moroccan dirham.

## `startUrls` (type: `array`):

Paste avito.ma search URLs (with any filters applied in the browser) for search mode, or ad URLs for detail mode. Overrides keyword/category/city.

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

Maximum number of listings to return (search mode). ~38 listings per page.

## `publishedWithinHours` (type: `integer`):

Only keep listings posted within this many hours (best-effort from the ad date). Leave empty for no time filter.

## `fetchDescriptions` (type: `boolean`):

In search mode, open each ad page for the full description, all images and amenities. Slower and costs one page fetch per ad.

## `sort` (type: `string`):

Optional sort passthrough (Avito `s=` param). Leave empty for the default (most recent).

## `inputs` (type: `array`):

Optional list of keywords (search mode) or ad URLs (detail mode) to process in one run.

## `customProxyUrl` (type: `string`):

Optional. Your own proxy (http://user:pass@host:port). Overrides Apify proxy. Avito often works without a proxy, but a residential IP is the most reliable.

## `proxyConfig` (type: `object`):

Apify proxy settings. Defaults to Residential for reliability; switch to Datacenter to run cheaper if it is not blocked.

## Actor input object example

```json
{
  "mode": "search",
  "maxResults": 100,
  "fetchDescriptions": false,
  "proxyConfig": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("dltik/avito-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("dltik/avito-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call dltik/avito-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=dltik/avito-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Avito.ma Scraper: Listings, Prices, Sellers & Phones",
        "description": "Scrape Avito.ma, Morocco's #1 classifieds: real estate, cars, jobs, goods. Search by keyword, category, city or price, or paste a URL. Get price, seller phone, images, area and niche fields (flat surface/rooms, car mileage/year/fuel). No browser, no captcha.",
        "version": "1.0",
        "x-build-id": "bCuLADp8dODCtzw9L"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dltik~avito-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dltik-avito-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dltik~avito-scraper/runs": {
            "post": {
                "operationId": "runs-sync-dltik-avito-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dltik~avito-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-dltik-avito-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "detail"
                        ],
                        "type": "string",
                        "description": "search = find listings by keyword/category/city/price. detail = fetch full records for specific Avito ad URLs (all images, amenities, phone).",
                        "default": "search"
                    },
                    "keywords": {
                        "title": "Keywords",
                        "type": "string",
                        "description": "Free-text search (Avito `q=`), e.g. 'villa piscine', 'iphone 15', 'clio 4'. Spans every category unless you also set a category."
                    },
                    "category": {
                        "title": "Category",
                        "type": "string",
                        "description": "Optional category filter. Use a friendly key (immobilier, ventes_immobilieres, locations_immobilieres, locations_vacances, voitures, motos, market, emploi, services...) or a raw Avito slug. Leave empty to search all categories."
                    },
                    "city": {
                        "title": "City / location",
                        "type": "string",
                        "description": "Restrict to a Moroccan city or area, e.g. 'Casablanca', 'Marrakech', 'Tanger', 'Agadir', 'Rabat'. Leave empty for all of Morocco."
                    },
                    "priceMin": {
                        "title": "Min price (DH)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum price in Moroccan dirham."
                    },
                    "priceMax": {
                        "title": "Max price (DH)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum price in Moroccan dirham."
                    },
                    "startUrls": {
                        "title": "Start URLs (advanced)",
                        "type": "array",
                        "description": "Paste avito.ma search URLs (with any filters applied in the browser) for search mode, or ad URLs for detail mode. Overrides keyword/category/city.",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of listings to return (search mode). ~38 listings per page.",
                        "default": 100
                    },
                    "publishedWithinHours": {
                        "title": "Published within (hours)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Only keep listings posted within this many hours (best-effort from the ad date). Leave empty for no time filter."
                    },
                    "fetchDescriptions": {
                        "title": "Fetch full details in search",
                        "type": "boolean",
                        "description": "In search mode, open each ad page for the full description, all images and amenities. Slower and costs one page fetch per ad.",
                        "default": false
                    },
                    "sort": {
                        "title": "Sort",
                        "type": "string",
                        "description": "Optional sort passthrough (Avito `s=` param). Leave empty for the default (most recent)."
                    },
                    "inputs": {
                        "title": "Keywords or URLs (batch)",
                        "type": "array",
                        "description": "Optional list of keywords (search mode) or ad URLs (detail mode) to process in one run.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "customProxyUrl": {
                        "title": "Custom proxy URL",
                        "type": "string",
                        "description": "Optional. Your own proxy (http://user:pass@host:port). Overrides Apify proxy. Avito often works without a proxy, but a residential IP is the most reliable."
                    },
                    "proxyConfig": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Apify proxy settings. Defaults to Residential for reliability; switch to Datacenter to run cheaper if it is not blocked.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ]
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
