Home


A library/module to interact with the stalks.io API.

npm GitHub GitHub Workflow Status

What's this?

If you play animal crossing, especially the new horizons you may have the seen the character Daisy Mae. She sells you turnips which you can later sell. To improve your results you may want to track the prices. That caused the website stalks.io. It allows you to track the prices and show you a predicition.

If you happen to be patron of this at level 2 you can use the api to interact with the page. This library/module allows you to easily interact with the api via node or deno.

Documentaion

You find a full documentation over here.

Installation

If you want to use node you just need to install it via:

$ npm install stalks.js

Loading the library/modules

For node:

import StalksClient from "stalks.js";

You can't use require. stalks.js is a pure ES Module. You still can use the dynamic import().

For deno:

import StalksClient from "https://raw.githubusercontent.com/cptpiepmatz/stalks.js/master/mod.ts";

Usage

Some basic usage for this.

const client = new StalksClient(YOUR_API_TOKEN);
const stalks = client.stalks;
const accounts = client.accounts;

stalks.fetchWeek()
  .then(console.log)
  .catch(console.error);

accounts.fetchCurrentUser()
  .then(console.log)
  .catch(console.error);

Getting an API token

  1. Become a patron.
    1. Go to stalks.io patron page.
    2. Choose at least "Blathers".
  2. Go to stalks.io settings.
  3. Click on "API Access".
  4. There you go. You have your token. (You may need to regenerate one.)

Examples

You can find examples here.