RuleRunner API Documentation

Welcome to the Rulerunner™ API documentation. Here you'll find all the information you need to integrate our compliance services into your application.

Python and TypeScript SDKs are available, with source code hosted on GitHub at RuleRunnerSDK. A Postman collection and environment are also available for easy integration.

Why RuleRunner?

RuleRunner provides a lightning-fast sanctions & compliance engine you can call from any on-chain or off-chain workflow. It returns deterministic Merkle-proofs in milliseconds so you can prove to counterparties (or auditors) exactly why a transaction was allowed or blocked.

In short: we ship the heavy compliance logic, you stay focused on product.

When should you use it?

  • Centralised exchange pre-trade checks – call the API in your matching-engine to guarantee sanctioned wallets never reach the order-book.
  • DeFi wallet plug-in – surface real-time compliance warnings before a user signs the tx.
  • Fintech payment gateway – embed RuleRunner in your payout pipeline to meet AML obligations without weeks of in-house dev.
Checking API status… Loading root… ComplianceRegistry:  0x28D83952…

Quick-start

  1. Sign up or log in at dashboard.
  2. Copy your personal API key from the dashboard.
  3. Test the endpoint with one of the snippets below – it should return "is_compliant": true.

For a fully interactive experience where you can explore all available API endpoints and try them out live, check out our Swagger UI API explorer →

curl -H "X-API-Key: YOUR_API_KEY" \
          -H 'Content-Type: application/json' \
          'https://api.rulerunner.io/api/v1/isCompliant' \
          -d '{"from_address":"0x7FF9c...","to_address":"0x742d...","amount":"1.0"}'
     

API Reference

POST /api/v1/isCompliant

Checks if a transaction is compliant based on the latest sanctions data and other rules.

Request Body:
{
    "from_address": "string",
    "to_address": "string",
    "amount": "string"
}
Example Response (Success 200 OK):
{
    "is_compliant": true,
    "message": "Transaction is compliant based on currently loaded sanctions lists.",
    "from_address_sanctioned": false,
    "to_address_sanctioned": false,
    "from_address_proof": null,
    "to_address_proof": null,
    "merkle_root": "some_merkle_root_hash_string",
    "from_entity_details": null,
    "to_entity_details": null,
    "checked_lists": ["OFAC_LLM", "EU_LLM"]
}
Request & response schema
Field Type Required Description
from_addressstring (wallet address)YesSender wallet address to check
to_addressstring (wallet address)YesRecipient wallet address
amountstring/decimalYesAmount transferred (any units, used only for logging)

Successful Response 200 OK

FieldTypeDescription
is_compliantbooleanOverall result – true if neither address is sanctioned.
messagestringHuman-readable summary of the check.
from_address_sanctionedbooleanSender flagged?
to_address_sanctionedbooleanRecipient flagged?
from_address_proof / to_address_proofarray|nullMerkle proof if address is sanctioned, else null.
merkle_rootstringRoot used for verification.
checked_listsarray<string>Sanctions lists applied.

Error Responses

StatusConditionSchema
400Malformed body / missing fields{ "detail": "string" }
401Missing or invalid API key{ "detail": "Unauthorized" }
429Monthly or burst quota exceeded{ "detail": "Monthly quota exceeded" }
503Service warming up{ "detail": "Service not ready…" }

Rate limits: 100 requests per minute burst.
Monthly allowance per tier – Free: 500, Starter: 10,000, Pro: 50,000.
Overage is $0.002/check.

GET /api/v1/health

Returns the health status of the API, including the current Merkle root and loaded sanctions lists.

Example Response (Success 200 OK):
{
    "status": "ok",
    "version": "0.1.1",
    "sanctions_addresses_count": 12345,
    "merkle_root": "some_merkle_root_hash_string",
    "active_lists": ["OFAC_LLM", "EU_LLM"]
}

SDKs Overview

We provide SDKs in popular languages to simplify your integration with the RuleRunner API. The primary SDKs are for Python and TypeScript/JavaScript. You can find the source code and more details in the RuleRunnerSDK GitHub repository.

Python SDK

Install it via pip:

# pip install rulerunner-sdk
        
Example Usage:
from rulerunner_sdk import RuleRunnerClient

# Initialize the client with your API key
client = RuleRunnerClient(api_key="YOUR_API_KEY")

# Check if a transaction is compliant
result = client.is_compliant(
    from_address="0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9",
    to_address="0x742d35Cc6634C0532925a3b844Bc454e4438f44f",
    amount="1.0"
)

print(f"Transaction is compliant: {result['is_compliant']}")
print("--------------------------------")
print(result.get("from_entity_details"))
print("--------------------------------")

# Verify a proof locally
if not result['is_compliant'] and result.get('from_address_proof'):
    is_valid = client.verify_proof_locally(
        address="0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9",
        proof=result.get("from_address_proof"),
        root=result['merkle_root']
    )
    print(f"Local proof verification: {is_valid}")


TypeScript / JavaScript SDK

A lightweight TypeScript/JavaScript SDK is available on npm.

# npm install @rulerunner/sdk
import { RuleRunner } from '@rulerunner/sdk';

// Initialize the client with your API key
const client = new RuleRunner({
  apiKey: 'YOUR_API_KEY'
});

// Check if a transaction is compliant
const result = await client.isCompliant({
  from_address: '0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9',
  to_address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44f',
  amount: '10.0'
});

console.log(`Transaction is compliant: ${result.is_compliant}`);

// Verify a proof locally
if (!result.is_compliant && result.from_address_proof) {
  const isValid = await client.verifyProofLocally(
    '0x7FF9cFad3877F21d41Da833E2F775dB0569eE3D9',
    result.from_address_proof,
    result.merkle_root
  );
  console.log(`Local proof verification: ${isValid}`);
}

Support

Join our Slack or email support@rulerunner.io.