API Documentation

Comprehensive guide to integrating Anchain.ai AML API

Authentication

Secure your API requests with authentication tokens

All API requests require authentication using your API key. Include your key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

API Endpoints

Available endpoints for AML screening and risk analysis

GET
/api/crypto_screening
🔒 Auth Required

Screen cryptocurrency addresses for risk factors and sanctions compliance

Parameters
Required
protocol(string)

The blockchain protocol code (e.g., btc, eth, sol)

Required
address(string)

Cryptocurrency address to screen

Response Fields
string
data.protocol

The blockchain protocol that was screened

string
data.address

The cryptocurrency address that was screened

number
data.risk_score

Calculated risk score (0-100)

string
data.risk_level

Risk level (Low/Guarded/High/Severe)

array
data.risk_factors

List of risk factors with category and optional name

string
data.entity_type

Comma-separated entity types if available

string
data.verdict_time

ISO timestamp of risk assessment

Example
curl -X GET \
  "https://aml.anchainai.com/api/crypto_screening?protocol=btc&address=15PggTG7YhJKiE6B16vkKzA1YDTZipXEX4" \
  -H "Authorization: Bearer $APIKEY"
POST
/api/sanctions_screening
🔒 Auth Required

Perform sanctions screening against global watchlists from OFAC, EU, UN, and other global regulators

Parameters
Optional
schema(string)

Entity type to screen (e.g. 'person', 'organization')

Optional
scope(string)

Search scope (basic/full). Default: basic. Full scope requires paid plan

Optional
properties.name(array of strings)

List of names/aliases (max 10, e.g. ["John Doe"])

Optional
properties.nationality(array of strings)

List of ISO 3166-1 alpha-2 country codes (e.g. ["us", "cn"])

Optional
properties.idNumber(array of strings)

List of identification numbers (passport, national ID, etc.)

Optional
properties.birthYear(array of strings)

List of birth years in YYYY format (e.g. ["1977"])

Response Fields
number
data.risk_score

Overall risk score (0 for no matches, 100 for matches found)

string
data.risk_level

Risk level based on score (Low/Guarded/High/Severe)

number
data.sanctions.{dataset}[]._score

Match relevance score for individual entity

string
data.sanctions.{dataset}[].id

Unique entity identifier

string
data.sanctions.{dataset}[].dataset

Source dataset name (e.g. 'us_ofac')

string
data.sanctions.{dataset}[].schema

Entity type (Person/Company/etc.)

string
data.sanctions.{dataset}[].caption

Display name of matched entity

object
data.sanctions.{dataset}[].properties

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"]
    }
  }'
GET
/api/ip_screening
🔒 Auth Required

Check IP address against global sanctions lists to determine if it originates from a sanctioned country

Parameters
Required
ip_address(string)

IP address to check (e.g. '8.8.8.8')

Response Fields
number
data.risk_score

Risk score (0 for non-sanctioned, 100 for sanctioned countries)

string
data.risk_level

Risk level based on score (Low/Guarded/High/Severe)

string
data.ip_address

The IP address that was checked

string
data.country

Country name where IP is located

string
data.country_code

2-letter country code (ISO 3166-1)

string
data.subdivsion

State/province subdivision if available, Requires Pro Plan

string
data.city

City name if available, Requires Pro Plan

boolean
data.is_sanctioned

Whether IP is from a sanctioned country

array
data.matched_sanction_list

List of sanction lists that matched this country

string
data.reason

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

Bitcoin (BTC)
Ethereum (ETH)
Solana (SOL)
Stellar (XLM)
Tron (TRX)
Elrond (EGLD)
Ripple (XRP)
Bitcoin Cash (BCH)
Litecoin (LTC)
Algorand (ALGO)
Bitcoin SV (BSV)
Dash (DASH)
Verge Currency (XVG)
Zcash (ZEC)

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

200
OK

Request successful

Example Response:

{
  "status": 200,
  "err_msg": "",
  "data": { ... }
}
400
Bad Request

Invalid request parameters or malformed JSON

Example Response:

{
  "status": 400,
  "err_msg": "Missing required field: name",
  "data": null
}
401
Unauthorized

Invalid or missing API key

Example Response:

{
  "status": 401,
  "err_msg": "Invalid API key",
  "data": null
}
403
Forbidden

API key does not have permission for this resource

Example Response:

{
  "status": 403,
  "err_msg": "Insufficient permissions",
  "data": null
}
404
Not Found

Endpoint does not exist

Example Response:

{
  "status": 404,
  "err_msg": "Endpoint not found",
  "data": null
}
429
Too Many Requests

Rate limit exceeded

Example Response:

{
  "status": 429,
  "err_msg": "Rate limit exceeded. Try again in 60 seconds",
  "data": null
}
500
Internal Server Error

Server encountered an unexpected condition

Example Response:

{
  "status": 500,
  "err_msg": "Internal server error",
  "data": null
}
502
Bad Gateway

Invalid response from upstream server

Example Response:

{
  "status": 502,
  "err_msg": "Bad gateway",
  "data": null
}
503
Service Unavailable

Service temporarily unavailable

Example Response:

{
  "status": 503,
  "err_msg": "Service unavailable. Please try again later",
  "data": null
}

Error Handling Best Practices

Always check the status field before processing data
Implement retry logic for 5xx server errors with exponential backoff
Handle rate limiting (429) by respecting the retry-after header
Log error messages for debugging and monitoring purposes
Validate API keys and refresh tokens before making requests