# Avito Scraper (`ahaham_bytiz/avito-scraper`) Actor

Scrape listings from Avito.ru — titles, prices, descriptions, seller info, images, geo and phone numbers (where public). Supports search URLs, category URLs, and individual item URLs with pagination and filters.

- **URL**: https://apify.com/ahaham\_bytiz/avito-scraper.md
- **Developed by:** [Max Consta](https://apify.com/ahaham_bytiz) (community)
- **Categories:** Lead generation, SEO tools, Social media
- **Stats:** 37 total users, 2 monthly users, 88.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.005 / actor start

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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 Scraper

Scrape listings from [Avito.ru](https://www.avito.ru) — the biggest classifieds marketplace in Russia and CIS. The actor extracts structured data from search results, category pages, and individual item pages: titles, prices, descriptions, seller info, images, location, publish date, and more.

### Features

- **URL types supported**: search results, category pages, individual item URLs
- **Pagination**: follows `?p=2, 3, ...` until the page limit or no-more-items
- **Detail pages**: optionally fetches each listing's full page for description, all images, seller rating, parameters
- **JSON-first parsing**: extracts from Avito's embedded `window.__initialData__` (resilient to DOM changes)
- **Proxy-aware**: uses Apify Proxy — required for production runs

### Input

| Field | Type | Description |
|---|---|---|
| `startUrls` | array | Avito URLs to scrape (search/category/item) |
| `maxItems` | integer | Max listings to output (`0` = unlimited) |
| `maxPagesPerUrl` | integer | Max paginated pages per start URL |
| `scrapeDetails` | boolean | Visit each item page for full data |
| `proxyConfiguration` | object | Apify Proxy config — use `RESIDENTIAL` + country `RU` |
| `language` | string | `ru` or `en` |

#### Example input

```json
{
    "startUrls": [
        { "url": "https://www.avito.ru/moskva/avtomobili/bmw?cd=1" }
    ],
    "maxItems": 200,
    "maxPagesPerUrl": 5,
    "scrapeDetails": true,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "RU"
    }
}
```

### Output

Each item in the dataset:

```json
{
    "itemId": "4532116789",
    "url": "https://www.avito.ru/moskva/avtomobili/bmw_x5_2020_3500000_4532116789",
    "title": "BMW X5 2020",
    "price": 3500000,
    "priceText": "3 500 000 ₽",
    "currency": "RUB",
    "location": "Москва",
    "category": "Автомобили",
    "sellerName": "Иван",
    "sellerRating": 4.9,
    "sellerType": "private",
    "publishedAt": 1714000000,
    "coords": { "lat": 55.75, "lng": 37.61 },
    "images": ["https://20.img.avito.st/..."],
    "imagesCount": 12,
    "description": "Full description text...",
    "parameters": { "Марка": "BMW", "Модель": "X5", "Год": "2020" }
}
```

### Pricing (Pay-per-result)

- **$0.50 per 1000 listings** scraped from search pages
- **$2.00 per 1000 detail pages** (when `scrapeDetails=true`)

Proxy usage is billed separately by Apify.

### Use cases

- Price monitoring (automotive, real estate, electronics)
- Lead generation from seller contacts (private listings)
- Market research (volume, geographic distribution, seasonality)
- Reselling arbitrage (find underpriced listings)

### Notes

- Avito enforces strict rate limits. Always use **Apify Proxy with residential IPs** in country `RU`.
- Phone numbers on Avito are gated behind a click and only exposed to logged-in users — this actor does not attempt to bypass that.
- Respect Avito's [Terms of Service](https://www.avito.ru/legal) and applicable laws. This tool is intended for publicly accessible data and legitimate research.

# Actor input Schema

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

List of Avito URLs to scrape. Supports search results, category pages, and individual item pages. Example: https://www.avito.ru/moskva/avtomobili

## `maxItems` (type: `integer`):

Maximum number of listings to scrape. Set 0 for unlimited (until pagination ends).

## `maxPagesPerUrl` (type: `integer`):

Maximum number of paginated pages to visit per start URL.

## `scrapeDetails` (type: `boolean`):

Visit each item detail page for full description, seller info and images. Slower but richer data.

## `proxyConfiguration` (type: `object`):

Apify Proxy is strongly recommended — Avito aggressively blocks direct residential/datacenter traffic.

## `language` (type: `string`):

Language cookie passed to Avito.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.avito.ru/moskva/avtomobili?cd=1"
    }
  ],
  "maxItems": 100,
  "maxPagesPerUrl": 10,
  "scrapeDetails": true,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "RU"
  },
  "language": "ru"
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.avito.ru/moskva/avtomobili?cd=1"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "RU"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("ahaham_bytiz/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 = {
    "startUrls": [{ "url": "https://www.avito.ru/moskva/avtomobili?cd=1" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "RU",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("ahaham_bytiz/avito-scraper").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 '{
  "startUrls": [
    {
      "url": "https://www.avito.ru/moskva/avtomobili?cd=1"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "RU"
  }
}' |
apify call ahaham_bytiz/avito-scraper --silent --output-dataset

```

## MCP server setup

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

```

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/fSrzVEPpmbT3ohC8A/builds/5tLNVvHvgxWKlH5to/openapi.json
