1.0.5 • Published 1 year ago

@rikvanhaaren/ah_shop_api v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago