Skip to content

Navigation Menu

Sign in
Sign up

Repository files navigation

πŸ›’ OpenClaw Skill: Albert Heijn

⚠️ Disclaimer: This is an unofficial, community-built integration. It is not affiliated with, endorsed by, or connected to Albert Heijn or Ahold Delhaize in any way. It uses the same mobile API that the Appie app uses β€” this is undocumented and may change or break without notice. The login flow is hacky (you need to extract an auth code from browser DevTools). You may run into rate limits or blocked requests. Use at your own risk.

An OpenClaw skill that turns your AI assistant into a personal grocery planner for Albert Heijn β€” the largest supermarket chain in the Netherlands. Built on top of the excellent appie-go library by @gwillem.

Your agent analyzes what you buy, checks this week's deals, suggests meals, and fills your shopping list β€” all through chat.

What It Does

  1. πŸ” Login β€” Authenticates with your AH account via OAuth
  2. πŸ“Š Analyze β€” Pulls your purchase history (previously bought products)
  3. 🧠 Learn β€” Builds a taste profile from your history + feedback
  4. 🏷️ Bonus β€” Checks weekly deals and matches them to your preferences
  5. 🍽️ Suggest β€” Proposes meals using Allerhande recipes, optimized for bonus items
  6. πŸ›’ Shop β€” Adds everything to your AH shopping list (basics + meal ingredients)
  7. πŸ“ˆ Improve β€” Learns from approvals/rejections to get better over time

Quick Start

1. Install the CLI tool

Requires Go 1.21+:

cd appie-cli
go build -o appie-cli .
mv appie-cli ~/go/bin/ # or anywhere in your PATH

2. Login to Albert Heijn

appie-cli login-url
# Outputs a URL like: https://login.ah.nl/login?client_id=appie-ios&...
  1. Open Developer Tools in your browser first (F12), go to the Network tab, and enable Preserve log
  2. Open the URL and log in with your Albert Heijn account
  3. After login, the browser will try to redirect to appie://login-exit?code=XXXXX β€” this will fail (it's a mobile app link, that's expected)
  4. In the Network tab, find ingelogd.json
  5. Click it and look at the Response β€” you'll see:
    "pageProps": {
     "__N_REDIRECT": "appie://login-exit?code=XXXXX",
     "__N_REDIRECT_STATUS": 302
    }
  6. Copy the code (everything after code=)
appie-cli exchange-code <your-code>

Tokens are saved to .appie.json and auto-refresh.

3. Configure the skill

cp config-template.json config.json

Edit config.json with your preferences:

Parameter Default Description
meals_per_week 3 Number of meal suggestions per week
max_cooking_time_minutes 30 Max cooking time for recipes
household_size 2 Number of people
shopping_day "friday" When you do groceries
proposal_day "thursday" When to receive meal proposals
dislikes [] Ingredients to avoid (e.g. ["fish", "mushrooms"])
allergies [] Allergies (e.g. ["gluten", "lactose"])
butcher_items [] Items to buy at the butcher instead of AH (optional)
preferences.healthy true Prefer healthy recipes
preferences.prefer_bonus true Prefer ingredients that are on sale

4. Point your OpenClaw agent at this skill

Add to your OpenClaw workspace and the agent will handle the rest through conversation.

How It Works

API Discovery

The skill uses the Albert Heijn mobile API (api.ah.nl) β€” the same API that powers the Appie app:

Feature Endpoint Auth
Product search REST /mobile-services/product/search/v2 Anonymous
Previously bought GraphQL productSearch(previouslyBought: true) Required
Bonus products REST ?bonus=true via AHWEBSHOP Anonymous
Shopping lists REST /mobile-services/lists/v3/lists Required
Add to list REST PATCH /mobile-services/shoppinglist/v2/items Required
Recipes GraphQL recipeSearch + recipe(id) Anonymous
Member profile GraphQL member Required

API Notes

  • previouslyBought: true in ProductSearchInput returns all products you've ever purchased β€” this is undocumented
  • customerProfileAudiences on the member query reveals AH's internal segmentation (frequent buyer categories, food profile, dietary preferences)
  • Allerhande recipes are fully queryable via GraphQL with ingredients, cooking times, and portions
  • Bonus products need the x-application: AHWEBSHOP header to return results via REST

Weekly Flow

Thursday morning (cron job):
 β”œβ”€β”€ Fetch favorite lists (weekly basics)
 β”œβ”€β”€ Fetch current bonus products
 β”œβ”€β”€ Match bonus with purchase history
 β”œβ”€β”€ Search Allerhande recipes matching:
 β”‚ β”œβ”€β”€ Taste profile preferences
 β”‚ β”œβ”€β”€ Available bonus ingredients
 β”‚ β”œβ”€β”€ Cooking time constraints
 β”‚ └── Dislike/allergy filters
 β”œβ”€β”€ Propose N meals via chat
 β”œβ”€β”€ Wait for approval/modifications
 └── Add all items to AH shopping list (via batch-add)
 β”œβ”€β”€ Look up product IDs from product-cache.json first
 β”œβ”€β”€ Weekly basics (from favorite lists)
 β”œβ”€β”€ Meal ingredients (with product IDs)
 β”œβ”€β”€ Butcher items (as free text notes)
 └── Cache any newly discovered product IDs

CLI Reference

appie-cli <command> [args]
Auth:
 login-url Get the AH login URL
 exchange-code <code> Exchange auth code for tokens
Products:
 search <query> [limit] Search products
 product <id> Get product details
 bonus-products [limit] Get current bonus products
 previously-bought [size] [page] Get previously bought products
Shopping List:
 shopping-list Show main shopping list
 shopping-lists List all shopping lists
 list-items <list-id> Get items in a specific list
 add-to-list <id> [qty] Add product to shopping list
 add-to-list --text "item" Add free text item
 batch-add Add multiple items from stdin (JSON array)
 clear-list Clear shopping list
Account:
 member Show member profile
 receipts List receipts (⚠️ currently broken, see Known Issues)
 receipt <id> Get receipt details (⚠️ currently broken)

Credits

License

AGPL-3.0

Known Issues

  • Receipts endpoint broken β€” the AH receipt API returns 503. Tracked at gwillem/appie-go#1. Use previously-bought as an alternative.

Disclaimer

This is an unofficial integration. Not affiliated with Albert Heijn or Ahold Delhaize. Use at your own risk. The API may change without notice.

About

No description, website, or topics provided.

Resources

Stars

30 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /