Skip to main content

Get Circulating Supply Of Moxie Token

In this tutorial, you will learn how to use the Circulating Supply API to fetch the circulating supply of the Moxie token in Node.js.

Pre-requisites

Before following the tutorial, make sure that your machine fulfills the following requirements:

  • Node.js v.18+
  • npm v.10+

In addition, make sure that you have node-fetch installed in your Node.js project. If you haven't installed it yet, you can do so by running the following command:

npm install node-fetch

Step 1: Add REST API Call To The Code

You can easily call the Circulating Supply API by sending a GET request using the following code snippet with node-fetch:

index.ts
import fetch from "node-fetch";

const options = {
method: "GET",
headers: {
accept: "application/json",
},
};

fetch("https://circulating-supply.moxie.xyz/", options)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));

Step 2: Execute Your Code

Once you have your code ready, you can execute it by running the following command:

ts-node index.ts

If it runs successfully, you should see the data returned in the terminal:

1004138103.91

Congrats! 🥳🎉 You've just fetched the circulating supply of the Moxie token!

Developer Support

If you have any questions or need help with other use cases, feel free to join the /airstack Warpcast channel and ask your questions there.

Our team is always ready to help you with any questions you may have.