I built a CLI that buys things on Alza for me
Every month I order the same things on Alza: coffee capsules, laundry detergent and toiletries. I don’t need to browse for that, it’s always the same products, the same checkout and the same AlzaBox. Still, every time I opened the website, searched, clicked through five pages and confirmed.
So I built a CLI that lets my AI assistant search Alza, compare options and prepare the order. I just confirm it.
What it looks like
A search returns a list of products with price and availability.
$ alza search "nespresso capsules" -n 5
1. [5765432] Nespresso Vertuo Pop Barista Variety Pack
Price: 5,49 € | In stock
2. [5834521] Starbucks by Nespresso Blonde Espresso Roast
Price: 4,29 € | In stock
3. [5612098] Nespresso Original Ispirazione Roma
Price: 3,99 € | In stock
...
The alza product command shows the detail with ratings and parameters, and then I either add the product to the cart or use QuickBuy. QuickBuy skips the cart and the whole checkout and creates the order directly with my saved card and my AlzaBox. With the --quote flag it only shows the price and orders nothing. Only -y actually charges the card.
$ alza quickbuy 5612098 --quote
✅ QUOTE CREATED
Total: 3,99 €
That’s why the assistant never orders blind. It first creates a quote, shows me the exact product, price and delivery method, and waits until I explicitly confirm. When a search returns several similar products, it stops and asks which one I mean. I don’t want full autonomy, I just want it to do the boring part for me.
How I use it
When I write “order coffee capsules, my usual ones” in the chat, the assistant checks my order history with alza orders, finds the product I usually buy and gets the current price with a quote. Then it asks me to confirm, and only after that does it place the order. For new products it searches, compares ratings and prices and gives me options, so it does the research and I make the call.
alza orders --query "detergent" --format=json
alza search "persil washing powder" -n 5 --format=json
alza product 7816725 --format=json
alza reviews 7816725 --stats --format=json
alza quickbuy 7816725 --quote --format=json
# ... waits for my confirmation ...
alza quickbuy 7816725 -y --no-coupon
Why a CLI and not a browser
I first tried browser automation, where an agent clicks through the real website. It worked, but it was slow, broke with every UI change and was hard to control. I watched a robot click buttons and hoped it would hit the right ones.
The CLI calls the API that Alza’s website runs on directly. It’s faster and every step can be traced, and when something breaks, the API returns an error instead of a screenshot of the wrong page. The agent can call search, product detail and reviews in quick succession and gets structured JSON without waiting for pages, pop-ups and cookie banners. The price is that the CLI only works on Alza, but for recurring purchases in one shop that’s enough for me.
How I built it
Alza has no public API, so I opened Chrome DevTools, went through the purchase flow and mapped the endpoints. The biggest obstacle was Cloudflare, because regular HTTP clients couldn’t reach Alza’s API at all. What finally worked was a Go library for TLS fingerprinting that mimics Chrome’s TLS handshake closely enough to pass the check.
Login piggybacks on my Chrome session. The CLI reads the session cookies, exchanges them for an API token that expires after about 90 minutes, and refreshes it in the background on its own. It never asks for a password.
Search and product detail were easy to map, and checkout was the hardest part. For QuickBuy I had to map more than 30 fields in the request body, many of which look meaningless, such as IsTretinka or ShowPaymentCards, but the request fails without them. I first added the --format=json flag as an afterthought, and it turned out the agent can’t work without it, because it reads JSON reliably and formatted terminal output it doesn’t. So every command has readable output for me and JSON for the agent.
The whole thing rests on reverse engineering, so Alza can break it at any time. But the API changes much less often than the UI. I’ve been using it since late 2025 and the main endpoints haven’t changed yet. E-shops clearly don’t want this kind of automation, otherwise TLS fingerprinting and cookie extraction wouldn’t be needed, so it’s a gray zone: technically possible, officially unsupported.
What I take from it
I already handle part of my routine shopping through chat. For laundry detergent I don’t need product photos or recommendations, I need what I always buy, at a good price and in my AlzaBox. When I buy headphones or a gift, I still want to browse, compare and read reviews.
When I build other tools for agents, I stick to three things. Where possible, I call an API instead of automating a browser. Every command has readable output and --format=json. And anything that spends money or can’t be undone gets a quote or dry-run first.
The code is open source at github.com/kuringer/alza-cli. It’s a hobby project built for my own workflow, it only works with Alza.sk, it needs Chrome for login and it can break when Alza changes its backend. If you’ve built something similar for another e-shop or you look at agent shopping from the seller’s side, write to me at hi@andrejkostal.sk.