# Google Places Bulk Scraper for UK Companies

Terminal-ready Python scraper for Google Places API (New). It imports your CSV into SQLite, processes records safely with resume support, retries, throttling, and exports results.

## 1) Server setup

```bash
sudo apt update
sudo apt install -y python3 python3-venv python3-pip unzip
cd google_places_bulk_scraper
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
nano .env
```

Put your new restricted Google Places API key in `.env`.

## 2) Put CSV in the project folder

Expected columns:

```text
Organisation Name,Town/City,County,Type & Rating,Route
```

## 3) Import CSV

```bash
python scraper.py import --csv 2026-05-29_-_Worker_and_Temporary_Worker.csv
```

## 4) Run scraper

Test first 100:

```bash
python scraper.py run --limit 100 --qps 1
```

Run all remaining:

```bash
python scraper.py run --qps 2
```

Resume later using the same command. Already completed rows are skipped.

## 5) Export final results

```bash
python scraper.py export --out google_places_results.csv
```

## 6) Useful commands

```bash
python scraper.py stats
python scraper.py reset-errors
python scraper.py run --only-errors --qps 1
```

## Notes

- Google does not publicly expose whether a business profile is owner-verified/claimed.
- This script stores confidence signals: operational status, phone, website, reviews, rating, Maps URL, and category.
- Use conservative QPS to avoid quota and billing surprises.
