getSpamContracts - SDK

Returns a list of all spam contracts marked by Alchemy.

Don’t have an API key?

Start using this method in your app today.


Returns a list of all spam contracts marked by Alchemy. For details on how Alchemy marks spam contracts, go to this link.


Promise<string[]>array of stringsA list of identified spam contracts.

Example Request and Response

Prerequisite: You will need to install the Alchemy SDK before making requests with it.

The commands for installing it using npm or yarn are given below:

npm install alchemy-sdk
yarn add alchemy-sdk


// Imports the Alchemy SDK
const { Alchemy, Network } = require("alchemy-sdk");

// Configures the Alchemy SDK
const config = {
    apiKey: "alchemy-replit", // Replace with your API key
    network: Network.ETH_MAINNET, // Replace with your network

// Creates an Alchemy object instance with the config to use for making requests
const alchemy = new Alchemy(config);

const main = async () => {
    //Call the method to return a list of spam contracts
    const response = await alchemy.nft.getSpamContracts()

    //Logging the response to the console



  ... 7368 more items

Code Sandbox

You can test out the getSpamContracts method using the code sandbox below:

Use Cases

Here are some potential use cases for the getSpamContracts method:

  • Anti-spam measures: getSpamContracts could be used to identify and flag contracts or agreements that are likely to be spam or fraudulent. For example, a system could use machine learning algorithms to analyze contracts and agreements for patterns and characteristics commonly associated with spam or fraudulent activity.

  • Contract management: getSpamContracts could be used as a tool to manage and organize a large number of contracts or agreements. By identifying contracts that are unlikely to be legitimate, the system could prioritize the review and processing of valid contracts.

  • Legal compliance: getSpamContracts could be used as part of a compliance process to ensure that all contracts and agreements meet legal and regulatory requirements. By identifying potential spam or fraudulent contracts, the system could prevent violations of legal and regulatory frameworks.

Related Methods

  • isSpamContract - Returns whether a contract is marked as spam or not by Alchemy.