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
Response Fields
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
ISO timestamp of risk assessment
Example
curl -X GET \
"https://aml.anchainai.com/api/crypto_screening?protocol=btc&address=15PggTG7YhJKiE6B16vkKzA1YDTZipXEX4" \
-H "Authorization: Bearer $APIKEY"
/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)
Example
curl -X POST \
"https://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
Example
curl -X GET \
"https://aml.anchainai.com/api/ip_screening?ip_address=1.2.3.4" \
-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