Checkjebon.nl makes comparing food prices across multiple supermarkets easy. With this library, you can programmatically query supermarket prices, compare shopping lists, and analyze product data using the same algorithms as the Checkjebon.nl website.
- Compare prices for products across multiple supermarkets
- Optimize shopping across multiple stores to minimize total cost
- Get list of available supermarkets
- Fuzzy product search and best-match selection
- Support for generic and brand-specific queries
- Price estimation when no direct match is found
- Generate Checkjebon.nl links for shopping lists
Get price information for a list of products across all available supermarkets.
Parameters:
productNames(string[]): Array of product names to search for
Returns: Promise<Array>
- Array of supermarket objects, each containing:
code(string): Supermarket code (e.g., "ah", "jumbo")name(string): Supermarket display nameicon(string|null): URL to supermarket icontotalProducts(number): Total products available at this supermarketproducts(Array): Array of product objects with:name(string|null): Product namelink(string|null): Link to product pageprice(number|null): Price in eurosamount(string|null): Product size/amountisEstimate(boolean): Whether price is estimatedoriginalQuery(string): Original search query
Example:
const products = await getPricesForProducts([
"1,5 liter halfvolle melk",
"250 gram roomboter",
"6 eieren"
]);
for (const supermarket of products) {
console.log(`${supermarket.name}: €${supermarket.products[0].price}`);
}Find the optimal combination of supermarkets to buy products from, minimizing total cost while respecting the maximum number of stores you want to visit.
Parameters:
productNames(string[]): Array of product names to buymaxSupermarketVisitCount(number): Maximum number of supermarkets to visitselectedSupermarketCodes(string[]): Array of supermarket codes to choose from (e.g., ["ah", "jumbo", "lidl"])
Returns: Promise<Object>
- Object containing:
totalCost(number): Total cost in euros for all productssupermarkets(Array): Array of selected supermarket objects with:code(string): Supermarket codename(string): Supermarket nameicon(string|null): Supermarket icon URLproducts(Array): Products to buy at this supermarket
Example:
const result = await getOptimalShoppingPlan(
["melk", "brood", "kaas"],
3, // Visit maximum 3 stores
["ah", "dirk", "jumbo", "vomar", "lidl", "aldi"]
);
console.log(`Total cost: €${result.totalCost}`);
console.log(`Stores to visit: ${result.supermarkets.length}`);
for (const store of result.supermarkets) {
console.log(`\nBuy at ${store.name}:`);
for (const product of store.products) {
console.log(` - ${product.name}: €${product.price}`);
}
}Get a list of all available supermarkets with their codes, names, and icons.
Returns: Promise<Array>
- Array of supermarket objects with:
code(string): Supermarket code (e.g., "ah", "jumbo")name(string): Full supermarket nameicon(string|null): URL to supermarket icon
Example:
const supermarkets = await getSupermarkets();
console.log("Available supermarkets:");
for (const store of supermarkets) {
console.log(`${store.code}: ${store.name}`);
}Generate a Checkjebon.nl URL with a pre-filled shopping list.
Parameters:
shoppingList(string|string[]): Shopping list as a string (one item per line) or array of items
Returns: string
- URL to open on Checkjebon.nl with the shopping list
Example:
const url = getCheckjebonLink([
"melk",
"brood",
"kaas"
]);
console.log(url);
// Opens: https://www.checkjebon.nl/#melk%0Abrood%0AkaasGet the timestamp when price data was last updated.
Returns: Date|null
- Date object representing when prices were last fetched, or null if not available
Example:
const lastUpdate = pricesLastUpdated();
if (lastUpdate) {
console.log(`Prices last updated: ${lastUpdate.toLocaleString()}`);
} else {
console.log('Prices last updated: Unknown');
}For each product in your shopping list, the library:
- Attempts an exact match by name.
- If no exact match, performs a fuzzy search (matches all letters in order, not necessarily adjacent).
- Filters by amount (liter/kilogram) if specified.
- Orders results by string match quality, then by price.
- Returns the best match for each supermarket.
- If no price is found, estimates based on averages from other supermarkets.
const cjb = require('./checkjebon');
const shoppingList = [
"1,5 liter halfvolle melk",
"250 gram roomboter",
"1 liter cola"
];
cjb.getPricesForProducts(shoppingList).then(result => {
console.log(JSON.stringify(result, null, 2));
const link = cjb.getCheckjebonLink(shoppingList);
console.log(link);
const lastUpdate = cjb.pricesLastUpdated();
console.log(lastUpdate);
});const cjb = require('./checkjebon');
const products = [
"1,5 liter halfvolle melk",
"250 gram roomboter",
"6 eieren",
"1 kilo bananen"
];
// Get list of available supermarkets
cjb.getSupermarkets().then(supermarkets => {
console.log("Available supermarkets:");
supermarkets.forEach(s => console.log(` ${s.code}: ${s.name}`));
});
// Optimize shopping across multiple stores
const maxStores = 3;
const selectedStores = ["ah", "dirk", "jumbo", "vomar", "lidl", "aldi"];
cjb.getOptimalShoppingPlan(products, maxStores, selectedStores)
.then(result => {
console.log(`Total Cost: €${result.totalCost.toFixed(2)}`);
console.log(`Stores to Visit: ${result.supermarkets.length}\n`);
result.supermarkets.forEach(store => {
console.log(`${store.name}:`);
store.products.forEach(p => {
console.log(` - ${p.name}: €${p.price.toFixed(2)}`);
});
});
});There are two example files provided:
example.node.js: Run this example in Node.js to see how to use the library programmatically.example.browser.html: Open this file in your web browser to see a browser-based example.
node example.node.jsSimply open example.browser.html in your web browser (double-click or right-click and choose "Open with" > your browser).
This project uses Mocha for testing. To run the tests, use:
node test- Exact match by name
- Fuzzy search if no exact match
- Filter by amount if specified
- Order by string match quality, then price
- Return best match per supermarket
Product price data is updated frequently and can be reused in other projects (e.g., price alerts, trend analysis, data journalism).
MIT
Visit Checkjebon.nl for more details and to use the web interface.