Metadata-Version: 2.4
Name: nz-supermarket-scraper
Version: 0.1.0
Summary: CLI to scrape fresh produce and meat prices from PAK'nSAVE, New World and Woolworths NZ (Countdown) stores.
Author-email: Liu Jie <maxazure@gmail.com>
Maintainer-email: Liu Jie <maxazure@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/maxazure/nz-supermarket-scraper
Project-URL: Repository, https://github.com/maxazure/nz-supermarket-scraper
Project-URL: Issues, https://github.com/maxazure/nz-supermarket-scraper/issues
Project-URL: Changelog, https://github.com/maxazure/nz-supermarket-scraper/releases
Keywords: new-zealand,nz,supermarket,grocery,prices,scraper,paknsave,new-world,woolworths,countdown,auckland,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: End Users/Desktop
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: Indexing/Search
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: curl_cffi>=0.7
Requires-Dist: playwright>=1.40
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Dynamic: license-file

# nz-supermarket-scraper

`nzgrocery` scrapes fresh produce and fresh meat prices from three New Zealand supermarket chains. It does not log in, add anything to a cart, or send personal data. Each run appends a new snapshot; older rows are left as they are.

The catalogues are the same guest APIs the websites call after a store is selected. Department names, aisle slugs, and skip lists were read from those APIs.

## Chains

| Chain | Also known as | How prices are read |
| --- | --- | --- |
| PAK'nSAVE | Foodstuffs | Playwright opens the homepage and reads the guest catalogue. It does not solve the Turnstile challenge. |
| New World | Foodstuffs | Same guest catalogue as PAK'nSAVE, on `newworld.co.nz`. |
| Woolworths NZ | formerly Countdown | `curl_cffi` impersonates Chrome's TLS/HTTP2 fingerprint. Akamai rejects non-browser clients. |

## Install

Python 3.10+ is required. The package on PyPI is `nz-supermarket-scraper`; it installs two identical commands, `nzgrocery` and `nz-supermarket-scraper`. No clone needed.

**pipx** (installs the command once, in its own environment):

```bash
pipx install nz-supermarket-scraper
nzgrocery install-browser        # Chromium for PAK'nSAVE / New World (one-off, ~150 MB)
nzgrocery stores --chain woolworths
```

**uvx** (runs without a permanent install):

```bash
uvx nz-supermarket-scraper stores --chain woolworths
uvx nz-supermarket-scraper install-browser
uvx nz-supermarket-scraper scrape --chain woolworths --store "Browns Bay" --dry-run
```

To keep it around with uv: `uv tool install nz-supermarket-scraper`. Plain `pip install nz-supermarket-scraper` in a virtualenv works too.

Before the first PyPI release is out, install straight from GitHub instead:

```bash
pipx install "git+https://github.com/maxazure/nz-supermarket-scraper"
uvx --from "git+https://github.com/maxazure/nz-supermarket-scraper" nzgrocery --help
```

**Browser.** Woolworths needs no browser. PAK'nSAVE and New World use Playwright's headless Chromium, which pip/pipx/uvx do not download. Run `nzgrocery install-browser` once (it calls `python -m playwright install chromium` inside the tool's own environment, so it works under pipx and uvx where a bare `playwright` command is not on your PATH). Add `--with-deps` on a bare Linux server to also install Chromium's system libraries (may need sudo). `nzgrocery install-browser --check` reports whether Chromium is present. If you forget, a PAK'nSAVE or New World scrape exits with code 3 and tells you to run it.

Upgrade with `pipx upgrade nz-supermarket-scraper` or `uv tool upgrade nz-supermarket-scraper` (`uvx` picks up new releases by itself; force it with `uvx nz-supermarket-scraper@latest`). If Playwright was upgraded, run `install-browser` again.

**From source** (development):

```bash
git clone https://github.com/maxazure/nz-supermarket-scraper.git
cd nz-supermarket-scraper
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
nzgrocery install-browser
pytest -q
```

Maintainers: releases go to PyPI through `.github/workflows/publish.yml` (Trusted Publishing on a `v*` tag). See [CONTRIBUTING.md](https://github.com/maxazure/nz-supermarket-scraper/blob/main/CONTRIBUTING.md#releasing-to-pypi).

## Usage

List the bundled Auckland stores:

```bash
nzgrocery stores
nzgrocery stores --chain paknsave
nzgrocery stores --json
```

Fetch the live store list. Without `--region`, `--live` covers all of New Zealand. `--region auckland` limits it to Auckland (Foodstuffs `regionName`, plus Woolworths areas named `Auckland…` or `Waiheke Island`).

```bash
nzgrocery stores --live
nzgrocery stores --live --region auckland --chain woolworths --json
```

Scrape. `--store` is matched against the **live** list for that chain. The bundled file is only a hint.

```bash
# Woolworths Browns Bay, fresh produce, SQLite snapshot (prices.sqlite)
nzgrocery scrape --chain woolworths --store "Browns Bay" --department produce

# New World Browns Bay meat, CSV
nzgrocery scrape --chain newworld --store "Browns Bay" --department meat \
  --format csv --output browns-bay-meat.csv

# PAK'nSAVE Albany, produce and meat, SQLite
nzgrocery scrape --chain paknsave --store Albany --department all \
  --format sqlite --output prices.sqlite

# Fetch and parse, do not write
nzgrocery scrape --chain woolworths --store "Browns Bay" --department produce --dry-run -v
```

`--format` is `sqlite` (default), `csv`, `json`, or `jsonl`. `--output -` writes CSV, JSON, or JSONL to stdout. If you omit `--output` for those formats, the file name looks like `prices-<chain>-<store>-<department>-<timestamp>.csv`.

A daily cron entry, spaced by the scraper's own 2–4 second delay:

```cron
0 7 * * * $HOME/.local/bin/nzgrocery scrape --chain paknsave --store Albany --department all
```

`python -m nzgrocery` runs the same CLI.

### Store switching

`--store` accepts a store id or a name fragment, case-insensitive.

- An exact id wins, including a Foodstuffs UUID.
- Otherwise the fragment must occur in the store name. `Browns Bay` matches `Woolworths Browns Bay` on the Woolworths list and `New World Browns Bay` on the New World list.
- `Albany` inside PAK'nSAVE matches `PAK'nSAVE Albany` only. The same word on a mixed list also matches `New World Albany`, and the command asks you to be more specific.
- If several names contain the fragment, an exact name wins (`Woolworths Ashburton` rather than `Woolworths Ashburton South`). A query that is still tied, such as `Ashburton` on Woolworths, exits with code 2 and lists the candidates.
- `PAK'nSAVE` and `PAKnSAVE` compare equal, so `PAK'nSAVE Wairau Road` matches the store named `PAKnSAVE Wairau Road`.

Nothing is written unless the site confirms the store. Foodstuffs requires the chosen name to contain the query, unless you passed the store id. Woolworths requires `GET /api/v1/shell` to report `method=Pickup`, the same pickup address id and name, and every product page's `fulfilmentStoreId` must stay on that store.

### Bundled Auckland list

`src/nzgrocery/stores/auckland.json` ships with the package so `nzgrocery stores` works offline.

Generated on 2026-10-12 from the live store APIs: **108 stores** — PAK'nSAVE 19, New World 31, Woolworths 58 (Woolworths entries are click-and-collect pickup addresses in the Auckland areas, including Waiheke Island and one rural pickup point at Kaiaua). Woolworths entries also carry `extra.fulfilment_store_id` (e.g. Woolworths Browns Bay: pickup id `2683184`, store id `9254`).

<details><summary>All bundled Auckland stores</summary>

| Chain | Store | --store id | Address |
| --- | --- | --- | --- |
| PAK'nSAVE | PAK'nSAVE Albany | `65defcf2-bc15-490e-a84f-1f13b769cd22` | Don McKinnon Drive, Albany, Auckland, 0632 |
| PAK'nSAVE | PAK'nSAVE Alderman Dr Henderson | `6c73764e-b8e6-4e55-ad37-f6a9d207da1f` | 8-18 Alderman Drive, Henderson, Auckland, 0612 |
| PAK'nSAVE | PAK'nSAVE Botany | `60561e46-ece7-43a7-b142-9b14812586e4` | 501 Ti Rakau Drive, Northpark, Auckland, 2013 |
| PAK'nSAVE | PAK'nSAVE Clendon | `3e82142c-78dc-46f3-82ec-28e65fcf84c9` | 16 Robert Ross Place, Clendon Park, Auckland, 2103 |
| PAK'nSAVE | PAK'nSAVE Glen Innes | `3404c253-577f-45ca-b301-c98312e46efb` | 182 Apirana Avenue, Glen Innes, Auckland, 1072 |
| PAK'nSAVE | PAK'nSAVE Highland Park | `2a1b331a-fc4a-496a-b072-e97cc8f70cae` | 503 - 505 Pakuranga Road, Highland Park, 2010 |
| PAK'nSAVE | PAK'nSAVE Lincoln Road | `92086ded-a55d-4241-a364-7d7ea91531b4` | 202 Lincoln Road, Henderson, Auckland, 0610 |
| PAK'nSAVE | PAK'nSAVE Mangere | `94ef1985-cab1-4b39-a2f3-230120f03c16` | 44 Orly Avenue, Mangere, Auckland, 2022 |
| PAK'nSAVE | PAK'nSAVE Manukau | `9cd8eb60-3222-4efc-bd7c-50e03e6a81a4` | 6 Cavendish Drive, Manukau City, Auckland, 2104 |
| PAK'nSAVE | PAK'nSAVE Mt Albert | `b2e98a14-c8ca-401e-99ed-edf74570c6f6` | 1167-1177 New North Road, Auckland, 1025 |
| PAK'nSAVE | PAK'nSAVE Ormiston | `5f167936-79ae-4f6a-b9d2-74afe1bb096b` | 1 Bellingham Road, Flat Bush, Auckland, 2019 |
| PAK'nSAVE | PAK'nSAVE Papakura | `a7d09522-bee2-41e4-8fe0-0b82b7f342f5` | 331-345 Great South Road, Takanini, Auckland, 2110 |
| PAK'nSAVE | PAK'nSAVE Pukekohe | `c2204dae-579e-4b6b-9d42-2e13ceaa6031` | 99 Queen Street, Pukekohe, 2120 |
| PAK'nSAVE | PAK'nSAVE Royal Oak | `e1925ea7-01bc-4358-ae7c-c6502da5ab12` | 691 Manukau Road, Royal Oak, Auckland, 1023 |
| PAK'nSAVE | PAK'nSAVE Silverdale | `64eab5b1-8d79-45f4-94f1-02b8cf8b6202` | 20 Hibiscus Coast Highway, Silverdale, Auckland, 0932 |
| PAK'nSAVE | PAK'nSAVE Sylvia Park | `c0f80e87-16be-4488-9553-da437e8c6c2a` | 286 Mt Wellington Highway, Mt Wellington, Auckland, 1060 |
| PAK'nSAVE | PAK'nSAVE Warkworth | `8f0d70be-5cb7-464b-99cb-8b0130671895` | 12 Hudson Road, Warkworth, 0910 |
| PAK'nSAVE | PAK'nSAVE Westgate | `33d8d6fc-861a-45ff-9937-5ccdb55eaede` | 17-19 Fred Taylor Drive, Massey, Auckland, 0814 |
| PAK'nSAVE | PAKnSAVE Wairau Road | `002b83de-b79d-4228-a787-bd0765b6cb56` | 30 Wairau Road, Wairau Valley, Auckland, 0627 |
| New World | New World Albany | `773ad0a0-024e-46c5-a94b-df1cf86d25cc` | 219 Don McKinnon Drive, Albany, Auckland, 0632 |
| New World | New World Birkenhead | `63190876-2bd4-4562-ae34-bb5caebab4f9` | 180 Mokoia Road, Chatswood, Auckland, 0626 |
| New World | New World Botany | `c387ac97-5e0a-43ed-9c93-f1edccda298d` | 588 Chapel Road, East Tamaki, Auckland, 2013 |
| New World | New World Browns Bay | `dbdfdd2a-55f7-4870-9b51-979286323647` | 2 Inverness Road, Browns Bay, Auckland, 0630 |
| New World | New World Devonport | `513fc849-3dbe-4333-a148-4edee5baef67` | 35 Bartley Terrace, Devonport, Auckland, 0624 |
| New World | New World Eastridge | `491d26a4-78fd-4c6e-85e9-5b67fd97e2cc` | 209 Kepa Road, Mission Bay, Auckland, 1071 |
| New World | New World Green Bay | `b6d36090-c7f4-4ff3-9343-5b48159f8f6d` | 64 Godley Road, Green Bay, Auckland, 0604 |
| New World | New World Hobsonville | `403b1c6f-121c-4945-8aa8-fa53a7e59133` | 120 Hobsonville Road, Hobsonville, Auckland, 0618 |
| New World | New World Howick | `cb3f240a-a157-490c-9e80-f537d202ef49` | 77 Union Road, Howick, Auckland, 2014 |
| New World | New World Kumeu | `686c8e35-aa87-40e9-b46e-8ffbad4713aa` | 108-110 Main Road, Kumeu, Auckland, 0810 |
| New World | New World Long Bay | `f0c21eab-1919-4cba-ac00-5b795947cdcb` | 55B Glenvar Ridge Road, Long Bay, Auckland, 0630 |
| New World | New World Metro Queen St | `60928d93-06fa-4d8f-92a6-8c359e7e846d` | 125 Queen Street, Auckland Central, Auckland, 1010 |
| New World | New World Metro Shore City | `1898a189-acf3-4320-8704-7a9cc6b3924d` | 52-56 Anzac Street, Takapuna, Auckland, 0622 |
| New World | New World Milford | `4ff026b8-a60d-4383-8f0c-6c85f5623afa` | 141 Kitchener Road, Milford, Auckland, 0620 |
| New World | New World Mt Albert | `dae2d4e3-9b97-41f4-a969-4eded0bd3554` | 1 Alberton Avenue, Mt Albert, Auckland, 1025 |
| New World | New World Mt Roskill | `3ca6692b-e2a3-4d51-95b6-d061b9541e6c` | 53 May Road, Mt Roskill, Auckland, 1041 |
| New World | New World New Lynn | `c8998066-d39b-401c-aa6b-d6d18f8d122f` | 2-6 Crown Lynn Place, New Lynn, Auckland, 0600 |
| New World | New World Newmarket | `51ee2a79-4693-410c-9287-66940847736d` | 42 Nuffield Street, Newmarket, Auckland, 1023 |
| New World | New World Orewa | `0f82d3fe-acd0-4e98-b3e7-fbabbf8b8ef5` | 11 Moana Avenue, Orewa, 0931 |
| New World | New World Ormiston | `bc0ebd13-e131-4efd-a226-415c40ce8c4e` | 240 Ormiston Road, Ormiston, Auckland, 2019 |
| New World | New World Papakura | `ef977d89-f3d8-4e8b-8a48-b895ded38646` | 29-31 East Street, Auckland, 2110 |
| New World | New World Papatoetoe | `c570bb70-c783-4692-aee1-6a1b235f9476` | 65 St Georges Street, Papatoetoe, Auckland, 2025 |
| New World | New World Point Chevalier | `871ff39f-99b5-4030-b035-b2dab7225082` | 1132 Great North Road, Point Chevalier, Auckland, 1022 |
| New World | New World Pukekohe | `c032987b-0387-4fc0-bb44-ce7510e35335` | 17 Paerata Road, Pukekohe, Auckland, 2120 |
| New World | New World Remuera | `91e4dddd-aed7-4ccc-ad0b-dfe25805a495` | 10 Clonbern Road, Remuera, Auckland, 1050 |
| New World | New World Southmall | `adcd3dee-0ead-4b84-944a-809b95e0e36b` | 187 Great South Road, Manurewa, Auckland, 2102 |
| New World | New World Stonefields | `c3a42e9d-ac58-4abf-be43-17920c720540` | 100 Lunn Avenue, Mt Wellington, Auckland, 1072 |
| New World | New World Te Atatu | `2d939bb7-ae26-4cc7-b930-d10e6a4de8a3` | 575 Te Atatū Road, Te Atatū Peninsula, Auckland, 0610 |
| New World | New World Waiuku | `0d045690-bd75-42d8-a7bc-ee44aa57fc61` | 25-49 Bowen Street, Waiuku, 2123 |
| New World | New World Warkworth | `b012c209-9dfe-48c2-940c-acf73afebed4` | 6 Percy Street, Warkworth, 0910 |
| New World | New World Whangaparaoa | `7508cf88-9fd0-4e71-b2f2-d564b1decf8d` | 580 Whangaparaoa Road, Stanmore Bay, Whangaparaoa, 0932 |
| Woolworths | Kaiaua Rays Rest Camp Reserve | `2479711` | 562 East Coast Rd,Kaiaua,Kaiaua Rays Rest Camp Reserve,Kaiaua Rays Rest Camp Reserve |
| Woolworths | Woolworths Auckland Airport | `1189112` | George Bolt Memorial & John Goulter Dr,Mangere,AKL Airport CC,2022,AKL Airport Click and Collect |
| Woolworths | Woolworths Auckland Quay Street | `1906035` | 76 Quay Street,Auckland City,Auckland City Click & Collect,Auckland City Click & Collect |
| Woolworths | Woolworths Auckland Victoria Street West | `882226` | 19-25 Victoria Street West,Vic St West Click & Collect,Auckland VSW |
| Woolworths | Woolworths Beachlands | `1109324` | 129 Beachlands Road,Beachlands Click and Collect,Beachlands Click and Collect |
| Woolworths | Woolworths Birkenhead | `2124460` | Cnr Highbury Pass & Birkenhead Avenue,Auckland,Birkenhead Click and Collect,Birkenhead Click and Collect |
| Woolworths | Woolworths Botany | `1225547` | cnr Te Irirangi & Ti Rakau Drives,Botany Downs CC,2010,Botany Downs Click and Collect |
| Woolworths | Woolworths Browns Bay | `2683184` | Cnr Anzac & Clyde Road,Browns Bay Click and Collect,0630,Browns Bay Click and Collect |
| Woolworths | Woolworths Glenfield | `1190273` | Cnr Bentley Ave & Glenfield Rd,Glenfield,Glenfield Click and Collect,0629,Glenfield Click and Collect |
| Woolworths | Woolworths Greenlane | `577581` | 326 Great South Road,Greenlane,Greenlane Click and Collect,1051,Auckland GN |
| Woolworths | Woolworths Greville Road | `3105636` | Greville Road,Greville Rd Click and Collect,Greville Rd Click and Collect |
| Woolworths | Woolworths Grey Lynn | `1906063` | 271 Richmond Road,Grey Lynn,Grey Lynn Click & Collect,Grey Lynn Click and Collect |
| Woolworths | Woolworths Helensville | `870058` | 43 Commercial Road,Helensville Click and Collect,0800,Helensville Click and Collect |
| Woolworths | Woolworths Henderson | `1230712` | West City Mall, Catherine St,Henderson,Henderson Click and Collect,0612,Henderson Click and Collect |
| Woolworths | Woolworths Highland Park | `1224920` | 507 Pakuranga Highway,Highland Park CC,2010,Highland Park Click & Collect |
| Woolworths | Woolworths Hobsonville | `1223854` | 124 Hobsonville Road,Hobsonville Click Collect,0618,Hobsonville Click and Collect |
| Woolworths | Woolworths Howick | `1237277` | 35 Cook St,Howick Click and Collect,2014,Howick Click and Collect |
| Woolworths | Woolworths Kelston | `1237272` | Cnr Great North Rd & West Coast Rd ,Kelston Click and Collect,0602,Kelston Click and Collect |
| Woolworths | Woolworths Lincoln Road | `620844` | 185 - 187 Universal Drive,Lincoln Road Click and Collect,0610,Auckland LN |
| Woolworths | Woolworths Lynfield | `1225554` | 570 Hillsborough Road,Lynfield Click and Collect,1041,Lynfield Click and Collect |
| Woolworths | Woolworths Lynnmall | `1225559` | Lynnmall Shopping Centre,Great North Road,Lynnmall Click and Collect,0600,Lynnmall Click and Collect |
| Woolworths | Woolworths Mairangi Bay | `2373714` | 3 Ramsgate Terrace,Mairangi Bay Click and Collect,0630,Mairangi Bay Click and Collect |
| Woolworths | Woolworths Mangere East | `1600626` | 359 Massey Road, Mangere East,Auckland,Mangere East Click and Collect,Mangere East Click and Collect |
| Woolworths | Woolworths Manukau | `1225677` | 652 Great South Road,Manukau Click and Collect,2104,Manukau Click and Collect |
| Woolworths | Woolworths Manukau Mall | `1906072` | Shop 99,Manukau City Centre,Manukau Mall Click and Collect,Auckland MK |
| Woolworths | Woolworths Manurewa | `1906083` | 227 Browns Road,Manurewa,Manurewa Click and Collect,Manurewa Click and Collect |
| Woolworths | Woolworths Meadowbank | `1237264` | 35-47 St Johns Rd,Meadowbank Click&Collect,1072,Meadowbank Click and Collect |
| Woolworths | Woolworths Meadowlands | `1906069` | Cnr Meadowlands Drive & Whitford Road,Howick,Meadowlands Click and Collect,Meadowlands Click and Collect |
| Woolworths | Woolworths Milford | `473644` | 143 Kitchener Road,Milford Click and Collect,Milford Click and Collect |
| Woolworths | Woolworths Mt Eden | `1906076` | Cnr Valley & Dominion Roads,Mt Eden,Mt Eden Click & Collect,Mt Eden Click and Collect |
| Woolworths | Woolworths Mt Roskill | `1906079` | 112 Stoddard Rd,Mt Roskill,Mt Roskill Click and Collect,Mt Roskill Click and Collect |
| Woolworths | Woolworths Mt Wellington | `1239981` | Cnr Penrose Rd & Mt Wellington Highway,Mt Wgtn Click&Collect, ,Mt Wellington Click and Collec |
| Woolworths | Woolworths Newmarket | `1768531` | 277 Broadway,Newmarket,Newmarket Click and Collect,Newmarket Click and Collect |
| Woolworths | Woolworths Northcote | `2124747` | Pearn Crescent,Northcote Auckland,Northcote Click and Collect,Northcote Click and Collect |
| Woolworths | Woolworths Northwest | `1230704` | 7 Fred Taylor Drive,Northwest Town Centre, Massy,OLDNorthwest Click and Collect,0614,Northwest Click and Collect |
| Woolworths | Woolworths Onehunga | `1225560` | cnr Church & Selwyn Streets,Onehunga Click and Collect,1061,Onehunga Click and Collect |
| Woolworths | Woolworths Orewa | `1225662` | Moenui Avenue,Orewa Click and Collect,0931,Orewa Click and Collect |
| Woolworths | Woolworths Pakuranga | `1488544` | Pakuranga Town Centre,Pakuranga,Pakuranga Click and Collect,Pakuranga Click and Collect |
| Woolworths | Woolworths Papakura | `1224936` | 2 Averill Street,Papakura Click and Collect,2110,Papakura Click and Collect |
| Woolworths | Woolworths Papatoetoe | `1225052` | Hunters Plaza,217 Great South Road,Papatoetoe Click and Collect,2025,Papatoetoe Click and Collect |
| Woolworths | Woolworths Ponsonby | `1996677` | 4 Williamson Avenue,Ponsonby,Ponsonby Click and Collect,Ponsonby Click and Collect |
| Woolworths | Woolworths Pt Chevalier | `882224` | 13 Point Chevalier Road,Point Chevalier,Pt Chevalier Click & Collect,Auckland PtC |
| Woolworths | Woolworths Pukekohe | `2686431` | Cnr Tobin & Seddon Lane,Pukekohe Click and Collect,2120,Pukekohe Click and Collect |
| Woolworths | Woolworths Pukekohe South | `1213289` | 186 - 192 Manukau Rd,Pukekohe,Pukekohe Sth ClC,2120,Pukekohe Sth Click and Collect |
| Woolworths | Woolworths Roselands | `2313141` | Roselands Mall,cnr Great South and Subway Roads,Roselands Click and Collect,Roselands Click and Collect |
| Woolworths | Woolworths Silverdale | `2673963` | 40 Hibiscus Coast Highway,Silverdale Click and Collect,0932,Silverdale Click and Collect |
| Woolworths | Woolworths St Johns | `1906087` | 134 - 144 Felton Mathew Avenue,St Johns,St Johns Click and Collect,St Johns Click and Collect |
| Woolworths | Woolworths St Lukes | `1225566` | St Luke Shopping Centre,cnr St Lukes Road & Morningside Drive,St Lukes Click and Collect,1025,St Lukes Click and Collect |
| Woolworths | Woolworths Sunnynook | `1231998` | Cnr Sycamore Dr & Sunnynook Rd,Sunnynook Click and Collect,0620,Sunnynook Click and Collect |
| Woolworths | Woolworths Takanini | `480066` | 228 Great South Rd,Takanini Click & Collect,Auckland TKN |
| Woolworths | Woolworths Takapuna | `1229219` | Barry's Point Rd,Takapuna Click and Collect,0622,Takapuna Click and Collect |
| Woolworths | Woolworths Te Atatu South | `1232007` | Cnr Edmonton & Te Atatu Rds,Te Atatu South,Te Atatu Sth Click and Collect,0610,Te Atatu Sth Click and Collect |
| Woolworths | Woolworths Three Kings | `1740953` | 532 Mount Albert Road,Three Kings Click and Collect ,1042,Three Kings Click and Collect |
| Woolworths | Woolworths Waiata Shores | `3059814` | 2 Periko Way, ,Waiata Shore Click and Collect,2112,Waiata Shore Click and Collect |
| Woolworths | Woolworths Waiheke | `4156860` | 13/19 Belgium Street,Ostend,CD Waiheke Click and Collect,1081,Waiheke Click and Collect |
| Woolworths | Woolworths Warkworth | `1716255` | 20-24 Neville Street,Warkworth,Warkworth Click and Collect,Warkworth Click and Collect |
| Woolworths | Woolworths Westgate | `592572` | Westgate Shopping Centre,Cnr Westgate & Fern Hill Drive Massey North,Westgate Click & Collect,0614,Auckland WG |
| Woolworths | Woolworths Whangaparaoa | `1248095` | Cnr Whangaparaoa Rd & Wade Dr,Whangaparaoa Click and Collect,0943,Whangaparaoa Click and Collect |

</details>

Regenerate it from the live APIs:

```bash
nzgrocery update-stores --output src/nzgrocery/stores/auckland.json
```

`--resolve-woolworths-ids` also selects each Woolworths pickup address on a guest session and stores `extra.fulfilment_store_id` from `/api/v1/shell`. That walks every Auckland pickup address with the same 2–4 second delay, so it is slow on purpose.

### Output schema

SQLite table `prices` (also the CSV header and the JSON objects). Rows are inserted, never updated.

| Column | Meaning |
| --- | --- |
| id | Autoincrement primary key (SQLite only) |
| scraped_at | ISO timestamp in Pacific/Auckland |
| chain | `paknsave`, `newworld`, or `woolworths` |
| store_id | Foodstuffs store UUID, or Woolworths pickup address id |
| store | Store name confirmed for this run |
| department | `produce` or `meat` |
| category | Foodstuffs category tree, or Woolworths `Department / aisle` |
| name | Product name |
| price_nzd | Shelf price in NZD. Woolworths club prices stay in `raw_price_text` |
| unit_or_size | `each`, `kg`, or the pack size |
| price_per | Comparative or cup price, such as `$3.99 / 1kg` |
| product_url | Product page on the chain's site |
| raw_price_text | Shelf price plus promo, club, or multibuy notes |
| product_id | Foodstuffs `productId` or Woolworths SKU |

Indexes: `(chain, store_id, scraped_at)` and `product_id`.

Exit codes: `0` saved (or a dry run with rows), `2` store selection or verification failed, `3` blocked or other HTTP error (Akamai 403, Cloudflare, non-200), `4` no rows. A failed run does not write a file.

### How it works

**Foodstuffs (PAK'nSAVE and New World).** The HTML shop is often a Cloudflare Turnstile page. Playwright Chromium opens the homepage and does not click the challenge. From that browser context the scraper calls the guest catalogue the site uses:

1. `POST /api/user/get-current-user` with `fingerprintUser` `nz-supermarket-scraper` and the browser user agent, for a short-lived anonymous token.
2. `GET https://api-prod.paknsave.co.nz/v1/edge/store` or `GET https://api-prod.newworld.co.nz/v1/edge/store`.
3. `POST …/search/paginated/products` filtered to `category0NI:"Fruit & Vegetables"` or `category0NI:"Meat, Poultry & Seafood"` at the chosen store.

Shelf price is `singlePrice.price` in cents, converted to NZD. Requests are spaced 2–4 seconds apart.

**Woolworths NZ.** Akamai blocks Playwright and plain Python clients by TLS fingerprint, so this uses `curl_cffi` with `impersonate="chrome"` and the guest calls the website makes:

1. `GET https://www.woolworths.co.nz/` for the guest session.
2. `GET /api/v1/addresses/pickup-addresses`.
3. `PUT /api/v1/fulfilment/my/pickup-addresses` with `{"addressId": <id>}` on that guest session.
4. `GET /api/v1/shell` must report pickup for that address id and name.
5. `GET /api/v1/products?target=browse&dasFilter=Department;;<dept>;false` (and aisle or shelf filters), with header `x-requested-with: OnlineShopping.WebApp`.

The same 2–4 second delay sits between requests. The first request of a session is not delayed.

### Departments

**Produce**

- Foodstuffs root `Fruit & Vegetables`. `Salad Toppers & Dressings` is skipped. Pet food and frozen food sit under other roots, so they are already out.
- Woolworths department `fruit-veg` (Fruit & Veg). Aisles: Fruit, Vegetables, Fresh Salad & Herbs, Prepared Fruit & Veg. The Floral aisle is excluded, and so are the Salad Toppers and In Season Floral shelves.

**Meat**

- Foodstuffs root `Meat, Poultry & Seafood`, keeping fresh beef, pork, lamb, chicken, mince, offal, game, and seafood. Skipped level-1 labels: `Deli Meats`, `Deli Meats & Smoked Fish`, `Plant Based Alternatives`, `Makeaways`, `Dairy Free & Meat Free`. Skipped level-2 labels include `Ham & Pork Slices`, `Salami & Cured Meats`, `Smoked Salmon & Fish`, `Pre-Cooked Sausages`, ready-to-eat counter items (`Breakfast Bacon and Egg Muffin`, `Chicken Burger Bacon Stack`, `Cheesy Taco Wrap`, `Meatball Sub Sandwich`), and the plant-based labels `Vegetarian Meat & Falafel`, `Chicken & Mince Alternatives`, `Plant Based Sausages & Patties`, plus `Fridge, Deli & Eggs`.
- Woolworths `meat-poultry` (Beef, Chicken & Poultry, Lamb, Pork, Venison & Game, Mince & Patties, Sausages, Offal & Bones; Plant Based Alternatives excluded) plus `fish-seafood` (Fish, Salmon, Prawns & Seafood).

Woolworths rows are the union of the aisle listings and the department listing, de-duplicated by SKU. `category` is `Department / first matching aisle`, or just the department when the product only showed up in a promo aisle such as In Season. `price_nzd` is the non-member shelf price. A club price is recorded as `$5.99; Club price $4.50`. A special is `special, was $X`. Multibuy is `2 for $8.00`. `unit_or_size` is `kg` for by-weight items, otherwise the pack size. `price_per` is the site's cup price.

### Limitations

These are undocumented APIs. Field names, category labels, and anti-bot rules change without notice. Prices are online prices and can differ from the shelf in the shop. Woolworths pricing appears to be national once a pickup store is selected; the store check is still required so a response from the wrong fulfilment store is never saved. Club and member prices are not written into `price_nzd`; they are noted in `raw_price_text`.

### Responsible use

Respect each site's terms of use and robots rules. Keep request rates low (the tool already waits 2–4 seconds between requests). This is for personal, research, and non-commercial use. Do not redistribute the scraped data in bulk.

This project is not affiliated with or endorsed by Foodstuffs North Island, Foodstuffs South Island, or Woolworths New Zealand. PAK'nSAVE, New World, and Woolworths are trademarks of their owners. Use at your own risk.

## Use as an AI agent skill

The repo ships an [Agent Skill](https://agentskills.io) that teaches AI coding agents how to install and run `nzgrocery`: finding stores, switching store with `--chain`/`--store`, scraping produce and meat, output formats, exit codes, querying the SQLite results, refreshing the store list, polite-use rules, and troubleshooting (Playwright Chromium, Akamai and Cloudflare blocks).

The source of truth is [`skills/nz-supermarket-scraper/`](https://github.com/maxazure/nz-supermarket-scraper/tree/main/skills/nz-supermarket-scraper) (`SKILL.md`, `references/`, `scripts/latest_prices.py`). Each agent's project folder holds a real copy, not a symlink, so Windows checkouts work too:

| Agent | Project skill (already in this repo) | User-level (all projects) |
| --- | --- | --- |
| Claude Code | `.claude/skills/nz-supermarket-scraper/` | `~/.claude/skills/nz-supermarket-scraper/`, or the plugin below |
| OpenAI Codex | `.agents/skills/nz-supermarket-scraper/` | `~/.agents/skills/nz-supermarket-scraper/` |
| Tencent WorkBuddy | `.workbuddy/skills/nz-supermarket-scraper/` | Upload the zip in the app, or `~/.workbuddy/skills/nz-supermarket-scraper/` |

`AGENTS.md` (read by Codex and other agents) and `CLAUDE.md` (imports `AGENTS.md`) point agents to the skill.

**Project level.** Clone the repo and open it in Claude Code, Codex, or WorkBuddy. The skill is discovered automatically. Ask something like "get Woolworths Browns Bay fruit and veg prices", or invoke it directly: `/nz-supermarket-scraper` in Claude Code, `$nz-supermarket-scraper` (or `/skills`) in Codex.

**User level, from a clone:**

```bash
git clone https://github.com/maxazure/nz-supermarket-scraper.git
cd nz-supermarket-scraper
# Claude Code
mkdir -p ~/.claude/skills && cp -R skills/nz-supermarket-scraper ~/.claude/skills/
# OpenAI Codex
mkdir -p ~/.agents/skills && cp -R skills/nz-supermarket-scraper ~/.agents/skills/
# WorkBuddy
mkdir -p ~/.workbuddy/skills && cp -R skills/nz-supermarket-scraper ~/.workbuddy/skills/
```

On macOS and Linux you can use `ln -s "$PWD/skills/nz-supermarket-scraper" ~/.claude/skills/` instead of `cp` so a `git pull` updates the skill. Claude Code and Codex both document following symlinked skill folders. For WorkBuddy, prefer a copy.

**Claude Code plugin.** The repo root is also a Claude Code plugin marketplace:

```text
/plugin marketplace add maxazure/nz-supermarket-scraper
/plugin install nz-supermarket-scraper@nz-supermarket-scraper
```

The skill then runs as `/nz-supermarket-scraper:nz-supermarket-scraper`.

**Codex skill installer.** In Codex, run `$skill-installer` and ask it to install `https://github.com/maxazure/nz-supermarket-scraper/tree/main/skills/nz-supermarket-scraper`.

**WorkBuddy upload.** Download [`nz-supermarket-scraper-skill.zip`](https://github.com/maxazure/nz-supermarket-scraper/releases/latest/download/nz-supermarket-scraper-skill.zip). `SKILL.md` sits at the root of the zip. In WorkBuddy open **Experts · Skills · Connectors → Skills → Add Skill → Upload Skill** and select the zip. WorkBuddy runs a security check and saves uploaded skills in your user configuration directory, so they work in every project.

The skill tells the agent to install the CLI itself (`pipx install nz-supermarket-scraper` or `uvx nz-supermarket-scraper`, plus `nzgrocery install-browser`) when `nzgrocery` is missing.

**Editing the skill.** Change only `skills/nz-supermarket-scraper/`, then run:

```bash
python3 scripts/sync_skills.py          # refresh the .claude / .agents / .workbuddy copies
python3 scripts/sync_skills.py --zip    # also rebuild dist/nz-supermarket-scraper-skill.zip
```

`pytest` (`tests/test_skill.py`) fails if a copy drifts, if the frontmatter leaves the portable Agent Skills fields (`name`, `description`, `license`, `compatibility`, `metadata`, `allowed-tools`), or if the helper script breaks.

Sources: Claude Code [skills](https://code.claude.com/docs/en/skills) and [plugin marketplaces](https://code.claude.com/docs/en/plugin-marketplaces). Codex [skills](https://developers.openai.com/codex/skills) and [AGENTS.md](https://developers.openai.com/codex/guides/agents-md). WorkBuddy [skills (中文)](https://www.workbuddy.cn/docs/workbuddy/From-Beginner-to-Expert-Guide/Function-Description/Skills-Market) and [Tencent Cloud](https://www.tencentcloud.com/document/product/1316/84503). WorkBuddy's official pages describe zip upload and say a skill can live in a "project skills directory" or the user configuration directory, but they do not name the folders. The `.workbuddy/skills` and `~/.workbuddy/skills` paths come from community projects and the [vercel-labs/skills WorkBuddy entry](https://github.com/vercel-labs/skills/issues/1353). If your WorkBuddy build doesn't pick up the folder, use the zip upload.

---

# nz-supermarket-scraper（简体中文）

`nzgrocery` 从新西兰三家超市抓取新鲜果蔬和新鲜肉类的价格。它不登录、不加购物车、也不提交任何个人数据。每次运行只追加一份新的价格快照，已有记录保持原样。

价格来自这些网站在选定门店之后自己调用的访客目录接口。部门名称、货架 slug 和跳过列表都是从这些接口里读到的，不是凭空编的。

## 支持的连锁

| 连锁 | 说明 | 读取方式 |
| --- | --- | --- |
| PAK'nSAVE | Foodstuffs | Playwright 打开首页，再读访客目录。不破解、不点击 Turnstile 人机验证。 |
| New World | Foodstuffs | 与 PAK'nSAVE 相同的访客目录，站点是 `newworld.co.nz`。 |
| Woolworths NZ | 前身为 Countdown | `curl_cffi` 模拟 Chrome 的 TLS/HTTP2 指纹。Akamai 会拒绝非浏览器客户端。 |

## 安装

需要 Python 3.10 以上。PyPI 上的包名是 `nz-supermarket-scraper`，装好后有两个完全一样的命令：`nzgrocery` 和 `nz-supermarket-scraper`。不用下载源代码。

**pipx**（装一次，独立环境，命令一直可用）：

```bash
pipx install nz-supermarket-scraper
nzgrocery install-browser        # 给 PAK'nSAVE / New World 下载 Chromium（只需一次，约 150 MB）
nzgrocery stores --chain woolworths
```

**uvx**（不用正式安装，直接运行）：

```bash
uvx nz-supermarket-scraper stores --chain woolworths
uvx nz-supermarket-scraper install-browser
uvx nz-supermarket-scraper scrape --chain woolworths --store "Browns Bay" --dry-run
```

想用 uv 长期安装：`uv tool install nz-supermarket-scraper`。在虚拟环境里直接 `pip install nz-supermarket-scraper` 也可以。

在第一个 PyPI 版本发布之前，可以直接从 GitHub 安装：

```bash
pipx install "git+https://github.com/maxazure/nz-supermarket-scraper"
uvx --from "git+https://github.com/maxazure/nz-supermarket-scraper" nzgrocery --help
```

**浏览器。** Woolworths 不需要浏览器。PAK'nSAVE 和 New World 要用 Playwright 的无头 Chromium，pip/pipx/uvx 安装时不会自动下载。装好后运行一次 `nzgrocery install-browser` 即可（它在工具自己的环境里执行 `python -m playwright install chromium`，所以在 pipx 和 uvx 下也能用，这时 PATH 上并没有单独的 `playwright` 命令）。在全新的 Linux 服务器上加 `--with-deps`，顺便装 Chromium 需要的系统库（可能要 sudo）。`nzgrocery install-browser --check` 可以检查 Chromium 是否已装好。如果忘了装，抓 PAK'nSAVE 或 New World 时会以退出码 3 结束，并提示你运行这个命令。

升级：`pipx upgrade nz-supermarket-scraper` 或 `uv tool upgrade nz-supermarket-scraper`（`uvx` 会自己用新版本，想强制更新就用 `uvx nz-supermarket-scraper@latest`）。如果 Playwright 也升级了，再运行一次 `install-browser`。

**从源码安装**（开发用）：

```bash
git clone https://github.com/maxazure/nz-supermarket-scraper.git
cd nz-supermarket-scraper
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'
nzgrocery install-browser
pytest -q
```

维护者：发布到 PyPI 走 `.github/workflows/publish.yml`（推送 `v*` 标签后通过 Trusted Publishing 自动上传，不需要在 GitHub 存 token）。详见 [CONTRIBUTING.md](https://github.com/maxazure/nz-supermarket-scraper/blob/main/CONTRIBUTING.md#releasing-to-pypi)。

## 用法

列出随包附带的奥克兰门店：

```bash
nzgrocery stores
nzgrocery stores --chain paknsave
nzgrocery stores --json
```

拉取线上门店列表。只加 `--live` 时覆盖新西兰全国。`--region auckland` 把范围限制在奥克兰：Foodstuffs 看 `regionName`，Woolworths 看名称以 `Auckland` 开头的区域，以及 `Waiheke Island`。

```bash
nzgrocery stores --live
nzgrocery stores --live --region auckland --chain woolworths --json
```

抓取价格。`--store` 对着该连锁的**线上**门店列表匹配。附带的清单只用来提前提示，不是最终依据。

```bash
# Woolworths Browns Bay，新鲜果蔬，写入 SQLite（prices.sqlite）
nzgrocery scrape --chain woolworths --store "Browns Bay" --department produce

# New World Browns Bay 肉类，CSV
nzgrocery scrape --chain newworld --store "Browns Bay" --department meat \
  --format csv --output browns-bay-meat.csv

# PAK'nSAVE Albany，果蔬和肉类都抓，SQLite
nzgrocery scrape --chain paknsave --store Albany --department all \
  --format sqlite --output prices.sqlite

# 只抓取和解析，不写文件
nzgrocery scrape --chain woolworths --store "Browns Bay" --department produce --dry-run -v
```

`--format` 可以是 `sqlite`（默认）、`csv`、`json` 或 `jsonl`。`--output -` 把 CSV、JSON 或 JSONL 打到标准输出。这三种格式如果省略 `--output`，文件名类似 `prices-<chain>-<store>-<department>-<timestamp>.csv`。

每天跑一次的 cron 示例。请求间隔由程序自己控制在 2–4 秒：

```cron
0 7 * * * $HOME/.local/bin/nzgrocery scrape --chain paknsave --store Albany --department all
```

`python -m nzgrocery` 是同一套命令。

### 切换门店

`--store` 可以是门店 id，也可以是名称片段，不区分大小写。

- 精确的 id 优先，包括 Foodstuffs 的 UUID。
- 否则片段必须出现在店名里。在 Woolworths 列表上，`Browns Bay` 对应 `Woolworths Browns Bay`；在 New World 列表上对应 `New World Browns Bay`。
- 只在 PAK'nSAVE 里搜 `Albany`，只会命中 `PAK'nSAVE Albany`。混在一起搜时，`New World Albany` 也会命中，命令会要求你写得更具体。
- 多个店名都包含该片段时，完整店名优先（例如 `Woolworths Ashburton`，而不是 `Woolworths Ashburton South`）。仍然分不清的查询，比如 Woolworths 里的 `Ashburton`，以退出码 2 结束，并列出候选店。
- `PAK'nSAVE` 和 `PAKnSAVE` 视为相同，因此 `PAK'nSAVE Wairau Road` 能匹配店名 `PAKnSAVE Wairau Road`。

站点没有确认门店之前，不会写任何文件。Foodstuffs：除非你给的是门店 id，否则选中的店名必须包含查询词。Woolworths：`GET /api/v1/shell` 必须返回 `method=Pickup`、同一个自提地址 id 和店名，并且每一页商品的 `fulfilmentStoreId` 都必须仍是这家店。

### 附带的奥克兰门店清单

`src/nzgrocery/stores/auckland.json` 随包发布，所以 `nzgrocery stores` 可以离线使用。

清单于 2026-10-12 从各家线上门店接口生成：**共 108 家** —— PAK'nSAVE 19 家、New World 31 家、Woolworths 58 家（Woolworths 是奥克兰各区域的自提地址，包括 Waiheke 岛和 Kaiaua 的一个乡村自提点）。Woolworths 条目还带有 `extra.fulfilment_store_id`（例如 Woolworths Browns Bay：自提 id `2683184`，门店 id `9254`）。

<details><summary>全部奥克兰门店</summary>

| Chain | Store | --store id | Address |
| --- | --- | --- | --- |
| PAK'nSAVE | PAK'nSAVE Albany | `65defcf2-bc15-490e-a84f-1f13b769cd22` | Don McKinnon Drive, Albany, Auckland, 0632 |
| PAK'nSAVE | PAK'nSAVE Alderman Dr Henderson | `6c73764e-b8e6-4e55-ad37-f6a9d207da1f` | 8-18 Alderman Drive, Henderson, Auckland, 0612 |
| PAK'nSAVE | PAK'nSAVE Botany | `60561e46-ece7-43a7-b142-9b14812586e4` | 501 Ti Rakau Drive, Northpark, Auckland, 2013 |
| PAK'nSAVE | PAK'nSAVE Clendon | `3e82142c-78dc-46f3-82ec-28e65fcf84c9` | 16 Robert Ross Place, Clendon Park, Auckland, 2103 |
| PAK'nSAVE | PAK'nSAVE Glen Innes | `3404c253-577f-45ca-b301-c98312e46efb` | 182 Apirana Avenue, Glen Innes, Auckland, 1072 |
| PAK'nSAVE | PAK'nSAVE Highland Park | `2a1b331a-fc4a-496a-b072-e97cc8f70cae` | 503 - 505 Pakuranga Road, Highland Park, 2010 |
| PAK'nSAVE | PAK'nSAVE Lincoln Road | `92086ded-a55d-4241-a364-7d7ea91531b4` | 202 Lincoln Road, Henderson, Auckland, 0610 |
| PAK'nSAVE | PAK'nSAVE Mangere | `94ef1985-cab1-4b39-a2f3-230120f03c16` | 44 Orly Avenue, Mangere, Auckland, 2022 |
| PAK'nSAVE | PAK'nSAVE Manukau | `9cd8eb60-3222-4efc-bd7c-50e03e6a81a4` | 6 Cavendish Drive, Manukau City, Auckland, 2104 |
| PAK'nSAVE | PAK'nSAVE Mt Albert | `b2e98a14-c8ca-401e-99ed-edf74570c6f6` | 1167-1177 New North Road, Auckland, 1025 |
| PAK'nSAVE | PAK'nSAVE Ormiston | `5f167936-79ae-4f6a-b9d2-74afe1bb096b` | 1 Bellingham Road, Flat Bush, Auckland, 2019 |
| PAK'nSAVE | PAK'nSAVE Papakura | `a7d09522-bee2-41e4-8fe0-0b82b7f342f5` | 331-345 Great South Road, Takanini, Auckland, 2110 |
| PAK'nSAVE | PAK'nSAVE Pukekohe | `c2204dae-579e-4b6b-9d42-2e13ceaa6031` | 99 Queen Street, Pukekohe, 2120 |
| PAK'nSAVE | PAK'nSAVE Royal Oak | `e1925ea7-01bc-4358-ae7c-c6502da5ab12` | 691 Manukau Road, Royal Oak, Auckland, 1023 |
| PAK'nSAVE | PAK'nSAVE Silverdale | `64eab5b1-8d79-45f4-94f1-02b8cf8b6202` | 20 Hibiscus Coast Highway, Silverdale, Auckland, 0932 |
| PAK'nSAVE | PAK'nSAVE Sylvia Park | `c0f80e87-16be-4488-9553-da437e8c6c2a` | 286 Mt Wellington Highway, Mt Wellington, Auckland, 1060 |
| PAK'nSAVE | PAK'nSAVE Warkworth | `8f0d70be-5cb7-464b-99cb-8b0130671895` | 12 Hudson Road, Warkworth, 0910 |
| PAK'nSAVE | PAK'nSAVE Westgate | `33d8d6fc-861a-45ff-9937-5ccdb55eaede` | 17-19 Fred Taylor Drive, Massey, Auckland, 0814 |
| PAK'nSAVE | PAKnSAVE Wairau Road | `002b83de-b79d-4228-a787-bd0765b6cb56` | 30 Wairau Road, Wairau Valley, Auckland, 0627 |
| New World | New World Albany | `773ad0a0-024e-46c5-a94b-df1cf86d25cc` | 219 Don McKinnon Drive, Albany, Auckland, 0632 |
| New World | New World Birkenhead | `63190876-2bd4-4562-ae34-bb5caebab4f9` | 180 Mokoia Road, Chatswood, Auckland, 0626 |
| New World | New World Botany | `c387ac97-5e0a-43ed-9c93-f1edccda298d` | 588 Chapel Road, East Tamaki, Auckland, 2013 |
| New World | New World Browns Bay | `dbdfdd2a-55f7-4870-9b51-979286323647` | 2 Inverness Road, Browns Bay, Auckland, 0630 |
| New World | New World Devonport | `513fc849-3dbe-4333-a148-4edee5baef67` | 35 Bartley Terrace, Devonport, Auckland, 0624 |
| New World | New World Eastridge | `491d26a4-78fd-4c6e-85e9-5b67fd97e2cc` | 209 Kepa Road, Mission Bay, Auckland, 1071 |
| New World | New World Green Bay | `b6d36090-c7f4-4ff3-9343-5b48159f8f6d` | 64 Godley Road, Green Bay, Auckland, 0604 |
| New World | New World Hobsonville | `403b1c6f-121c-4945-8aa8-fa53a7e59133` | 120 Hobsonville Road, Hobsonville, Auckland, 0618 |
| New World | New World Howick | `cb3f240a-a157-490c-9e80-f537d202ef49` | 77 Union Road, Howick, Auckland, 2014 |
| New World | New World Kumeu | `686c8e35-aa87-40e9-b46e-8ffbad4713aa` | 108-110 Main Road, Kumeu, Auckland, 0810 |
| New World | New World Long Bay | `f0c21eab-1919-4cba-ac00-5b795947cdcb` | 55B Glenvar Ridge Road, Long Bay, Auckland, 0630 |
| New World | New World Metro Queen St | `60928d93-06fa-4d8f-92a6-8c359e7e846d` | 125 Queen Street, Auckland Central, Auckland, 1010 |
| New World | New World Metro Shore City | `1898a189-acf3-4320-8704-7a9cc6b3924d` | 52-56 Anzac Street, Takapuna, Auckland, 0622 |
| New World | New World Milford | `4ff026b8-a60d-4383-8f0c-6c85f5623afa` | 141 Kitchener Road, Milford, Auckland, 0620 |
| New World | New World Mt Albert | `dae2d4e3-9b97-41f4-a969-4eded0bd3554` | 1 Alberton Avenue, Mt Albert, Auckland, 1025 |
| New World | New World Mt Roskill | `3ca6692b-e2a3-4d51-95b6-d061b9541e6c` | 53 May Road, Mt Roskill, Auckland, 1041 |
| New World | New World New Lynn | `c8998066-d39b-401c-aa6b-d6d18f8d122f` | 2-6 Crown Lynn Place, New Lynn, Auckland, 0600 |
| New World | New World Newmarket | `51ee2a79-4693-410c-9287-66940847736d` | 42 Nuffield Street, Newmarket, Auckland, 1023 |
| New World | New World Orewa | `0f82d3fe-acd0-4e98-b3e7-fbabbf8b8ef5` | 11 Moana Avenue, Orewa, 0931 |
| New World | New World Ormiston | `bc0ebd13-e131-4efd-a226-415c40ce8c4e` | 240 Ormiston Road, Ormiston, Auckland, 2019 |
| New World | New World Papakura | `ef977d89-f3d8-4e8b-8a48-b895ded38646` | 29-31 East Street, Auckland, 2110 |
| New World | New World Papatoetoe | `c570bb70-c783-4692-aee1-6a1b235f9476` | 65 St Georges Street, Papatoetoe, Auckland, 2025 |
| New World | New World Point Chevalier | `871ff39f-99b5-4030-b035-b2dab7225082` | 1132 Great North Road, Point Chevalier, Auckland, 1022 |
| New World | New World Pukekohe | `c032987b-0387-4fc0-bb44-ce7510e35335` | 17 Paerata Road, Pukekohe, Auckland, 2120 |
| New World | New World Remuera | `91e4dddd-aed7-4ccc-ad0b-dfe25805a495` | 10 Clonbern Road, Remuera, Auckland, 1050 |
| New World | New World Southmall | `adcd3dee-0ead-4b84-944a-809b95e0e36b` | 187 Great South Road, Manurewa, Auckland, 2102 |
| New World | New World Stonefields | `c3a42e9d-ac58-4abf-be43-17920c720540` | 100 Lunn Avenue, Mt Wellington, Auckland, 1072 |
| New World | New World Te Atatu | `2d939bb7-ae26-4cc7-b930-d10e6a4de8a3` | 575 Te Atatū Road, Te Atatū Peninsula, Auckland, 0610 |
| New World | New World Waiuku | `0d045690-bd75-42d8-a7bc-ee44aa57fc61` | 25-49 Bowen Street, Waiuku, 2123 |
| New World | New World Warkworth | `b012c209-9dfe-48c2-940c-acf73afebed4` | 6 Percy Street, Warkworth, 0910 |
| New World | New World Whangaparaoa | `7508cf88-9fd0-4e71-b2f2-d564b1decf8d` | 580 Whangaparaoa Road, Stanmore Bay, Whangaparaoa, 0932 |
| Woolworths | Kaiaua Rays Rest Camp Reserve | `2479711` | 562 East Coast Rd,Kaiaua,Kaiaua Rays Rest Camp Reserve,Kaiaua Rays Rest Camp Reserve |
| Woolworths | Woolworths Auckland Airport | `1189112` | George Bolt Memorial & John Goulter Dr,Mangere,AKL Airport CC,2022,AKL Airport Click and Collect |
| Woolworths | Woolworths Auckland Quay Street | `1906035` | 76 Quay Street,Auckland City,Auckland City Click & Collect,Auckland City Click & Collect |
| Woolworths | Woolworths Auckland Victoria Street West | `882226` | 19-25 Victoria Street West,Vic St West Click & Collect,Auckland VSW |
| Woolworths | Woolworths Beachlands | `1109324` | 129 Beachlands Road,Beachlands Click and Collect,Beachlands Click and Collect |
| Woolworths | Woolworths Birkenhead | `2124460` | Cnr Highbury Pass & Birkenhead Avenue,Auckland,Birkenhead Click and Collect,Birkenhead Click and Collect |
| Woolworths | Woolworths Botany | `1225547` | cnr Te Irirangi & Ti Rakau Drives,Botany Downs CC,2010,Botany Downs Click and Collect |
| Woolworths | Woolworths Browns Bay | `2683184` | Cnr Anzac & Clyde Road,Browns Bay Click and Collect,0630,Browns Bay Click and Collect |
| Woolworths | Woolworths Glenfield | `1190273` | Cnr Bentley Ave & Glenfield Rd,Glenfield,Glenfield Click and Collect,0629,Glenfield Click and Collect |
| Woolworths | Woolworths Greenlane | `577581` | 326 Great South Road,Greenlane,Greenlane Click and Collect,1051,Auckland GN |
| Woolworths | Woolworths Greville Road | `3105636` | Greville Road,Greville Rd Click and Collect,Greville Rd Click and Collect |
| Woolworths | Woolworths Grey Lynn | `1906063` | 271 Richmond Road,Grey Lynn,Grey Lynn Click & Collect,Grey Lynn Click and Collect |
| Woolworths | Woolworths Helensville | `870058` | 43 Commercial Road,Helensville Click and Collect,0800,Helensville Click and Collect |
| Woolworths | Woolworths Henderson | `1230712` | West City Mall, Catherine St,Henderson,Henderson Click and Collect,0612,Henderson Click and Collect |
| Woolworths | Woolworths Highland Park | `1224920` | 507 Pakuranga Highway,Highland Park CC,2010,Highland Park Click & Collect |
| Woolworths | Woolworths Hobsonville | `1223854` | 124 Hobsonville Road,Hobsonville Click Collect,0618,Hobsonville Click and Collect |
| Woolworths | Woolworths Howick | `1237277` | 35 Cook St,Howick Click and Collect,2014,Howick Click and Collect |
| Woolworths | Woolworths Kelston | `1237272` | Cnr Great North Rd & West Coast Rd ,Kelston Click and Collect,0602,Kelston Click and Collect |
| Woolworths | Woolworths Lincoln Road | `620844` | 185 - 187 Universal Drive,Lincoln Road Click and Collect,0610,Auckland LN |
| Woolworths | Woolworths Lynfield | `1225554` | 570 Hillsborough Road,Lynfield Click and Collect,1041,Lynfield Click and Collect |
| Woolworths | Woolworths Lynnmall | `1225559` | Lynnmall Shopping Centre,Great North Road,Lynnmall Click and Collect,0600,Lynnmall Click and Collect |
| Woolworths | Woolworths Mairangi Bay | `2373714` | 3 Ramsgate Terrace,Mairangi Bay Click and Collect,0630,Mairangi Bay Click and Collect |
| Woolworths | Woolworths Mangere East | `1600626` | 359 Massey Road, Mangere East,Auckland,Mangere East Click and Collect,Mangere East Click and Collect |
| Woolworths | Woolworths Manukau | `1225677` | 652 Great South Road,Manukau Click and Collect,2104,Manukau Click and Collect |
| Woolworths | Woolworths Manukau Mall | `1906072` | Shop 99,Manukau City Centre,Manukau Mall Click and Collect,Auckland MK |
| Woolworths | Woolworths Manurewa | `1906083` | 227 Browns Road,Manurewa,Manurewa Click and Collect,Manurewa Click and Collect |
| Woolworths | Woolworths Meadowbank | `1237264` | 35-47 St Johns Rd,Meadowbank Click&Collect,1072,Meadowbank Click and Collect |
| Woolworths | Woolworths Meadowlands | `1906069` | Cnr Meadowlands Drive & Whitford Road,Howick,Meadowlands Click and Collect,Meadowlands Click and Collect |
| Woolworths | Woolworths Milford | `473644` | 143 Kitchener Road,Milford Click and Collect,Milford Click and Collect |
| Woolworths | Woolworths Mt Eden | `1906076` | Cnr Valley & Dominion Roads,Mt Eden,Mt Eden Click & Collect,Mt Eden Click and Collect |
| Woolworths | Woolworths Mt Roskill | `1906079` | 112 Stoddard Rd,Mt Roskill,Mt Roskill Click and Collect,Mt Roskill Click and Collect |
| Woolworths | Woolworths Mt Wellington | `1239981` | Cnr Penrose Rd & Mt Wellington Highway,Mt Wgtn Click&Collect, ,Mt Wellington Click and Collec |
| Woolworths | Woolworths Newmarket | `1768531` | 277 Broadway,Newmarket,Newmarket Click and Collect,Newmarket Click and Collect |
| Woolworths | Woolworths Northcote | `2124747` | Pearn Crescent,Northcote Auckland,Northcote Click and Collect,Northcote Click and Collect |
| Woolworths | Woolworths Northwest | `1230704` | 7 Fred Taylor Drive,Northwest Town Centre, Massy,OLDNorthwest Click and Collect,0614,Northwest Click and Collect |
| Woolworths | Woolworths Onehunga | `1225560` | cnr Church & Selwyn Streets,Onehunga Click and Collect,1061,Onehunga Click and Collect |
| Woolworths | Woolworths Orewa | `1225662` | Moenui Avenue,Orewa Click and Collect,0931,Orewa Click and Collect |
| Woolworths | Woolworths Pakuranga | `1488544` | Pakuranga Town Centre,Pakuranga,Pakuranga Click and Collect,Pakuranga Click and Collect |
| Woolworths | Woolworths Papakura | `1224936` | 2 Averill Street,Papakura Click and Collect,2110,Papakura Click and Collect |
| Woolworths | Woolworths Papatoetoe | `1225052` | Hunters Plaza,217 Great South Road,Papatoetoe Click and Collect,2025,Papatoetoe Click and Collect |
| Woolworths | Woolworths Ponsonby | `1996677` | 4 Williamson Avenue,Ponsonby,Ponsonby Click and Collect,Ponsonby Click and Collect |
| Woolworths | Woolworths Pt Chevalier | `882224` | 13 Point Chevalier Road,Point Chevalier,Pt Chevalier Click & Collect,Auckland PtC |
| Woolworths | Woolworths Pukekohe | `2686431` | Cnr Tobin & Seddon Lane,Pukekohe Click and Collect,2120,Pukekohe Click and Collect |
| Woolworths | Woolworths Pukekohe South | `1213289` | 186 - 192 Manukau Rd,Pukekohe,Pukekohe Sth ClC,2120,Pukekohe Sth Click and Collect |
| Woolworths | Woolworths Roselands | `2313141` | Roselands Mall,cnr Great South and Subway Roads,Roselands Click and Collect,Roselands Click and Collect |
| Woolworths | Woolworths Silverdale | `2673963` | 40 Hibiscus Coast Highway,Silverdale Click and Collect,0932,Silverdale Click and Collect |
| Woolworths | Woolworths St Johns | `1906087` | 134 - 144 Felton Mathew Avenue,St Johns,St Johns Click and Collect,St Johns Click and Collect |
| Woolworths | Woolworths St Lukes | `1225566` | St Luke Shopping Centre,cnr St Lukes Road & Morningside Drive,St Lukes Click and Collect,1025,St Lukes Click and Collect |
| Woolworths | Woolworths Sunnynook | `1231998` | Cnr Sycamore Dr & Sunnynook Rd,Sunnynook Click and Collect,0620,Sunnynook Click and Collect |
| Woolworths | Woolworths Takanini | `480066` | 228 Great South Rd,Takanini Click & Collect,Auckland TKN |
| Woolworths | Woolworths Takapuna | `1229219` | Barry's Point Rd,Takapuna Click and Collect,0622,Takapuna Click and Collect |
| Woolworths | Woolworths Te Atatu South | `1232007` | Cnr Edmonton & Te Atatu Rds,Te Atatu South,Te Atatu Sth Click and Collect,0610,Te Atatu Sth Click and Collect |
| Woolworths | Woolworths Three Kings | `1740953` | 532 Mount Albert Road,Three Kings Click and Collect ,1042,Three Kings Click and Collect |
| Woolworths | Woolworths Waiata Shores | `3059814` | 2 Periko Way, ,Waiata Shore Click and Collect,2112,Waiata Shore Click and Collect |
| Woolworths | Woolworths Waiheke | `4156860` | 13/19 Belgium Street,Ostend,CD Waiheke Click and Collect,1081,Waiheke Click and Collect |
| Woolworths | Woolworths Warkworth | `1716255` | 20-24 Neville Street,Warkworth,Warkworth Click and Collect,Warkworth Click and Collect |
| Woolworths | Woolworths Westgate | `592572` | Westgate Shopping Centre,Cnr Westgate & Fern Hill Drive Massey North,Westgate Click & Collect,0614,Auckland WG |
| Woolworths | Woolworths Whangaparaoa | `1248095` | Cnr Whangaparaoa Rd & Wade Dr,Whangaparaoa Click and Collect,0943,Whangaparaoa Click and Collect |

</details>

用线上接口重新生成：

```bash
nzgrocery update-stores --output src/nzgrocery/stores/auckland.json
```

`--resolve-woolworths-ids` 会在一个访客会话里逐个选中 Woolworths 自提地址，并从 `/api/v1/shell` 记下 `extra.fulfilment_store_id`。奥克兰每一家都会走一遍，请求之间同样等待 2–4 秒，所以会比较慢。

### 输出字段

SQLite 表 `prices`（CSV 表头和 JSON 对象用同一套字段）。只插入，不更新。

| 字段 | 含义 |
| --- | --- |
| id | 自增主键（仅 SQLite） |
| scraped_at | Pacific/Auckland 时区的 ISO 时间 |
| chain | `paknsave`、`newworld` 或 `woolworths` |
| store_id | Foodstuffs 门店 UUID，或 Woolworths 自提地址 id |
| store | 本次确认下来的店名 |
| department | `produce`（果蔬）或 `meat`（肉类） |
| category | Foodstuffs 分类树，或 Woolworths 的 `部门 / 货架` |
| name | 商品名 |
| price_nzd | 货架价，新西兰元。Woolworths 会员价写在 `raw_price_text` |
| unit_or_size | `each`、`kg`，或包装规格 |
| price_per | 对比价或杯价，例如 `$3.99 / 1kg` |
| product_url | 该连锁网站上的商品页 |
| raw_price_text | 货架价，以及促销、会员价、多件价备注 |
| product_id | Foodstuffs 的 `productId`，或 Woolworths SKU |

索引：`(chain, store_id, scraped_at)` 和 `product_id`。

退出码：`0` 已保存（或演练运行且解析出了行），`2` 门店选择或校验失败，`3` 被拦截或其他 HTTP 错误（Akamai 403、Cloudflare、非 200），`4` 没有商品行。失败时不写文件。

### 工作原理

**Foodstuffs（PAK'nSAVE 和 New World）。** 商店 HTML 经常是 Cloudflare Turnstile 页面。Playwright Chromium 打开首页，不点击验证。随后在这个浏览器上下文里调用网站自己的访客目录：

1. `POST /api/user/get-current-user`，`fingerprintUser` 为 `nz-supermarket-scraper`，`fingerprintGuest` 为浏览器 UA，用来换一个短时匿名 token。
2. `GET https://api-prod.paknsave.co.nz/v1/edge/store` 或 `GET https://api-prod.newworld.co.nz/v1/edge/store`。
3. `POST …/search/paginated/products`，按所选门店过滤 `category0NI:"Fruit & Vegetables"` 或 `category0NI:"Meat, Poultry & Seafood"`。

货架价是 `singlePrice.price`，单位是分，再换成新西兰元。请求之间间隔 2–4 秒。

**Woolworths NZ。** Akamai 会按 TLS 指纹拦截 Playwright 和普通 Python 客户端，因此这里用 `curl_cffi` 的 `impersonate="chrome"`，并走网站自己的访客调用：

1. `GET https://www.woolworths.co.nz/`，拿到访客会话。
2. `GET /api/v1/addresses/pickup-addresses`。
3. 在该访客会话上 `PUT /api/v1/fulfilment/my/pickup-addresses`，正文为 `{"addressId": <id>}`。
4. `GET /api/v1/shell` 必须确认该地址 id 和店名的自提方式。
5. `GET /api/v1/products?target=browse&dasFilter=Department;;<dept>;false`（可再加货架或层架过滤），请求头带 `x-requested-with: OnlineShopping.WebApp`。

请求之间同样间隔 2–4 秒。一次会话的第一个请求不等待。

### 部门范围

**果蔬（produce）**

- Foodstuffs 根分类 `Fruit & Vegetables`。跳过 `Salad Toppers & Dressings`。宠物食品和冷冻食品属于别的根分类，本来就不会进来。
- Woolworths 部门 `fruit-veg`（Fruit & Veg）。货架：Fruit、Vegetables、Fresh Salad & Herbs、Prepared Fruit & Veg。排除 Floral 货架，以及 Salad Toppers 和 In Season Floral 层架。

**肉类（meat）**

- Foodstuffs 根分类 `Meat, Poultry & Seafood`，保留新鲜牛肉、猪肉、羊肉、鸡肉、肉末、内脏、野味和海鲜。跳过的一级分类：`Deli Meats`、`Deli Meats & Smoked Fish`、`Plant Based Alternatives`、`Makeaways`、`Dairy Free & Meat Free`。跳过的二级分类包括 `Ham & Pork Slices`、`Salami & Cured Meats`、`Smoked Salmon & Fish`、`Pre-Cooked Sausages`，热食柜台的 `Breakfast Bacon and Egg Muffin`、`Chicken Burger Bacon Stack`、`Cheesy Taco Wrap`、`Meatball Sub Sandwich`，以及植物基的 `Vegetarian Meat & Falafel`、`Chicken & Mince Alternatives`、`Plant Based Sausages & Patties`，还有 `Fridge, Deli & Eggs`。
- Woolworths 的 `meat-poultry`（Beef、Chicken & Poultry、Lamb、Pork、Venison & Game、Mince & Patties、Sausages、Offal & Bones；排除 Plant Based Alternatives）加上 `fish-seafood`（Fish、Salmon、Prawns & Seafood）。

Woolworths 的结果是各货架列表和整个部门列表的并集，按 SKU 去重。`category` 写成 `部门 / 第一个匹配的货架`；如果商品只出现在 In Season 这类促销货架里，则只写部门名。`price_nzd` 是非会员货架价。会员价记成 `$5.99; Club price $4.50`。特价记成 `special, was $X`。多件价记成 `2 for $8.00`。按重量卖的商品 `unit_or_size` 为 `kg`，否则是包装规格。`price_per` 是网站给出的杯价。

### 局限

这些接口没有公开文档。字段名、分类标签和反爬规则都可能在不通知的情况下改变。抓到的是线上价格，可能和店内货架价不同。Woolworths 在选定自提门店之后，价格看起来是全国统一的；尽管如此，仍然要核对门店，避免把别的履约门店的响应存下来。会员价不会写入 `price_nzd`，只出现在 `raw_price_text`。

### 使用时请守规矩

请遵守各网站的使用条款和 robots 规则。把请求频率压低（这个工具已经在每次请求之间等待 2–4 秒）。仅供个人、研究和非商业使用。不要批量转发抓到的数据。

本项目与 Foodstuffs North Island、Foodstuffs South Island、Woolworths New Zealand 没有关联，也未获其认可。PAK'nSAVE、New World 和 Woolworths 是各自权利人的商标。使用风险由你自己承担。

## 作为 AI 智能体技能（Agent Skill）使用

仓库里带了一个 [Agent Skill](https://agentskills.io)，教 AI 编程助手安装和使用 `nzgrocery`。内容包括：查找门店，用 `--chain`/`--store` 切换门店，抓取果蔬和肉类，输出格式，退出码，查询 SQLite 结果，刷新门店清单，礼貌使用规则，以及排错（Playwright Chromium、Akamai 和 Cloudflare 拦截）。

唯一的源文件在 [`skills/nz-supermarket-scraper/`](https://github.com/maxazure/nz-supermarket-scraper/tree/main/skills/nz-supermarket-scraper)（`SKILL.md`、`references/`、`scripts/latest_prices.py`）。各个智能体的项目目录里放的是真实副本，不是软链接，所以 Windows 上也能用：

| 智能体 | 项目级（本仓库已自带） | 用户级（所有项目可用） |
| --- | --- | --- |
| Claude Code | `.claude/skills/nz-supermarket-scraper/` | `~/.claude/skills/nz-supermarket-scraper/`，或者用下面的插件 |
| OpenAI Codex | `.agents/skills/nz-supermarket-scraper/` | `~/.agents/skills/nz-supermarket-scraper/` |
| 腾讯 WorkBuddy | `.workbuddy/skills/nz-supermarket-scraper/` | 在应用里上传 zip，或者放到 `~/.workbuddy/skills/nz-supermarket-scraper/` |

`AGENTS.md`（Codex 等智能体会读）和 `CLAUDE.md`（导入 `AGENTS.md`）会把智能体指到这个技能。

**项目级。** 克隆仓库，用 Claude Code、Codex 或 WorkBuddy 打开，技能会被自动发现。直接说“帮我抓 Woolworths Browns Bay 的果蔬价格”就行。也可以手动调用：Claude Code 输入 `/nz-supermarket-scraper`，Codex 输入 `$nz-supermarket-scraper`（或用 `/skills` 选）。

**用户级，从克隆的仓库复制：**

```bash
git clone https://github.com/maxazure/nz-supermarket-scraper.git
cd nz-supermarket-scraper
# Claude Code
mkdir -p ~/.claude/skills && cp -R skills/nz-supermarket-scraper ~/.claude/skills/
# OpenAI Codex
mkdir -p ~/.agents/skills && cp -R skills/nz-supermarket-scraper ~/.agents/skills/
# WorkBuddy
mkdir -p ~/.workbuddy/skills && cp -R skills/nz-supermarket-scraper ~/.workbuddy/skills/
```

在 macOS 和 Linux 上，也可以用 `ln -s "$PWD/skills/nz-supermarket-scraper" ~/.claude/skills/` 代替 `cp`，这样 `git pull` 之后技能会跟着更新。Claude Code 和 Codex 的文档都写明支持软链接的技能目录。WorkBuddy 建议用复制。

**Claude Code 插件。** 仓库根目录同时也是一个 Claude Code 插件市场：

```text
/plugin marketplace add maxazure/nz-supermarket-scraper
/plugin install nz-supermarket-scraper@nz-supermarket-scraper
```

装好后用 `/nz-supermarket-scraper:nz-supermarket-scraper` 调用。

**Codex 技能安装器。** 在 Codex 里运行 `$skill-installer`，让它安装 `https://github.com/maxazure/nz-supermarket-scraper/tree/main/skills/nz-supermarket-scraper`。

**WorkBuddy 上传。** 下载 [`nz-supermarket-scraper-skill.zip`](https://github.com/maxazure/nz-supermarket-scraper/releases/latest/download/nz-supermarket-scraper-skill.zip)，`SKILL.md` 就在 zip 的根目录。在 WorkBuddy 里打开 **专家·技能·连接器 → 技能 → 添加技能 → 上传技能**，选中这个 zip。WorkBuddy 会先做安全检查，上传的技能保存在用户配置目录里，所有项目都能用。

如果机器上还没有 `nzgrocery`，技能会让智能体自己安装（`pipx install nz-supermarket-scraper` 或 `uvx nz-supermarket-scraper`，再加 `nzgrocery install-browser`）。

**修改技能。** 只改 `skills/nz-supermarket-scraper/`，改完运行：

```bash
python3 scripts/sync_skills.py          # 同步 .claude / .agents / .workbuddy 三份副本
python3 scripts/sync_skills.py --zip    # 同时重新生成 dist/nz-supermarket-scraper-skill.zip
```

以下几种情况 `pytest`（`tests/test_skill.py`）会失败：副本和源文件不一致；frontmatter 用了 Agent Skills 通用字段（`name`、`description`、`license`、`compatibility`、`metadata`、`allowed-tools`）以外的字段；辅助脚本出错。

资料来源：Claude Code 的 [skills](https://code.claude.com/docs/en/skills) 和 [插件市场](https://code.claude.com/docs/en/plugin-marketplaces) 文档。Codex 的 [skills](https://developers.openai.com/codex/skills) 和 [AGENTS.md](https://developers.openai.com/codex/guides/agents-md) 文档。WorkBuddy 的 [技能文档](https://www.workbuddy.cn/docs/workbuddy/From-Beginner-to-Expert-Guide/Function-Description/Skills-Market) 和 [腾讯云文档](https://www.tencentcloud.com/document/product/1316/84503)。WorkBuddy 官方页面讲了 zip 上传，也说技能可以放在“项目技能目录”或用户配置目录，但没有写出具体文件夹名。`.workbuddy/skills` 和 `~/.workbuddy/skills` 这两个路径来自社区项目和 [vercel-labs/skills 的 WorkBuddy 条目](https://github.com/vercel-labs/skills/issues/1353)。如果你的 WorkBuddy 版本没有识别这个文件夹，就用 zip 上传。
