October 11, 2023

Check Wallet Activity and Get Crypto Address Labels

Table of Contents
Check Wallet Activity and Get Crypto Address Labels

Today’s article will show you how to easily check wallet activity and get crypto address labels using Moralis. Moralis provides a comprehensive suite of industry-leading Web3 APIs, allowing you to get this data with a few lines of code. If you’re eager to jump straight into it, then here are two brief guides on how to check wallet activity and get crypto address labels:

Check Wallet Activity 

With the getWalletActiveChains() endpoint, you can effortlessly check the wallet activity of any crypto address across multiple blockchain networks. Here’s an example of what the code can look like:

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
    // ...and any other configuration
  });

  const address = "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e";

  const chains = [EvmChain.ETHEREUM, EvmChain.BSC, EvmChain.POLYGON];

  const response = await Moralis.EvmApi.wallets.getWalletActiveChains({
    address,
    chains,
  });
  
  console.log(response.toJSON());
}

runApp();

All you have to do is add your Moralis API key, configure the address parameter, and run the script. In return, you’ll get the first and latest transactions for the address in question. Here’s an example of what the response might look like:

{
  "address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
  "active_chains": {
    "chain": "eth",
    "chain_id": "0x1",
    "first_transaction": {
      "block_number": "123456789",
      "block_timestamp": "2022-08-23T20:58:31.000Z",
      "transaction_hash": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09"
    },
    "last_transaction": {
      "block_number": "123456789",
      "block_timestamp": "2022-08-23T20:58:31.000Z",
      "transaction_hash": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09"
    }
  }
}

That’s how easy it is to check the wallet activity of any address with Moralis! 

If you want more information about how this works, join us in this article or check out the official wallet activity documentation! 

Get Crypto Address Labels 

The Moralis API supports crypto address labels for all endpoints returning a to_address or from_address. An example is the getWalletTransactions() endpoint, which we’ll use to illustrate how easy it is to get crypto address labels with Moralis. Here’s an example of what the code can look like:

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
    // ...and any other configuration
  });

  const address = "0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326";

  const chain = EvmChain.ETHEREUM;

  const response = await Moralis.EvmApi.transaction.getWalletTransactions({
    address,
    chain,
  });

  console.log(response.toJSON());
};

runApp();

You just need to add your Moralis API key, configure the chain and address parameters to fit your query, and then run the code. In return, you’ll receive a response containing the to_address_label and from_address_label parameters. It can look something like this:

//…
  "result": {
    "hash": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
    "nonce": 326595425,
    "transaction_index": 25,
    "from_address": "0xd4a3BebD824189481FC45363602b83C9c7e9cbDf",
    "to_address": "0xa71db868318f0a0bae9411347cd4a6fa23d8d4ef",
    "from_address_label": "Binance 1",
    "to_address_label": "Binance 2",
    "value": 650000000000000000,
//...

Getting crypto address labels doesn’t have to be more challenging than that when working with Moralis! 

If you want more in-depth information on how this works, join us in this article or check out the official address labels documentation

Also, before you continue, remember to sign up with Moralis. You can create your account for free, and you’ll need one to make similar calls to the Moralis API!

Overview

In today’s article, we’ll start by exploring the ins and outs of wallet activity. Once you know what it entails, we’ll show you how to get the wallet activity of any user address with Moralis. Next, we’ll dive straight into the intricacies of crypto address labels to give you an overview of what they are. From there, we’ll show you how to get crypto address labels with Moralis in three straightforward steps. Lastly, to top things off, we’ll explore a few prominent use cases for crypto address labels! 

To check wallet activity and get crypto address labels, we’ll be using the Moralis Wallet API. This is one of many industry-leading APIs Moralis offers. And if you’re serious about building Web3 projects, we highly recommend checking out Moralis’ additional tools. 

For instance, if you’re planning to build an NFT-based platform, then make sure to also explore the Moralis NFT API. With this tool, you can seamlessly get ERC721 on-chain metadata, get all NFT tokens owned by a user address, and much more using only single lines of code! 

If this sounds exciting, remember to sign up with Moralis. You can create an account free of charge, and you’ll gain immediate access to all APIs, allowing you to fully leverage the power of blockchain technology! 

Moralis Wallet Activity Landing Page

What is Wallet Activity? 

The wallet activity of an address is quite straightforward, and it simply tells you what blockchain networks a Web3 wallet has been active on. Moreover, it includes the dates of the first and last seen transactions. 

Illustration - Web3 wallet activity with transaction flow

So, why might you need this information? 

Well, checking the wallet activity of an address can tell you and your users a lot of things. For instance, if the wallet was created a long time ago and remains active today, it indicates that it’s an enthusiastic user or trader who might be worth keeping an eye on. 

On the other, if a wallet was created a few days ago and only has a few transactions that last occurred on the same day, it might indicate that the sole purpose of the wallet was to bridge funds, for example. 

Going through all blockchains and querying each network for the first and last transactions can be a tedious and time-consuming task. Fortunately, this is where Moralis enters the equation, giving you a straightforward way to query this information via the Wallet API. In fact, all you need is a single API call to check the wallet activity of any address! 

Let’s take a closer look at how this works in the next section! 

How to Check Wallet Activity 

With the Moralis Wallet API, you can seamlessly check wallet activity across multiple blockchain networks in a heartbeat. In fact, thanks to this industry-leading tool, you can now get the data you need with a single API call to the getWalletActiveChains() endpoint! 

To demonstrate the accessibility of the Moralis Wallet API, we’ll show you how to check the wallet activity of any address in three easy steps: 

  • Step 1: Get a Moralis API Key
  • Step 2: Create a Script
  • Step 3: Run the Code

However, before you can jump into the first step of the tutorial, you’ll need to deal with a few prerequisites! 

Prerequisites to Check Wallet Activity

In this tutorial, we’ll show you how to check wallet activity using JavaScript. As such, you’ll need to have the following ready before you proceed: 

  • Node v.14+
  • NPM/Yarn

With these installed and set up, you’re ready to continue with the first step!  

Step 1: Get a Moralis API Key to Check Wallet Activity

To be able to call the getWalletActiveChains() endpoint, you need a Moralis API key. As such, if you don’t already have a Moralis account, click on the ”Start for Free” button at the top right to sign up: 

Step 1 - Sign up with Moralis to check wallet activity

Next, go to the ”Settings” tab, scroll down to the ”Secrets” section, and copy your API key: 

Copy Web3 API Key for Wallet Activity

Save the key for now; you’ll need it in the second step! 

Step 2: Create a Script 

Create a new project in your integrated development environment (IDE), open a new terminal, and run the command down below to install the Moralis SDK: 

npm install moralis @moralisweb3/common-evm-utils

Next, create a new ”index.js” file and add the following code: 

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
    // ...and any other configuration
  });

  const address = "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e";

  const chains = [EvmChain.ETHEREUM, EvmChain.BSC, EvmChain.POLYGON];

  const response = await Moralis.EvmApi.wallets.getWalletActiveChains({
    address,
    chains,
  });
  
  console.log(response.toJSON());
}

runApp();

From here, you need to make a few configurations. First of all, add your API key by replacing YOUR_API_KEY

Pasting API key for Wallet Activity

Next, add the address you want to check the wallet activity for to the address const:

Address parameter for Activity Web3 Wallet

We then pass address and chain as parameters when calling the getWalletActiveChains() endpoint: 

pass address and chain as parameters when calling the getWalletActiveChains() endpoint-

And that’s it for the code; all that remains from here is running the script! 

Step 3: Run the Code 

To execute the code, simply run the following terminal command in the project’s root folder: 

node index.js

In return, you’ll get a response with the wallet’s first and latest transactions for each chain it has been active on. Here’s an example of what the response might look like: 

{
  "address": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
  "active_chains": {
    "chain": "eth",
    "chain_id": "0x1",
    "first_transaction": {
      "block_number": "123456789",
      "block_timestamp": "2022-08-23T20:58:31.000Z",
      "transaction_hash": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09"
    },
    "last_transaction": {
      "block_number": "123456789",
      "block_timestamp": "2022-08-23T20:58:31.000Z",
      "transaction_hash": "0x2d30ca6f024dbc1307ac8a1a44ca27de6f797ec22ef20627a1307243b0ab7d09"
    }
  }
}

Congratulations! You now know how to check the wallet activity of any address using Moralis and the Wallet API! 

What are Crypto Address Labels? 

The Moralis API autonomously enriches all ERC-20 and NFT transfers with user-friendly labels for both senders and receivers. This is done for all transactions or transfers that have a to_address or a from_address by also including to_address_lable and from_address_lable parameters. So, what are these crypto address labels? 

Crypto labels reflect publicly known addresses such as Coinbase, Kraken, Binance, etc., along with decentralized exchanges (DEXs) like Uniswap v3, 1inch, as well as NFT marketplaces like Blur, OpenSea, and many others! 

That said, why do you need labels? 

Any crypto address is simply a unique sequence of numbers and letters used to identify wallets. However, they are long, confusing, and don’t say much about the user. With crypto address labels, we provide human-readable names or descriptions for these wallets, making it easier for users to identify actors involved in transactions. 

Crypto Address Labels graphical art image

Crypto address labels have many benefits, such as reducing error risks, allowing users to quickly identify where payments are coming from, etc., all benefits that contribute to a more compelling experience for end users. 

While you can label publicly known addresses, it can quickly become a tedious and time-consuming task. Fortunately, with the Moralis API, you can avoid reinventing the wheel as we have done the hard work for you!

If you’d like to learn more about how this works in practice, join us in the next section as we show you how to get crypto address labels with Moralis!

How to Get Crypto Address Labels 

As previously mentioned, when working with Moralis, you get crypto address labels for any transaction and transfers that include a to_address or from_address parameter. This means that multiple endpoints support crypto address labels, and down below, you’ll find a list of a few examples: 

  • getWalletTransactions()
  • getWalletTransactionsVerbose()
  • getWalletNFTTransfers()
  • getNFTContractTransfers()
  • getWalletTokenTransfers()

To illustrate how this works, we’ll be using the getWalletTransactions() endpoint. And thanks to the accessibility of the Moralis API, you can now get crypto address labels in three straightforward steps: 

  • Step 1: Get a Moralis API Key
  • Step 2: Create a Script
  • Step 3: Run the Code

Before jumping into the first step, you need to take care of a few prerequisites! 

Note: The ”Prerequisites” part and the first step are the same as in the ”How to Check Wallet Activity” section. As such, feel free to skip these parts if you previously covered them. 

Prerequisites to Crypto Address Labels

As we’ll be using JavaScript for this brief tutorial, make sure to have the following ready: 

  • Node v.14+
  • NPM/Yarn

Once you’re done setting these up, you’re ready to jump into the tutorial’s first step on getting crypto address labels!

Step 1: Get a Moralis API Key to Get Crypto Address Labels

To be able to call the getWalletTransactions() endpoint, you need a Moralis API key. As such, go ahead and start by clicking on the ”Start for Free” button at the top right to set up your Moralis account: 

Crypto Address Labels Sign Up Page Moralis

With an account at your disposal, you’ll be able to locate your Moralis API key under the ”Settings” tab and the ”Secrets” section: 

Copy Crypto Address Label API key

Go ahead and copy your API key and save it for the next step.

Step 2: Create a Script 

Start by creating a project folder, open a new terminal, and run the following command to install the Moralis SDK: 

npm install moralis @moralisweb3/common-evm-utils

Next, create a new file called ”index.js” and add the following code: 

const Moralis = require("moralis").default;
const { EvmChain } = require("@moralisweb3/common-evm-utils");

const runApp = async () => {
  await Moralis.start({
    apiKey: "YOUR_API_KEY",
    // ...and any other configuration
  });

  const address = "0x1f9090aaE28b8a3dCeaDf281B0F12828e676c326";

  const chain = EvmChain.ETHEREUM;

  const response = await Moralis.EvmApi.transaction.getWalletTransactions({
    address,
    chain,
  });

  console.log(response.toJSON());
};

runApp();

From here, you need to replace YOUR_API_KEY with the Moralis API key you copied in the previous step: 

Inserting Crypto Address Label API Key into code

You also need to configure the address and chain parameters to fit your request: 

configure the address and chain parameters to fit your crypto address label request

We then pass address and chain as parameters when calling the getWalletTransactions() endpoint: 

pass address and chain as parameters when calling the getWalletTransactions() endpoint for crypto address label

That’s it for the code. All you have to do now is to run the script! 

Step 3: Run the Code 

To run the code, simply open a new terminal, cd into the root folder of the project, input the following command, and hit enter: 

node index.js

In return, you’ll get a response containing all the transactions appertaining to the address in question. It will look something like this: 

//…
  "result": {
    "hash": "0x057Ec652A4F150f7FF94f089A38008f49a0DF88e",
    "nonce": 326595425,
    "transaction_index": 25,
    "from_address": "0xd4a3BebD824189481FC45363602b83C9c7e9cbDf",
    "to_address": "0xa71db868318f0a0bae9411347cd4a6fa23d8d4ef",
    "from_address_label": "Binance 1",
    "to_address_label": "Binance 2",
    "value": 650000000000000000,
//...

As you can see above, the response also contains the from_address_label and to_address_label for each transaction: 

Response code for crypto address labels

That’s it! When working with Moralis, it doesn’t have to be more challenging than that to get crypto address labels! 

Crypto Address Labels Use Cases 

No matter what Web3 project you’re aiming to build, you’ll likely find that crypto address labels come in handy. However, to exemplify, we’ll take a closer look at three prominent examples of crypto address label use cases: 

  • Trading App: When building a trading app, crypto address labels become crucial for the user experience. Crypto address labels provide human-friendly identifiers, giving users better insight into who they are trading with. 
  • Web3 Wallet: When building a Web3 wallet, it can be beneficial to, for instance, include crypto address labels when displaying a user’s transaction history. It will improve the user experience by giving users better insight into their transaction history. 
Crypto Address Labels Use Cases displayed
  • Identify Transactions: Lastly, crypto address labels can also come in handy when trying to identify transactions. This can be useful for individual traders who want to monitor whales, seeing their activity with various exchanges, DEXs, and other marketplaces.

Nevertheless, if you want to learn more about crypto address labels and how they can be used in practice, take a look at this video from the Moralis YouTube channel: 

Summary: Check Wallet Activity and Get Crypto Address Labels 

In today’s article, we showed you how to check wallet activity and get crypto address labels using Moralis in three straightforward steps: 

  • Step 1: Get a Moralis API Key
  • Step 2: Create a Script
  • Step 3: Run the Code

Consequently, if you have followed along this far, you can now seamlessly integrate this functionality into your future projects! 

If you found this tutorial helpful, consider exploring some additional guides here at Moralis. For example, learn what an Ethereum testnet is, read about account abstraction, or explore the industry’s leading NFT image API

Furthermore, if you have ambitions to build more sophisticated Web3 projects, make sure to check out some more tools Moralis offers. For example, explore the Token API and learn how to get the ERC20 token balance from any address in the blink of an eye! 

Title - Moralis - #1 API provider for wallet activity and crypto address labels

If you want access to these industry-leading APIs and many others, don’t forget to sign up with Moralis. You can set up your account for free and start building projects faster and more efficiently immediately!

NFT API
Unlock the full potential of your NFT projects with this industry-leading NFT API! Fast, easy, and free.
NFT API
Related Articles
September 20, 2023

Ethereum Testnet – Full Ethereum Test Network Guide

December 9, 2022

ERC 1155 NFTs – What is the ERC-1155 Standard?

August 22, 2022

How to Integrate Backend Web3 Authentication Functionality

January 17, 2023

Polygon Mumbai Faucet – Get Free MATIC with this Mumbai Faucet

November 12, 2022

Ethereum Webhooks – What They are and How to Use Webhooks for Ethereum 

March 7, 2023

How to Create a Blockchain Explorer

November 2, 2022

The Ultimate Blockchain Tech Stack Guide

August 12, 2022

Moralis Projects – Web3 Magic Treasure Chest

January 12, 2024

Full List of DEXs – Best Decentralized Crypto Exchanges