For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Screen Crypto Deposits for AML Risk with GetBlock Crypto AML API

This guide teaches you how to screen incoming crypto deposits for money laundering, sanctions, and fraud exposure before crediting them, using the GetBlock Crypto AML API.

Once a crypto deposit lands in your wallet, you can't send it back. If those funds came from a sanctioned entity, a hack, or a darknet market, the problem is now yours. A downstream exchange may freeze your account, a regulator may ask for your screening records, and you may be left holding tainted funds.

A blocklist doesn't catch this, because risky funds rarely come straight from a flagged address. They pass through clusters, mixers, and intermediate wallets first. To catch them, you need to check the sender's full on-chain history and counterparties before you credit the deposit, and keep a record of every check.

In this guide, you'll learn how to build a deposit screener with the GetBlock Crypto AML API. It checks a sender wallet or an incoming transaction, turns the risk report into an ACCEPT / REVIEW / REJECT decision, and saves an audit record for every check.

What you'll build

A screenDeposit({ address | tx, network, asset }) function that:

  1. Sends the sender wallet to POST /v1/aml/wallet-check, or the deposit transaction to POST /v1/aml/tx-check.

  2. Maps the 0–100 risk score to the documented risk bands: low, medium, high, very-high.

  3. Collects the red flags: FATF flags, sanctions exposure, high-risk clusters and counterparties, and token restrictions.

  4. Returns ACCEPT, REVIEW, or REJECT, along with the reasons.

  5. Fails closed. If the check errors, the deposit is held for REVIEW instead of being credited.

  6. Adds the request, decision, and reportId to an audit log (aml-audit.jsonl).

Prerequisites

  • Node.js 18+: the project uses the built-in fetch.

  • A GetBlock account: sign up with an email. No KYB or annual contract needed.

  • Prepaid credit balance: each successful check is charged to your balance.

  • A GetBlock API key: used as the bearer token for Crypto AML requests.

  • Basic JavaScript knowledge.

Crypto AML currently supports Ethereum (eth), TRON (trx), Bitcoin (btc), Litecoin (ltc), and Bitcoin Cash (bch). See the Overview for the latest list.

Project Setup

1

Set up the project

type=module lets you use import and top-level await. dotenv is the only dependency, since fetch is built into Node 18+.

2

Get your API key

  1. Top up your balance. Web checks and API checks both draw from the same prepaid credits.

  2. Go to Settings → API Keys and create a key.

  3. Save it in a .env file:

3

Write the API caller

Create aml.js. This is the only file that talks to GetBlock. It unwraps the { data, error } envelope and throws on any non-OK response.

4

Write the decision policy

Create policy.js. It maps the score to the documented risk bands and then looks at the supporting evidence. The score alone isn't enough to make a decision. A wallet can have a medium score and still have a direct FATF flag, or belong to a high-risk cluster.

A category's share is its percentage of the exposure composition. It is not a risk score, and it doesn't tell you how much that category raised the headline score. That's why the policy only uses share to decide whether to send a deposit for review, and never adds shares together into a score.

5

Build the screener

Create screener.js. It runs the right check, applies the policy, and fails closed: if the check fails, the deposit is held for review instead of being credited. It also adds every result to an audit log. The transaction report doesn't include the tx, network, or asset you sent, so the log saves the request together with the decision.

6

Wire it into an entry point

Create index.js. It's a small CLI that screens either a wallet or a transaction, and exits with a non-zero code for anything other than a clean ACCEPT.

In a real service, run the screener inside your deposit handler, before you update the user's balance:

7

Run it

Screen a wallet:

Expected output for the wallet above. It scores in the high band but has no direct flags, so it goes to manual review:

Now screen an address on the OFAC sanctions list:

Expected output:

Here, the exposure, external-report, FATF, and token-flag components all score 0. The sanctions signal comes only from attribution: the address belongs to an OFAC SDN cluster, and USDT and USDC have restricted it. A policy that only looked at exposure or FATF flags would miss this, which is why decide() also checks the cluster and asset restrictions.

Finally, screen a USDT deposit that this sanctioned address sent:

Expected output:

The transaction report names the sender (in) and the receiver (out), each with its own score. The sanctioned sender scores 100, and all of the transfer's exposure is sanctionsExposure. Transaction reports don't include a reportId, which is why the audit log saves the request alongside the decision.

Each run also adds one line to aml-audit.jsonl:

Risk scores are estimates, and they change over time. The same address can score differently later as new on-chain activity, attribution data, and sanctions feeds come in. Save the reportId and timestamp you based each decision on, so you can explain it later.

Understanding the response

Both endpoints return the report inside a data envelope. These are the fields the screener uses:

Field
Type
What it tells you

schemaVersion

string

Version of the response schema (currently "1.0"). Check it if your integration needs to handle future versions.

overallRiskScore

number 0–100

Wallet reports only. The headline score: 0–24 low, 25–49 medium, 50–74 high, 75–100 very high.

riskScore

number 0–100

Transaction reports only. The headline score for the asset transfer you screened.

breakdown.exposure

object

The wallet's exposure profile. Contains its own score and the activityExposure, complianceExposure, counterpartyExposure, and unclassifiedExposure arrays.

*Exposure[].share

number

Each category's percentage of the exposure composition. This is not a risk score.

complianceExposure[].authorities

array

For sanctionsExposure, the sanctions exposure split by authority (UK, EU, UN).

breakdown.externalReports

object

Risk backed by confirmed external reports, with its own score.

breakdown.fatf.flags

array

Direct flags on counterparties. Each one has a flow (in/out), a category, and a count.

breakdown.tokenFlags

object

Restrictions on specific tokens, such as an issuer freeze on USDT.

attribution.owners

string[]

Known entities believed to control the wallet. Only present when available.

attribution.cluster

object

Cluster names, score, and exposure. A wallet with little activity of its own can still be risky because of the cluster it belongs to.

attribution.assetRestrictions

array

Asset restrictions linked to the wallet.

counterparties.in / .out

object address → score

Transaction reports only. The addresses that sent or received the screened transfer, with each one's risk score.

reportId

string

Wallet reports only. The unique ID of this screening. Save it with your decision for audits.

Optional arrays, such as flags, owners, authorities, and unclassifiedExposure, only appear when there is data for them. If one is missing, the check still worked. For every category value, see the Taxonomy.

Troubleshooting

Symptom
Likely cause
Fix

screening failed: Set GETBLOCK_AML_KEY

.env is missing or in the wrong folder

Copy .env.example to .env in the project root and add your key.

HTTP 401 / 403

Invalid, revoked, or missing API key

Create a new key at Settings → API Keys.

HTTP 402 insufficient_balance

Not enough prepaid credits for another check

Top up your balance in the GetBlock dashboard. Failed checks aren't charged.

HTTP 400 Supported networks: bch, btc, eth, ltc, trx

The network isn't supported (for example, sol, bsc)

Use one of the five supported network values.

HTTP 400 on tx-check

The hash isn't 64 hex characters, or asset doesn't exist on that network

Check the hash and use a valid asset: eth/usdt/usdc on ETH, trx/usdt on TRX.

A USDT deposit scores low, but you expected it to be flagged

asset was left out, so only the native coin was screened

Pass asset: "usdt" for token deposits.

riskScore: 0 with empty counterparties (REVIEW: "no counterparties returned")

The transaction has no transfer of the asset you requested, so nothing was screened

Check the hash and make sure asset matches the transfer you're crediting.

Score looks low but decision is REVIEW

A cluster, counterparty, FATF flag, or token restriction triggered the policy

This is expected. Check reasons and look at the full report in the dashboard.

The same address scores differently on different days

New on-chain activity or updated attribution and sanctions data

This is expected. Base each decision on the reportId you saved, not on a new check.

Conclusion

You built a deposit screener that calls the GetBlock Crypto AML wallet-check and tx-check endpoints, maps the score to the documented risk bands, and combines it with FATF flags, cluster and counterparty risk, and token restrictions to return ACCEPT, REVIEW, or REJECT. It fails closed when a check can't run and saves each decision with its reportId, so you can explain every deposit decision later.

Resources

Last updated

Was this helpful?