Filter Spam Tokens

Filter Spam Tokens

We Introduced a new include_spam query parameter to the ERC20 token endpoint to filter out potential spam tokens.

GET /v1/tokens/erc20/vitalik.eth&include_spam=true

The criteria for identifying spam include:

• Empty token name

• Empty token symbol

• Symbol length greater than 15 characters

• Zero decimals

By default, spam tokens are excluded from responses (include_spam=false). You can try it in our playground by visiting here. See the example bellow:

Here is a Typescript example showing how to use it in your code:

fetchTokens = async () => {
 try {
   const response = await fetch('https://1.insight.thirdweb.com/v1/tokens/erc20/vitalik.eth?metadata=true&include_spam=true', {
      headers: {
        "x-client-id": clientId,
      },
    });
   const tokensResult = await response.json();
   return tokensResult
 } catch (error) {
   console.error('Error:', error);
 }
};