Avito SDK Pro (avito-sdk) — Complete Documentation
Lightweight pure-HTTP Avito parser, sniper Desktop GUI (Windows .exe, ~29.8 MB), Sync/Async Python SDK, SQLite price-drop tracker, interactive Telegram bot with isolated tg_proxy, 6-command CLI, and JSON-RPC 2.0 MCP Server — with zero Chromium memory bloat.
🧭 1. Overview & Architecture
avito-sdk communicates over native HTTP/2 and TLS impersonation (curl_cffi) without spawning headless Chromium. Memory usage stays around ~30–40 MB RAM instead of 300–600 MB per browser instance, making 24/7 sniping possible even on a 1 GB RAM VPS.
3 Extraction Pipelines
Extracts classic allItems JSON, newer Beduin SSR screenFeed.items (itemSnippet), and HTML [data-marker="item"] / serpGridFeed cards automatically.
Safari iOS TLS Default
Rotates safari172_ios through safari270_ios without overwriting curl_cffi's native User-Agent or Accept-Language.
ProxyPool Failover
Thread-safe and asyncio-safe LRU pool: >=4s per-IP interval, exponential cooldown on 403/429/439, instant failover to healthy IPs.
SQLite Price Tracker & Export
Detects new listings and price drops in avito_prices.db, triggers Telegram/VK alerts, and exports formatted .xlsx, .csv, .json, .jsonl, DataFrame.
Avito SDK Pro vs Avito Parser (Playwright Edition)
| Criteria | Avito SDK Pro (avito-sdk v0.4.10) |
Avito Parser (parser_avito v3.2.29) |
|---|---|---|
| Engine | Native HTTP + Safari iOS / Chrome TLS (curl_cffi), no Chromium |
Flet UI + Playwright Chromium browser automation |
| RAM & Distribution | ~30–40 MB RAM, ~29.8 MB Windows .zip (.exe), PyPI, APT PPA, Conda |
Higher RAM (Chromium), standalone .exe |
| Best For | 24/7 sniping, VPS, server ProxyPool, Python SDK, TG bot, CLI & avito-mcp |
Manual interactive Avito account login inside a browser window |
📦 2. Installation & Extras
Requires Python >= 3.8 (verified on CPython 3.8–3.16, Free-Threaded No-GIL, and PyPy 3.8–3.12). Windows desktop users can download the standalone .exe archive with Python 3.12 and curl_cffi bundled.
uv add "avito-sdk[all]"
| Extra | Dependencies Installed | Purpose |
|---|---|---|
avito-sdk (core) |
beautifulsoup4, openpyxl, requests, tomli (py<3.11) |
Base client, HTML/JSON extractors, SQLite tracker, CLI, Telegram bot & MCP |
[tls] |
curl-cffi>=0.7.0 |
Recommended: native Safari iOS & Chrome TLS/HTTP2 impersonation |
[async] |
httpx>=0.24.0 |
Async fallback when curl_cffi async session is unavailable |
[gui] |
customtkinter>=6.0.0 |
Dark Desktop GUI application (avito-gui) |
[dataframe] |
pandas>=1.5.0 |
to_dataframe() export to Pandas |
[all] |
curl-cffi, openpyxl, httpx, pandas, customtkinter |
Full installation with every feature enabled |
🖥️ 3. Desktop GUI (AvitoSDK_Pro.exe / avito-gui)
Run AvitoSDK_Pro.exe on Windows or launch avito-gui from Python. Settings are persisted automatically in storage/gui_config.json.
- Monitoring tab: multi-URL queue (one search/category URL per line), min/max RUB price bounds, whitelist/blacklist keywords, Seller Blacklist, Enrich Details toggle, Workers slider, check interval + jitter, and Excel export.
- Live Feed tab: displays newly discovered cards with price, location/address fallback (item.location), price drop badge (📉 -... ₽), and direct Avito links.
- Proxies tab: single proxy field + multiline ProxyPool box, MobileProxy.space rotation URL or key, optional spfa.pro API key, and the Check Proxy button.
- Telegram tab: Bot Token (@BotFather), Chat/Channel ID, isolated tg_proxy field, Only Text toggle, Include Params toggle, and Test Send button.
- Event Log & Donate tabs: live request/failover/SPFA diagnostics and quick support links.
/rossiya homepage rubricator, measures latency (ms), and clearly separates 407, 403/429 WAF, timeouts, and spfa.pro errors.
🛡️ 4. Safari iOS TLS, ProxyPool, MobileProxy & spfa.pro
Native Safari iOS TLS Impersonation
With impersonate="auto" (default), transports prioritize battle-tested safari184_ios / safari180_ios profiles from installed curl_cffi, keep native headers intact, space consecutive direct-IP requests (>=3.5s, 0ms first call), and reset session + rotate TLS with at most 1 retry on direct-IP WAF blocks.
4 Supported Proxy Modes
| Mode | Recommended Load | How It Works |
|---|---|---|
| Direct IP (No Proxy) | Single ad-hoc tests | Safari iOS TLS + gentle direct-IP pacing. Frequent bursts trigger IP 429. |
| ProxyPool (IPv4 / SOCKS5) | Server pools 24/7 | Accepts list, multiline string, or proxies.txt (6 formats). LRU balancing, >= 4.0s/IP spacing, exponential cooldown, instant failover. |
| MobileProxy 4G/LTE | High load & enrichment | Carrier NAT IPs + automatic IP rotation via mobileproxy_key / proxy_change_url. |
| spfa.pro Cookies API | Bypass cookies & phones | Supports /api/cookies/, /api/cookies/mobile/, async 202 /api/unblock/ queue, 12h TTL cache, and ParsePhone. |
Supported proxy string formats:
http://user:pass@185.123.45.67:8000
https://user:pass@185.123.45.68:8443
socks5://user:pass@185.123.45.69:1080
socks5h://user:pass@185.123.45.70:1080
user:pass@185.123.45.71:8000
185.123.45.72:8000:user:pass
🐍 5. Python SDK Reference (Sync & Async)
Quick Start: Search, ProxyPool, PriceTracker & Export
from avito_sdk import AvitoClient, to_excel, to_json, to_dataframe
with AvitoClient(
proxies="proxies.txt", # list, multiline string, or file path -> ProxyPool
proxy_min_interval=4.0, # >= 4.0s per IP automatically for multi-proxy pools
proxy_cooldown=60.0, # exponential cooldown base on 403/429/439
tracker_db="avito_prices.db",
tg_token="123456:BOT_TOKEN",
tg_chat_id="-1001234567890",
tg_proxy="socks5://tg_user:tg_pass@host:1080",
) as client:
items = list(
client.search(
query="MacBook M2",
region="moskva",
min_price=40000,
max_price=110000,
sort="date",
enrich_details=True,
max_workers=4,
limit=30,
notify_telegram=True,
telegram_progress=True,
excel_path="macbooks.xlsx",
)
)
# Query detected price drops from SQLite tracker
for drop in client.tracker.get_price_drops():
print(drop["title"], drop["initial_price"], "->", drop["current_price"])
to_json(items, "macbooks.json")
df = to_dataframe(items)
Asynchronous Client (AsyncAvitoClient)
import asyncio
from avito_sdk import AsyncAvitoClient
async def main():
async with AsyncAvitoClient(
proxies=["u1:p1@ip1:8000", "u2:p2@ip2:8000"],
impersonate="auto", # rotating native Safari iOS TLS
proxy_min_interval=4.0,
) as client:
async for item in client.search(
query="RTX 4070",
region="sankt-peterburg",
enrich_details=True,
concurrency=2,
limit=20,
):
print(item.id, item.title, item.price, item.location, item.url)
asyncio.run(main())
Single Item & Catalog URL Scraping
from avito_sdk import AvitoClient, MobileProxySpace
client = AvitoClient(
proxy="http://login:password@proxy-domain.space:port",
mobileproxy_key="YOUR_ROTATION_KEY", # auto-builds changeip.mobileproxy.space URL
)
# 1. Scrape exact filtered Avito URL from your browser
items = client.scrape_url(
url="https://www.avito.ru/moskva/noutbuki?cd=1&s=104",
max_pages=2,
enrich_details=True,
excel_path="laptops.xlsx",
)
# 2. Fetch full item specs, seller & views
item = client.get_item(1234567890)
print(item.title, item.price, item.location, item.seller_name, item.seller_id)
print(item.total_views, item.today_views, item.params, item.description)
# 3. Optional manual mobile IP rotation
mps = MobileProxySpace.from_key("YOUR_ROTATION_KEY")
res = mps.rotate_ip(wait_reconnect=True)
Core AvitoClient Parameters & Item Fields
| Symbol / Parameter | Default / Type | Description |
|---|---|---|
AvitoClient(proxy, proxies, ...) |
Optional[str] / Sequence / Path |
Single proxy or proxies pool, proxy_change_url, mobileproxy_key, tg_proxy, user_agent, fingerprint. |
AvitoClient.from_config(...) |
path="config.toml" |
Initializes client, ProxyPool, and TelegramNotifier (with proxy_notifier/tg_proxy) from TOML. |
Item fields |
dataclass | id, title, price, old_price, price_drop, url, location, seller_name, seller_id, total_views, today_views, params, description. |
🤖 6. Interactive Telegram Bot & tg_proxy Isolation
AvitoTelegramBot lets you manage scraping right inside Telegram chat with live progress bars, automatic .xlsx upload, and dedicated tg_proxy routing.
from avito_sdk import AvitoTelegramBot
bot = AvitoTelegramBot(
bot_token="123456:ABC-DEF_BOT_TOKEN",
proxies=["user1:pass1@ip1:8000", "user2:pass2@ip2:8000"],
tg_proxy="socks5://tg_user:tg_pass@host:1080", # used for Bot API & getUpdates
workers=4,
limit=30,
)
bot.run_polling()
| Command | Description (v0.4.10) |
|---|---|
/start | Main menu & active status |
/search <query> | Scrape listings + live progress + .xlsx |
/proxy <url|off> | Set proxy / multi-line pool or /proxy off |
/proxies <list|off> | Configure/clear ProxyPool |
/tg_proxy <url|off> | Set/clear isolated Telegram API proxy |
/workers <1..16> | Set enrichment worker threads |
/limit <10..5000> | Default items limit per search |
/status | Show active proxy mode, pool size & tg_proxy |
/code | Minimal v0.4.10 Python snippet |
/help | Full command guide |
💻 7. CLI & config.toml
Entry points avito, avito-sdk, and avito-parser expose 6 subcommands:
# 1. Search with ProxyPool + isolated Telegram proxy + Excel export
avito-sdk search "видеокарта" --region moskva --min-price 20000 --max-price 80000 \
--proxies proxies.txt --workers 4 --enrich \
--tg-token "123456:BOT_TOKEN" --tg-chat-id "-1001234567890" \
--tg-proxy "socks5://user:pass@host:1080" \
--output gpu.xlsx
# 2. Launch interactive Telegram controller
avito-sdk bot --tg-token "123456:BOT_TOKEN" \
--proxies proxies.txt --tg-proxy "socks5://user:pass@host:1080" --workers 4 -n 30
# 3. Fetch single item specs / inspect local SQLite price drops / run TOML workflow
avito-sdk item 3854129841 -o item.json
avito-sdk drops --db avito_prices.db
avito-sdk config config.toml
Sample config.toml
[avito]
urls = ["https://www.avito.ru/moskva/noutbuki?cd=1&s=104"]
proxies = [
"http://user1:pass1@185.123.45.67:8000",
"socks5://user2:pass2@185.123.45.68:1080",
]
proxy_min_interval = 4.0
proxy_cooldown = 60.0
impersonate = "auto"
# Optional mobile rotation or spfa.pro cookie bypass:
# proxy_change_url = "https://changeip.mobileproxy.space/?proxy_key=..."
# use_bypass_api = true
# cookies_api_key = "YOUR_SPFA_KEY"
tg_token = "123456:BOT_TOKEN"
tg_chat_id = ["-1001234567890"]
proxy_notifier = "socks5://tg_user:tg_pass@host:1080" # alias: tg_proxy
min_price = 30000
max_price = 120000
ignore_reserv = true
parse_params = true
parse_description = true
save_xlsx = true
max_workers = 2
🔌 8. Native MCP Server (avito-mcp)
avito-mcp implements JSON-RPC 2.0 over stdio for Claude Desktop, Claude Code, Google Antigravity, Cursor, Codex, and Windsurf.
| Tool | Description |
|---|---|
avito_search | Search with filters, detail enrichment, and Excel export |
avito_get_item | Full card details, seller & view counts by item_id |
avito_price_drops | Query SQLite price-drop history |
# Quick registration:
agy mcp add avito -- avito-mcp --workers 2
# or Claude Code:
claude mcp add avito avito-mcp -- --workers 2
# Or in mcp_config.json / .cursor/mcp.json:
{
"mcpServers": {
"avito": {
"command": "uvx",
"args": ["--from", "avito-sdk[tls,excel]", "avito-mcp", "--workers", "2"],
"env": {
"AVITO_PROXY": "http://user:pass@ip:port",
"AVITO_PROXIES": "proxies.txt",
"AVITO_PROXY_CHANGE_URL": "https://changeip.mobileproxy.space/?proxy_key=KEY",
"AVITO_TRACKER_DB": "avito_prices.db",
"AVITO_TG_TOKEN": "123456:BOT_TOKEN",
"AVITO_TG_CHAT_ID": "-1001234567890",
"AVITO_TG_PROXY": "socks5://tguser:tgpass@host:1080"
}
}
}
}
🔧 9. Troubleshooting HTTP Statuses & Edge Cases
| Symptom / Code | Root Cause | How to Fix |
|---|---|---|
| HTTP 407 Proxy Auth Required | Wrong credentials or client IP not whitelisted | Check credentials in provider dashboard and test again. |
| HTTP 403 / 429 / 439 WAF | Exit IP rate-limited by Avito | Increase interval, add multiple IPs to ProxyPool, or use 4G rotating proxy / spfa.pro. |
| 0 items returned | Root /rossiya URL used instead of search URL |
Use a full search/category URL from Avito. |
| Telegram timeout | ISP throttles Telegram API | Set dedicated tg_proxy / /tg_proxy. |