# @rikvanhaaren/ah_shop_api

> Get products from the AlbertHeijn web store.

Latest version **1.0.5** (published 2022-12-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rikvanhaaren/ah_shop_api
pnpm add @rikvanhaaren/ah_shop_api
yarn add @rikvanhaaren/ah_shop_api
bun add @rikvanhaaren/ah_shop_api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-12-12 |
| First published | 2022-10-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | RikVanHaaren |
| Maintainers | rikvanhaaren |
| Keywords | ah, albertHeijn, scrapper, api |

## Links

- npm: https://www.npmjs.com/package/@rikvanhaaren/ah_shop_api
- Repository: https://github.com/RikVanHaaren/ah_shop_api
- Homepage: https://github.com/RikVanHaaren/ah_shop_api#readme
- Issues: https://github.com/RikVanHaaren/ah_shop_api/issues
- npm.io page: https://npm.io/package/@rikvanhaaren/ah_shop_api

## Recent versions

- 1.0.5 (latest) — 2022-12-12
- 1.0.4 — 2022-11-04
- 1.0.3 — 2022-11-04
- 1.0.2 — 2022-10-31
- 1.0.1 — 2022-10-24
- 1.0.0 — 2022-10-24

## README

# <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Albert_Heijn_Logo.svg/1200px-Albert_Heijn_Logo.svg.png" alt="AH Logo" width="25"/> AH Shop Api
'*Unofficial*' Albert Heijn shop api wrapper for Node.js

<a href="https://www.npmjs.com/package/@rikvanhaaren/ah_shop_api"><img src="https://img.shields.io/npm/v/@rikvanhaaren/ah_shop_api" alt="NPM version" /></a>
<a href="https://github.com/RikVanHaaren/ah_shop_api"><img src="https://img.shields.io/npm/l/@rikvanhaaren/ah_shop_api" alt="MIT license" /></a>

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
```sh
npm i @rikvanhaaren/ah_shop_api
```

then
```jsx
  const { AHShopClient } = require("@rikvanhaaren/ah_shop_api");
  const client = new AHShopClient();
```
or
```jsx
  import { AHShopClient } from "@rikvanhaaren/ah_shop_api";
  const client = new AHShopClient();
```

# Getting Started
## Get products by name:
```jsx
client.product().getProductByName('Red Bull').then((result) => {
  console.log(JSON.stringify(result));
});
```

## Get products by name with filter:
```jsx
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
```jsx
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:
```jsx
client.product().getProductByID(4117).then((result) => {
  console.log(JSON.stringify(result));
});
```

## Get url:
```jsx
client.getURL("/zoeken/api/products/search").then((result) => {
  console.log(JSON.stringify(result));
});
```

---

# License
>You can check out the full license [here](https://github.com/RikVanHaaren/ah_shop_api/blob/main/LICENSE)

This project is licensed under the terms of the **MIT** license.

---
_Source: https://npm.io/package/@rikvanhaaren/ah_shop_api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
