Skip to content
RinseV edited this page Mar 21, 2022 · 1 revision

Welcome to the aldi-wrapper wiki!

This package provides an easy way to interact with the Aldi Supermarkten API, for instructions, please visit the main page where you can find the most important info.

If you want more detail on specific functions, I'd recommend visiting the wiki page for that object.

Example usage

You can initialize the client as follows:

import { Aldi } from 'aldi-wrapper';

const aldi = new Aldi();

Once created, you can use the functions as follows:

const products = await aldi.product().getProductsFromName('melk');

Make sure to use async/await for the functions!

Advanced usage

The Aldi object can be created with some extra options:

{
  verbose?: boolean
  apiVersion?: number
}

You can log all requests in the console by setting verbose to true. You can also specify a custom api versioning number, if you don't provide one, the default will be used.

Every single function can also be provided with additional request options in the form of extra queries or headers. These can be added via the additionalRequestOptions parameter as follows:

const products = await aldi.product().getProductsFromName('melk', {
    query: {
        key: 'value'
    },
    headers: {
        Connection: 'keep-alive'
    }
})

The provided queries and headers will be merged with other queries and headers needed for the request.

Clone this wiki locally