Is Spam Contract
Determines whether a specific contract is marked as spam by Alchemy. Works for NFT contracts (ERC-721 and ERC-1155) and, in beta, for ERC-20 token contracts.
ERC-20 tokens (beta)
Pass contractType=erc20 to check an ERC-20 token contract. In a 200 OK response, isSpamContract is true if the token is classified as spam or a scam, and false if it isn't. The successful response format is the same as for NFT contracts. If you omit contractType, it defaults to nft, so existing callers are unaffected.
ERC-20 spam detection is available on the Ethereum (eth-mainnet), Base (base-mainnet), Polygon PoS (polygon-mainnet), BNB Smart Chain (bnb-mainnet), Arbitrum (arb-mainnet), Optimism (opt-mainnet) and Robinhood Chain (robinhood-mainnet) mainnets. NFT spam coverage is unchanged.
202 Accepted with {"isSpamContract":null}. A null value means "still analyzing; retry". It does not mean "not spam". Wait for the time specified by the Retry-After response header, then retry the same request. If the retry also returns 202, wait for that response's Retry-After value and retry again. A 200 OK response provides the boolean result.ERC-20 request example (USDC on Ethereum):
curl --request GET \
--url 'https://eth-mainnet.g.alchemy.com/nft/v3/YOUR_API_KEY/isSpamContract?contractAddress=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&contractType=erc20'Path Parameters
docs-demoFor higher throughput, create your own API key
Query Parameters
0x495f947276749ce646f68ac8c248420045cb7b5eString - Token contract address to check. Supports NFT contracts (ERC-721 and ERC-1155) and ERC-20 token contracts (beta). The endpoint doesn't check that the address is a token contract of the given contractType.
nftThe type of contract to check. Defaults to nft, so existing callers are unaffected. ERC-20 checks require contractType=erc20.
Defaults to "nft".
Responses
200
Returns whether the specified contract is marked as spam.
202
Accepted. The ERC-20 token is still being analyzed; isSpamContract: null is a pending result, not a "not spam" result. Wait for the time specified by the Retry-After response header, then retry the same request. If the retry also returns 202, use its Retry-After value before retrying again.
400
Invalid parameters or an unsupported network. An invalid contractType returns contractType must be nft or erc20, got: <value>, where <value> is the submitted value. A malformed address returns contractAddress should be a valid address. ERC-20 checks on an unsupported network return the network-not-enabled error shown below.