Socket
Book a DemoInstallSign in
Socket

@rikvanhaaren/ah_shop_api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rikvanhaaren/ah_shop_api

Get products from the AlbertHeijn web store.

latest
Source
npmnpm
Version
1.0.5
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

AH Logo AH Shop Api

'Unofficial' Albert Heijn shop api wrapper for Node.js

NPM version MIT license

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.

Keywords

ah

FAQs

Package last updated on 12 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts