Skip to main content
Zerion’s API includes a built-in spam detection system that flags low-quality or deceptive assets. Each asset and transaction includes an is_trash boolean in the response, which you can use to filter out spam without building your own detection logic. How is_trash is determined depends on the data type: for positions, it’s a per-asset classification that applies the same way for every wallet. For transactions, it’s computed dynamically based on the querying wallet’s history — the same transaction can be spam for one wallet and not for another.

How it works

Positions: per-asset classification

For positions, is_trash is a property of the asset itself. The same token is classified the same way for every wallet. The classification is based on multiple signals:
  • Heuristics — Analysis of on-chain behaviors including mass airdrops, impersonation of popular assets (e.g., mimicking name/symbol), and suspicious transfer patterns.
  • External intelligence — Multiple third-party data providers to assess token quality.
  • Community feedback — Users and partners can report false positives or unflagged spam for review.
  • Internal rules — Proprietary logic applied across the system to ensure consistent filtering across APIs and frontend views.
{
  "type": "positions",
  "attributes": {
    "fungible_info": {
      "name": "Fake USDC",
      "symbol": "USDC"
    },
    "is_trash": true,
    "quantity": { "float": 1000.0 }
  }
}

Transactions: context-aware classification

For transactions, is_trash is computed dynamically per request based on the querying wallet’s history. The same transaction can be is_trash: true for one wallet and is_trash: false for another. The evaluation runs through multiple layers:
  1. User-initiated check — If the wallet owner sent the transaction themselves, it’s never flagged as spam.
  2. Interaction history — Even if a transaction looks spammy (e.g., a low-value airdrop of an unverified asset), it’s overridden to non-spam if the wallet has previously interacted with that asset.
  3. Address poisoning detection — Incoming transfers are checked against the wallet’s known legitimate recipients. If the sender address visually resembles a real address the user has sent to (matching first and last few characters), it’s flagged as a poisoning attempt — a scam where attackers send tiny transfers from look-alike addresses to trick users into copying the wrong recipient.
  4. Rule-based checks — Spam scores, mass transfer detection, blacklisted contracts, and spam NFT mint patterns.
Because transaction spam classification depends on the querying wallet’s context, the same airdrop transaction might be hidden for a wallet that has never interacted with the token, but visible for a wallet that has traded it before.

NFT collections

Spam NFT collections are filtered out by default — no spam collections are returned in API responses. Unlike fungible positions, there is no filter[trash] toggle for NFT collections.

Using the filter[trash] parameter

The filter[trash] parameter controls spam filtering on supported endpoints:
ValueBehavior
only_non_trashOnly return non-spam assets (hides spam)
only_trashOnly return spam assets
no_filterReturn everything, spam included

Default behavior

Defaults differ by endpoint:
  • Positions: defaults to only_non_trash (spam hidden)
  • Transactions: defaults to no_filter (spam included) — because transaction spam is context-aware, returning everything by default lets you apply your own filtering logic on top

Examples

# Get positions with spam hidden (default)
curl -u "YOUR_API_KEY:" \
  "https://api.zerion.io/v1/wallets/0xd8dA.../positions/?filter[trash]=only_non_trash"

# Get only spam tokens
curl -u "YOUR_API_KEY:" \
  "https://api.zerion.io/v1/wallets/0xd8dA.../positions/?filter[trash]=only_trash"

# Get everything including spam
curl -u "YOUR_API_KEY:" \
  "https://api.zerion.io/v1/wallets/0xd8dA.../positions/?filter[trash]=no_filter"

Reporting misclassifications

If you notice an asset that’s incorrectly flagged or missing a flag, report it by clicking Support in the Zerion dashboard.