English · Русский
Finds good used phones on OLX.kz and ranks them by value.
It reads every listing in your price range and works out brand and model from messy titles. It adds Kimovil specs and compares the asking price with the model's market price. The result is a ranked report. Built for Almaty, works for any OLX.kz region.
Quick start: run uv sync, then ./run.sh --min-price 150000 --max-price 300000 (Install).
A real run
The top of the report from ./run.sh --min-price 15000 --max-price 80000 --phone-type both --location alm
(6,557 listings analyzed), trimmed:
📱 iPhone 11 Pro Max (iPhone 11 Pro Max 256GB Gold)
💰 PRICE: 80,000 KZT
📅 RELEASE YEAR: 2019
📍 LOCATION: Гульдала - 27 сентября 2026 г.
⚠️ 📍 OUTSIDE АЛМАТЫ: Гульдала, you'll need to travel
⭐ VALUE FACTORS:
⭐⭐⭐ Ultra Flagship
💾 Good 256GB storage
✨ Excellent condition
🔋 Excellent battery (95%+)
What it does
- Reads the whole price range. OLX returns at most 1000 results per search, so the range is split into price slices that each fit under the cap. Pages load concurrently, paced and retried.
- Reads messy titles. 22 brands, Cyrillic spellings and typos ("xioami", "techno", "poko", "z фолд"). A phone offered in exchange ("обмен на iphone 13") is not the phone for sale.
- Adds specs from Kimovil: screen, chipset, AnTuTu, battery, charging, DxOMark. Cached in SQLite.
- Scores value: discount from the market price (102 models), release year, tier, storage, RAM, camera and condition. Implausible discounts are capped. Out-of-town listings and shops are flagged.
- Optional AI pass. Gemini, Cerebras or OpenRouter read the description (and optionally the photos) for defects and extras. The rest of the pipeline needs no API key.
How it differs
Compared with other ways to shop for a used phone on OLX.kz:
- OLX search filters by price and sorts by date or price. It has no idea what a model is worth. A cheap old phone and a well-priced recent flagship look alike, and "xioami 14 512/16" is only a title.
- Price comparison sites cover new phones in shops, not private used listings.
- Generic scrapers give you raw listings. Brand detection, specs, scoring and the TLS fingerprint check on OLX are left to you.
How it works
OLX and Kimovil sit behind bot protection that checks the TLS fingerprint and the headers. Requests go through curl_cffi impersonating Chrome, with pacing and retries from market-sources. Kimovil pages are parsed with selectolax. No browser is involved.
Architecture notes for contributors and coding agents are in CLAUDE.md.
Install
Needs Python 3.12+ and uv.
git clone https://github.com/octrow/olx-phone-scout.git
cd olx-phone-scout
uv sync
For the AI pass, copy .env.example to .env and fill in the key of the provider you use.
Run
./run.sh # full pipeline: scrape → recategorize → analyze
./run.sh --scrape # scrape OLX only
./run.sh --recategorize # re-run brand detection on saved listings
./run.sh --analyze # analyze saved listings only
./run.sh --show-config # print the configuration and exit
./run.sh is a thin wrapper around uv run main.py; the same flags work with either.
./run.sh --min-price 150000 --max-price 300000 --max-pages 10 --days-back 14
./run.sh --min-price 15000 --max-price 80000 --phone-type both # Android + iPhone
./run.sh --location alm --include-business # Almaty city + region, shops too (marked 📍 / 🏪)
./run.sh --gemini # Gemini AI analysis (--gemini-photos, --gemini-top-n N)
./run.sh --cerebras # or --openrouter
--location takes any OLX.kz region slug (astana, shymkent, karaganda, ...); see --help.
Daily runs
--notify sends listings that entered the top 10 since the last run to a Telegram chat.
Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in .env.
Scheduler setup (systemd, cron) and details: docs/daily-runs.md.
Output
Each run writes to a session folder named after its settings, e.g.
data/sessions/alma-ata_90k-380k_android/:
results/:all_listings.json,androids.json,iphones.json,unknown.json,androids_analyzed.json,TOP_50_ANDROID.jsonreports/TOP_RECOMMENDATIONS_{timestamp}.txt: the ranked, human-readable reportlogs/: one log per pipeline step
Kimovil specs are cached for all sessions in data/cache/kimovil_specs.db.
Configuration
Defaults live in src/core/config.py; CLI flags override them.
| Setting | Default |
|---|---|
LOCATION |
alma-ata |
MIN_PRICE / MAX_PRICE |
90,000 / 380,000 KZT |
MAX_PAGES |
25 per price slice (OLX's maximum) |
DAYS_BACK |
25 |
PHONE_TYPE_FILTER |
android (--phone-type android|iphone|both) |
REQUEST_DELAY |
1.5 s between OLX requests |
Kimovil pacing is in src/core/constants.py: KIMOVIL_MAX_CONCURRENT = 2,
KIMOVIL_REQUEST_DELAY = 2.5 s. Each model is fetched at most once per run.
Troubleshooting
- OLX returns 403 on every page. CloudFront blocks by TLS fingerprint. Try another
IMPERSONATEtarget insrc/core/browser_transport.py, or updatecurl_cffi. - Kimovil answers 429 for most phones. That is a Cloudflare block on your IP after a burst of
requests, not a normal rate limit. Wait a few hours and run
./run.sh --analyzeagain; found specs are cached, so each run fills in more.
Limitations
- Market prices are maintained by hand (
src/analysis/market_data.py, 102 models). - OLX.kz only; listing text is expected in Russian or Kazakh.
Development
uv run pytest # tests (+ coverage report in htmlcov/)
uv run ruff check . && uv run ruff format --check .
See CONTRIBUTING.md.
License
Metadata
Release files for olx-phone-scout 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| olx_phone_scout-1.0.6.tar.gz | 136.1 kB | With provenance | Details for olx_phone_scout-1.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| olx_phone_scout-1.0.6-py3-none-any.whl | Python 3 | none | any | Details for olx_phone_scout-1.0.6-py3-none-any.whl |
Total release size: 237.5 kB
Release files / olx_phone_scout-1.0.6.tar.gz
| Download URL | olx_phone_scout-1.0.6.tar.gz |
|---|---|
| Size | 136.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79567173cbdb40985ab4629f6ceceb6de9dd2f8f5fa6c2b50f1027cdf4d43f85
|
|
BLAKE2b-256 checksum How to use checksums |
c8c0a61c8d662ecde9acb86f8702fcc543b8202f19f8b66177a720450af21733
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / olx_phone_scout-1.0.6-py3-none-any.whl
| Download URL | olx_phone_scout-1.0.6-py3-none-any.whl |
|---|---|
| Size | 101.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1de7252cc311594c1eeebfb85951ab72782c9b1bd551dba878174660085a4e5
|
|
BLAKE2b-256 checksum How to use checksums |
78f73c8ece02c4533d3355ee68fce9d4a6983da537311a331cce1ba1cf65c59c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for olx-phone-scout 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for olx_phone_scout-1.0.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.