AH Shop Api
'Unofficial' Albert Heijn shop api wrapper for Node.js
This is a node.js application that is connected to the Albert Heijn shop api. This api has the purpose to search products inside the webshop by a search term. The result of this will be: Cards (products), page, aggregation, taxonomies, querySuggestions.
Installation
npm i @rikvanhaaren/ah_shop_api
then
const { AHShopClient } = require("@rikvanhaaren/ah_shop_api");
const client = new AHShopClient();
or
import { AHShopClient } from "@rikvanhaaren/ah_shop_api";
const client = new AHShopClient();
Getting Started
Get products by name:
client.product().getProductByName('Red Bull').then((result) => {
console.log(JSON.stringify(result));
});
Get products by name with filter:
const filter = {
sortBy: "nutriscore",
property: ["store_department:non-food", "store_department:diepvries"],
page: 1,
size: 10,
}
client.product().getProductByName('Red Bull', filter).then((result) => {
console.log(JSON.stringify(result));
});
or
const filter: productFilter = {
sortBy: sortByOption.nutriscore,
property: [AfdelingOption.nonFood, AfdelingOption.diepvries],
page: 1,
size: 10,
}
client.product().getProductByName('Red Bull', filter).then((result) => {
console.log(JSON.stringify(result));
});
Get products by id:
client.product().getProductByID(4117).then((result) => {
console.log(JSON.stringify(result));
});
Get url:
client.getURL("/zoeken/api/products/search").then((result) => {
console.log(JSON.stringify(result));
});
License
You can check out the full license here
This project is licensed under the terms of the MIT license.