Skip to content
Kacper Kwapisz edited this page Mar 16, 2021 · 1 revision

.getItem(itemURL, callback)

  • itemURL: Product link from supremenewyork.com string
  • callback: The callback to be called when the event occurs. function

Retrieves product information from a valid supremenewyork.com product link, returns an object containing product information.

Example:

supreme.getItem('https://www.supremenewyork.com/shop/jackets/ep6igtufq', (item, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(item);
});

.getItems(category, callback)

  • category: Category from supremenewyork.com string
  • callback: The callback to be called when the event occurs. function

Retrieves all products list with information from a valid supremenewyork.com category, returns an object containing product information.

Example:

supreme.getItems('jackets', (item, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(item);
});

.watchAllItems(interval, category, callback)

  • interval: Checks every x seconds. number
  • category: Category from supremenewyork.com string
  • callback: The callback to be called when the event occurs. function

Seek for a new item every x seconds on a valid supremenewyork.com category, returns an object containing product information.

Example:

supreme.watchAllItems(5, 'shoes', (items, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(items);
});

.stopWatchingAllItems(callback)

  • callback: The callback to be called when the event occurs. function

Cancel .watchAllItems, returns an object containing status information.

Example:

supreme.stopWatchingAllItems((status, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(status);
});

.stopWatchingAllItems(callback)

  • callback: The callback to be called when the event occurs. function

Cancel .watchAllItems(), returns an object containing status information.

Example:

supreme.stopWatchingAllItems((status, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(status);
});

.onNewItem(interval, callback)

  • interval: Checks every x seconds. number
  • callback: The callback to be called when the event occurs. function

Seek for a new item every x seconds, returns an object containing product information.

Example:

supreme.onNewItem(5, (product, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log('New Release: ' + item.name);
});

.seek(category, keywords, styleSelection, callback)

  • category: Category from supremenewyork.com string
  • keywords: Keywords to match with products string
  • styleSelection: Selected Style for search string
  • callback: The callback to be called when the event occurs. function

Seeks for items on desired category page with specific keywords/styles, returns an object containing product information.

Example:

const category = 'jackets';
const keywords = "UNDERCOVER";
const style = 'Burgundy';

supreme.seek(category, keywords, style, (product, err) => {
    if (err) {
        console.log(err);
        return err;
    }
    console.log(product);
    console.log(product.title); // example => Supreme®/UNDERCOVER Wool Overcoat
});
Clone this wiki locally