API Documentation
Comprehensive guide to integrating Anchain.ai AML API
Authentication
Secure your API requests with authentication tokens
API Endpoints
Available endpoints for AML screening and risk analysis
/api/crypto_screening
Screen cryptocurrency addresses for risk factors and sanctions compliance
Parameters
The blockchain protocol code (e.g., btc, eth, sol)
Cryptocurrency address to screen
Analysis type (default: 'score'). Options: 'score' (basic risk assessment), 'activity' (detailed suspicious activity analysis), 'attribution' (transaction flow attribution - pro plans only)
Response Fields
The analysis type that was performed
The blockchain protocol that was screened
The cryptocurrency address that was screened
Calculated risk score (0-100)
Risk level (Low/Guarded/High/Severe)
List of risk factors with category and optional name
Comma-separated entity types if available
Detailed suspicious activity analysis (action=activity only)
Transaction flow attribution with counterparty analysis (action=attribution only)
Examples
Basic Usage (action=score)
curl -X GET \
"https://staging-aml.anchainai.com/api/crypto_screening?protocol=btc&address=bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h&action=score" \
-H "Authorization: Bearer $APIKEY"
Activity Analysis (action=activity)
curl -X GET \
"https://staging-aml.anchainai.com/api/crypto_screening?protocol=btc&address=bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h&action=activity" \
-H "Authorization: Bearer $APIKEY"
Attribution Analysis (action=attribution, Premium Plans Only)
curl -X GET \
"https://staging-aml.anchainai.com/api/crypto_screening?protocol=btc&address=bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h&action=attribution" \
-H "Authorization: Bearer $APIKEY"
/api/crypto_auto_trace
Crypto auto-trace transaction flows for investigation and analysis
Parameters
Blockchain protocol. Supported: btc (Bitcoin), eth (Ethereum), xrp (Ripple), egld (MultiversX), trx (Tron)
Wallet address to auto-trace from (required if txnhash not provided)
Transaction hash to auto-trace from (required if address not provided)
Auto-trace direction: 'in' for incoming, 'out' for outgoing (default: 'in')
Start timestamp (Unix epoch)
End timestamp (Unix epoch)
Number of past days to include around transaction time (default: 365)
Maximum auto-tracing depth, range [1-10] (default: 10)
Maximum number of nodes to auto-trace per hop, range [1-100] (default: 20)
Minimum transaction amount per hop (default: 0)
Maximum transaction amount per hop
Token address filter
NFT token ID filter
Cap each hop by total transaction value (0: no cap, 1: cap applied)
Priority for selecting nodes: 'time,amount' or 'amount,time'
Generate xlsx report (0: no, 1: yes)
Response Fields
The blockchain protocol that was traced (btc/eth/xrp/egld/trx)
The auto-trace direction that was used
Maximum auto-tracing depth used
Maximum number of nodes traced per hop
The wallet address that was traced (if provided)
The transaction hash that was traced (if provided)
Auto-trace path information with transaction details
Address labels mapping for entity identification
Token information and metadata
Cluster analysis data
Examples
Basic Usage
curl -X POST \
"https://staging-aml.anchainai.com/api/crypto_auto_trace" \
-H "Authorization: Bearer $APIKEY" \
-H "Content-Type: application/json" \
-d '{
"proto": "btc",
"address": "13fhnkmpBBWXUQucJd6efWvXdEj78DKavk",
"direct": "out",
"max_hop": 5,
"max_node": 20,
"time_from": 1659283200,
"time_to": 1753977600,
"min_amount": 0.0001
}'
/api/sanctions_screening
Perform sanctions screening against global watchlists from OFAC, EU, UN, and other global regulators
Parameters
Entity type to screen (e.g. 'person', 'organization')
Search scope (basic/full). Default: basic. Full scope requires paid plan
List of names/aliases (max 10, e.g. ["John Doe"])
List of ISO 3166-1 alpha-2 country codes (e.g. ["us", "cn"])
List of identification numbers (passport, national ID, etc.)
List of birth years in YYYY format (e.g. ["1977"])
Response Fields
Overall risk score (0 for no matches, 100 for matches found)
Risk level based on score (Low/Guarded/High/Severe)
Match relevance score for individual entity
Unique entity identifier
Source dataset name (e.g. 'us_ofac')
Entity type (Person/Company/etc.)
Display name of matched entity
Additional entity properties (varies by entity)
Examples
Basic Usage
curl -X POST \
"https://staging-aml.anchainai.com/api/sanctions_screening" \
-H "Authorization: Bearer $APIKEY" \
-H "Content-Type: application/json" \
-d '{
"schema": "person",
"properties": {
"name": ["Wei Zhang"],
"nationality": ["cn"],
"birthYear": ["1977"]
}
}'
/api/ip_screening
Check IP address against global sanctions lists to determine if it originates from a sanctioned country
Parameters
IP address to check (e.g. '8.8.8.8')
Response Fields
Risk score (0 for non-sanctioned, 100 for sanctioned countries)
Risk level based on score (Low/Guarded/High/Severe)
The IP address that was checked
Country name where IP is located
2-letter country code (ISO 3166-1)
State/province subdivision if available, Requires Pro Plan
City name if available, Requires Pro Plan
Whether IP is from a sanctioned country
List of sanction lists that matched this country
Explanation of sanction status
Examples
Basic Usage
curl -X GET \
"https://staging-aml.anchainai.com/api/ip_screening?ip_address=1.2.3.4" \
-H "Authorization: Bearer $APIKEY"
/api/smart_contract_agent
Transaction analysis service for blockchain data retrieval
Parameters
Blockchain protocol (e.g., 'eth', 'bnb')
Transaction hash to analyze
Response Fields
The analysis type that was performed
The blockchain protocol that was analyzed
The transaction hash that was analyzed
Transaction analysis results
Transaction overview with basic information
Balance changes summary
Transaction flow graph with vertices and edges
Token information and metadata mapping
Detailed transaction execution data including calls, gas usage, and trace information
Examples
Basic Usage
curl -X GET \
"https://staging-aml.anchainai.com/api/smart_contract_agent?protocol=eth&transaction_hash=0xfd04466bb91ec4270172acffe187eea57145a906de9b488a0f410ade1569760e" \
-H "Authorization: Bearer $APIKEY"
Supported Blockchain Networks
Comprehensive coverage across major blockchain ecosystems
Need support for another chain?
Error Handling
HTTP status codes and error response formats
Response Format
All API responses follow a consistent structure with status, error message, and data fields:
{
"status": <HTTP_STATUS_CODE>,
"err_msg": "<ERROR_MESSAGE>",
"data": <RESPONSE_DATA_OR_NULL>
}
HTTP Status Codes
Request successful
Example Response:
{
"status": 200,
"err_msg": "",
"data": { ... }
}
Invalid request parameters or malformed JSON
Example Response:
{
"status": 400,
"err_msg": "Missing required field: name",
"data": null
}
Invalid or missing API key
Example Response:
{
"status": 401,
"err_msg": "Invalid API key",
"data": null
}
API key does not have permission for this resource
Example Response:
{
"status": 403,
"err_msg": "Insufficient permissions",
"data": null
}
Endpoint does not exist
Example Response:
{
"status": 404,
"err_msg": "Endpoint not found",
"data": null
}
Rate limit exceeded
Example Response:
{
"status": 429,
"err_msg": "Rate limit exceeded. Try again in 60 seconds",
"data": null
}
Server encountered an unexpected condition
Example Response:
{
"status": 500,
"err_msg": "Internal server error",
"data": null
}
Invalid response from upstream server
Example Response:
{
"status": 502,
"err_msg": "Bad gateway",
"data": null
}
Service temporarily unavailable
Example Response:
{
"status": 503,
"err_msg": "Service unavailable. Please try again later",
"data": null
}
Error Handling Best Practices
status
field before processing data