And then 2026 feels like the perfect time writing Haskell. The code is handwritten, but whenever I got stuck with the build system or was just not getting the types right, I could fall back to ask AI to unblock me. It was never that smooth before.
Finally the best side projects are the ones you actually use and this one will be used for all my future grocery shopping.
> The suggestion engine (korb suggestion threshold) is re-implemented in Lean 4 with five mathematically proven properties: suggestions have positive frequency, are sorted descending, come from ordered and available products, exclude basket items, and respect the count limit.
This is amazing. I mean this literally in that I am amazed, but also figuratively in that I am delighted to watch the type-safe-mad build cool shit.Also there already exists this reverse engineered project: https://github.com/ByteSizedMarius/rewerse-engineering/
I do have a suggestion for your app though: Have it compare your basket of goods across different markets in your region to show you the cheapest option. I'm pretty sure this possibility is actually one of the reasons they locked down the API.
I've used Data from REWE in the past and made a comparison between a couple of cities in Germany (I believe it was Frankfurt, cologne, Berlin, Munich and Hamburg). Hamburg was by far the most expensive, often as much as 10-20% more expensive.
This is a great idea. I just think the use case is not that big since REWE is the worst in the price/quality ration and just going to another shop would save you more.
I really like your suggestion. I will put it in an issue and look into that. https://github.com/yannick-cw/korb/issues/4
Check out smhaggle app on Android
https://play.google.com/store/apps/details?id=com.smhaggle.a...
What I suspect though: They mainly show current discounts. The REWE API exposes those as a separate list for each market. There's around 3.5k markets and each can set their own discounts and has their own product catalogue with their own pricing.
So it would be 3.5k API calls to fetch all offers for all markets. Which is doable.
But fetching all products takes like 100 calls per market. It's quite a bit of data. And I think most supermarket don't publish their catalogue at all since they don't have delivery options.
I'd settle for just being able to sort items by unit price... I'm sure this is a [regulation-]solved problem in Germany though
What do you mean? The official REWE app and website provide just that.
> I'm sure this is a [regulation-]solved problem in Germany though
Not sure what you mean by that.
I just checked and REWE only lets you sort by absolute price. But honestly, you can compare prices so much better on their website than in a physical supermarket already [0].
[0] https://www.rewe.de/shop/c/frisches-obst/?sorting=PRICE_DESC You have to enter a random zip code eg 20249
This is the future of doing groceries. Let us login with our credentials and let us do the search/filling the cart with agents.
Totally fine to do the payment only on the web, so everyone can be sure they only order what was wished, and not 300 avocados.
The basic idea is to write a prove in Lean4 and then test both the production implementation (Haskell) and the Lean implementation against random inputs. Compare if the results are the same.
If that is the case -> you can be pretty sure the unproven production version is as correct as the proven lean version.
https://www.dev-log.me/formal_verification_in_any_language_f...
It can search for items, add them to the basket, picks a delivery slot and does the checkout.
With a little more scaffolding in markdown files, this now takes care of my weekly shopping.
Haskell is indeed an interesting choice. ;)
It would have been a cool project!
B2C: Is it really surprising that a busines has no interest in providing more price transparency to their customers?
The owners of German supermarket and car companies are really the richest of the rich in Germany (okay and maybe the SAP guy on top). It would definitely be a net positive if someone manages to scrape and compare their prices.
In the restaurant market it's one player abusing many small players.
And honestly, I think the reason everyone cries when "Amazon launches an API" is because Amazon would not dare to piss off the German supermarket oligopoly.
There's a few projects doing that for DE / AT at least.
The issue is that each market sets their own prices and I believe REWE is the only large one where you can fairly easily scrape the product catalogue. I thought about it in a shopping list context, so you'd need to make it location dependent to be useful. But you could do a lot of cool things with it. Like choose a basket of goods and it creates a route for you: "Go to supermarket A and buy goods XYZ, then to supermarket B and buy ABC"
https://www.supermarkt.at https://preisrunter.at https://sparpionier.com
Might I suggest you remove your tin-foil hat and consider that:
- 99% of REWE customers almost certainly have no clue what an API is
- 99% of the remaining 1% know what an API is, but their day-job involves messing with APIs, so they don't want to spend their weekend-time messing with the REWE API, they just want to do their shopping at REWE.
- The final 0.1% are those who come on HN and pretend its all some sort of big conspiracy to minimise transparency by $evil_corp. :)
If you think about it, imagine if REWE officially exposed an API B2C. This would mean they are obligated to provide support.Do you really want the price of your shopping to increase because REWE now needs to find money to pay for a helpdesk for the millions of B2C API users ?
Businesses and services differentiating between B2C and B2B is nothing new, that is why the two different terminologies exist !
What next, you don't want to fill up your car at the petrol station (B2C) but you want to be permitted to buy a barrel crude oil direct from the drill and refine it yourself (B2B) ?
First up: Read and follow the rules. No need to insult me. Especially considering what you said shows that you both misunderstood AND misrepresented what I've said.
And frankly, my reasoning was simply saying "Company won't publicize internal info if they don't get an advantage from doing so". It's literally the same reason Google doesn't publish all of their source code. I'm struggling to see what part you are misunderstanding but it has to be something extremely basic to conclude I'm a conspiracy nut for basically stating "Company acts in their interest".
Opening an API to the public allows third parties to develop apps that can then be consumed by end-consumers. Not trying to be offensive here, but do you know what an API is? To conclude I meant every single end-consumers building their own app is at best disingenuously twisting my words.
Opening the API would allow new players like you and me to enter the market and take a piece of the pie. Why would a market, dominated and controlled by a few big players, opt for that? You don't even need to know that the German grocery market is incredibly price competitive, to understand that.
> If you think about it, imagine if REWE officially exposed an API B2C. This would mean they are obligated to provide support. Can you provide a source for that requirement? I'm pretty sure you just made that up.
> Businesses and services differentiating between B2C and B2B is nothing new, that is why the two different terminologies exist ! At this point I'm entirely lost what you read in my comment. Yes I know. I specifically made that distinction.
> What next, you don't want to fill up your car at the petrol station (B2C) but you want to be permitted to buy a barrel crude oil direct from the drill and refine it yourself (B2B) ? Yeah you definitely misunderstood something... What I said/meant:
The question: Why isn't the API open?
My answer: For B2B I gave an example where the API is used by another German firm, providing an example that the API is indeed consumed B2B.
For B2C: They have no reason to do so. They have a well functioning app where you can order stuff. They have one of the bigger recipe pages (at least it does very well SEO-wise) in Germany where you can immediately order ingredients from a recipe. The biggest recipe page in Germany (chefkoch) offers a direct link from recipes to their order page. Maybe you're missing this info? Thinking it's an internal API to data that isn't exposed anywhere at all would somehow explain whatever you tried to say here. But again, if you're that uninformed, don't insult people.
Here you are wrong too.
If you want to develop an app via an API that is only offered B2B, what do you do ?
Yes, that's right ...
You phone up REWE and negotiate a license to access to the B2B API to develop your application. B2B2C if you want to put it in simpler terms.
My original point stands. REWE clearly do not want to officially expose the API B2C, almost certainly for the exact reasons I already spelled out in my original post.
But no, its easier for you just to spread FUD, claiming "busines has no interest in providing more price transparency to their customers" just because they will not let you have access to the API as direct B2C.
What you describe as B2B2C is exactly what chefkoch does. And it's exactly what I initially said, so I'm not sure what point you're trying to make. But anyway. Doesn't feel like we're getting anywhere. Have a great day ;)
Did you implement your own OAUTH2 flow in haskell for this?
I'm a huge fan of Haskell and I'm really exploring it as my primary language now that AI has gotten so huge, not just because it makes it easier but also because I can really lock down what I allow code to do (through pure functions, type checking etc) and so I feel a lot more confident in AI generated code
For context, I've been writing Haskell for quite a long time and I'm maintaining a few packages like Yesod.
The things above are definitely a skill issue on my part, I'm sure all of this is possible with cabal and stack and I may just not be using them right, but I definitely found cargo and go mod to be a lot simpler to get started with. Also, for cross-compilation and for FFI I found cabal to be a pain when including C sources where as Go was trivial through CGO (and the tooling around it was too).
I love Haskell though so all good <3
For me personally (and also for everyone at work), I'm doing all package management with Nix. I'm happy with the setup. There is a learning curve with Nix, but as you can imagine this has shortened now with AI.
I wrote a skill some time ago to support me with "agentic groceries" on my own - it's the future of shopping I would say.
My workflow:
- I paste in urls or text for receipts I will cook this week - agent extracts the ingredients, calculates cups to ml and such, replaces meat with vegi ingredients, replaces some other things I prefer always (often also creates a nice markdown receipe at this steo I can put into Obsidian) - check my list of favs, check search cache (so not every time the api is called, I'm a good netizen :D ) - ask me which items I have at home (no need to add to the basket) - search rewe api for multiple candidates and let me choose. - after each recipe I enter /new to start with fresh context - also I have a list of things I buy every week
I still put everything manually in the basket in the end, but this is not the thing which is time intensive.