> ## Documentation Index
> Fetch the complete documentation index at: https://me.miltonials.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CrAutos Scraper — ranking used cars in Costa Rica

> An async Python scraper I built to pull structured data on used cars in Costa Rica and score them by how good a deal they are.

**CrAutos Scraper** started as a personal itch: I wanted to buy a used car in **Costa Rica**, and staring at listing pages one at a time felt like a waste of a perfectly good weekend of programming. So I built an **async Python scraper** that pulls structured data on used cars from crautos.com and hands me back a clean dataset I can actually analyze.

<Card title="Download the latest dataset" icon="database" href="https://github.com/miltonials/crautos-scrapper/releases/latest/download/crautos_dataset.csv">
  A ready-to-use CSV export, published straight from the repo's releases.
</Card>

## What it does

It runs in two phases, both concurrent:

<Steps>
  <Step title="Listing phase">
    Concurrent POST requests gather the basics for every car — id, name, model year, and price in both colones and dollars.
  </Step>

  <Step title="Detail phase">
    Concurrent GET requests fetch the full spec sheet — mileage, engine, transmission, and equipment.
  </Step>
</Steps>

Then it cleans everything up (turning `"91,500 kms"` into the number `91500`), normalizes fields, and applies a simple **scoring formula** so the best deals float to the top:

```text theme={null}
score = year × 1 + price × (−1) + mileage × (−1)
```

Newer, cheaper, lower-mileage cars score higher. Crude, but surprisingly effective for a first pass.

## The engineering

* **`asyncio` + `httpx`** for concurrent requests, with **semaphore-based rate limiting** so I stay a polite guest on someone else's server.
* **BeautifulSoup** for parsing, **pandas** for the data, **tqdm** for a progress bar.
* **ruff**, **pytest** and **pre-commit** hooks, because even a weekend project deserves to not rot.

I built this strictly for **learning and research** — it's rate-limited on purpose, and the license forbids commercial use. It's the kind of project I love: a real problem of my own, solved well enough to be genuinely useful.

<Card title="Source on GitHub" icon="github" href="https://github.com/miltonials/crautos-scrapper">
  miltonials/crautos-scrapper
</Card>
