Unofficial CLI for Woolworths New Zealand: search products and manage your cart.
Project description
woolies-nz-cli
Unofficial command-line tool for Woolworths New Zealand. Search products, manage your trolley, and script your shopping — all from the terminal.
$ woolies login
Email: you@example.com
Password: ********
✓ Logged in as you@example.com
$ woolies search milk --limit 3
Found 3 products (3 groups):
Anchor Uht Milk Blue Top
- Size: 1L (ctn) | Price: $3.40 (Special, was $3.79)
SKU: 269671 | In Stock | Category: Fridge & Deli
Unit: Each ($3.40 per 1L)
...
$ woolies cart add 269671 2
✓ Added 2x (SKU: 269671) to cart
What this is / isn't
- ✅ For: NZ shoppers who want CLI / scriptable access to Woolworths NZ.
- ✅ For: building your own automations on top (rotating shopping lists, price alerts, etc.).
- ❌ Not: an official Woolworths product. Hobby-grade, maintained by one person.
- ❌ Not: for AU Woolworths or the rebranded Countdown UI — woolworths.co.nz only.
- ❌ Not: for redistributing scraped Woolworths product data as a dataset.
Disclaimer: This tool is not affiliated with, endorsed by, or connected to Woolworths Limited or Woolworths New Zealand Limited. Use of this tool may violate Woolworths' Terms of Service. Use at your own risk. The author accepts no liability for account suspensions, rate limiting, blocked access, or any other consequence of using this software. Consider using a dedicated Woolworths account for automated access.
Stability: it's janky and that's okay
There is no official Woolworths NZ API. This tool works by:
- Driving a real browser to log in (selectors against Woolworths' login page).
- Calling Woolworths' internal
/api/v1/*endpoints with the resulting cookies (request shapes that Woolworths can change at any time). - Spoofing browser fingerprints to get past Akamai's bot detection.
Any of this can break with no warning — a selector tweak, a payload-shape change, a fingerprint heuristic update. When that happens, this tool will fail with confusing errors until someone (you? me? a passing stranger?) digs in and fixes it.
There are no uptime promises and no fix-time SLAs. I'll patch breakage when I can be bothered and have time. If that's not soon enough for you, PRs are very welcome — see CONTRIBUTING.md. A one-line selector fix is a real contribution and will get merged fast.
Install
pipx install woolies-nz-cli
# or with uv:
uv tool install woolies-nz-cli
Don't have pipx or uv? See pipx install or uv install, or use plain pip install into a venv.
Requires Python 3.11+. Tested on macOS (Apple Silicon) and Linux. Windows untested.
First-run heads-up
Your first command that needs a browser (typically woolies login) downloads the Camoufox browser (~300MB, ~10–60s). After that, the browser is cached in ~/Library/Caches/camoufox (macOS) or ~/.cache/camoufox (Linux) and reused across runs.
Setup
woolies login
That's it. It prompts for your Woolworths NZ email + password, runs the browser login (~25s), saves the session cookies, and stores credentials at ~/.config/woolies-nz-cli/config.toml (mode 0600).
Verify with:
woolies doctor
You'll re-run woolies login only when Woolworths invalidates your session (typically every few weeks).
Alternative: environment variables
For unattended environments (CI, Docker, headless servers, scheduled jobs), skip woolies login and set:
export WOOLWORTHS_USERNAME="you@example.com"
export WOOLWORTHS_PASSWORD="your-password"
Env vars override anything in config.toml.
Alternative: password_command
If you keep secrets in 1Password / pass / Bitwarden / etc., add to ~/.config/woolies-nz-cli/config.toml:
username = "you@example.com"
password_command = "op read op://Personal/Woolies/password"
The shell command is executed and its stdout is used as the password.
Usage
Search
woolies search "milk"
woolies search "milk" --limit 20
woolies search "milk" --size 2L
woolies search "bread" --json
Output groups variants of the same product, shows brand / size / unit price / availability / category, and highlights dual-priced loose produce.
Search → cart (typical workflow)
$ woolies search "milk" --limit 3
...
SKU: 269671 | In Stock | Category: Fridge & Deli
...
$ woolies cart add 269671 2
✓ Added 2x (SKU: 269671) to cart
The SKU from search output is what cart add takes.
Cart
woolies cart list
woolies cart add <sku> <quantity>
woolies cart update <sku> <quantity>
woolies cart remove <sku>
woolies cart clear --force
Add --json to any command for structured output suitable for scripts.
Dual-priced loose produce
Some loose produce (carrots, onions, apples) supports both --unit Each and --unit Kilogram:
woolies cart add 135344 3 --unit Each # 3 carrots
woolies cart add 135344 0.45 --unit Kilogram # 450g of carrots
Search results indicate which products support dual pricing.
Inspect (debug)
Launches a visible browser with your active session. The browser stays open until Ctrl-C — useful for inspecting selectors, watching API calls in DevTools, or testing the login flow when something breaks:
woolies inspect
Logout
woolies logout
Removes saved credentials and cookies. Next woolies login will start fresh.
Privacy
- Your credentials and cookies stay on your machine. Nothing is uploaded to anywhere except
woolworths.co.nzitself, with the same data your browser would send when you log in to their website. - Credentials are stored at
~/.config/woolies-nz-cli/config.tomlwith file mode 0600 (owner read/write only). - Cookies are stored at
~/.local/state/woolies-nz-cli/cookies.json. - No telemetry, no analytics, no phone-home. The source is MIT-licensed — read it, audit it, fork it.
How it works
- httpx for fast API calls (~1s per request) using cached cookies.
- Camoufox (Firefox-based anti-detect browser) only for initial login or cookie refresh (~25s).
- Sessions persist until Woolworths invalidates them (typically a few weeks).
File locations
| What | Where |
|---|---|
| Credentials | ~/.config/woolies-nz-cli/config.toml (or $XDG_CONFIG_HOME/woolies-nz-cli/), mode 0600 |
| Cookies + screenshots | ~/.local/state/woolies-nz-cli/ (or $XDG_STATE_HOME/woolies-nz-cli/) |
| Camoufox browser | ~/Library/Caches/camoufox (macOS) / ~/.cache/camoufox (Linux) |
Optional: HTTP proxy for the browser
export WOOLIES_PROXY="http://user:pass@host:port"
Routes the Camoufox browser through a proxy. Useful for residential proxies if Akamai starts blocking your IP.
Troubleshooting
Run woolies doctor first — it diagnoses creds, paths, browser, and DNS in one go.
| Symptom | Likely cause | Fix |
|---|---|---|
Credentials not found |
Haven't logged in | Run woolies login |
Login failed: invalid credentials |
Wrong username/password | Run woolies login again |
Could not find email input field |
Woolworths changed login UI | See CONTRIBUTING.md, or open an issue |
Cannot process request |
API format changed | See CONTRIBUTING.md |
| Every run is slow (~25s) | Cookies not persisting | Check ~/.local/state/woolies-nz-cli/ is writable |
To force a fresh login:
woolies logout && woolies login
To report a bug or request a feature: GitHub issues.
Contributing
PRs welcome — see CONTRIBUTING.md. Selector and API-format fixes are especially valuable; even a one-line fix when Woolworths shifts something is a real contribution.
License
MIT © Jake McInteer
The MIT license covers the code only — it does not grant rights to redistribute scraped Woolworths product data as a dataset.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file woolies_nz_cli-0.1.1.tar.gz.
File metadata
- Download URL: woolies_nz_cli-0.1.1.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50592c52119547c2bf94210f2313adab3f12407469177b6cde7913cb4ca42158
|
|
| MD5 |
ab85bca7a33657aec64d07577853430d
|
|
| BLAKE2b-256 |
af3bda1208e8f7bb1d19516297732f4ff75e8a8673ec792326e1221d15644127
|
File details
Details for the file woolies_nz_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: woolies_nz_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0231a89e071e17ef5cf0b57b76779ac23a8779cf241db5dbbe4de66502e5285
|
|
| MD5 |
971f57912c94cba6cca06889c2a0016e
|
|
| BLAKE2b-256 |
ca3fa4c4eed8db4e16b849a3943bb16ff241363cb410ce324947597da7b3f35d
|