SafeCheck API Documentation

The SafeCheck API allows you to verify the authenticity of financial receipts from various banks worldwide. This documentation provides details on how to integrate with our API.

GET/POST https://ru.safecheck.online/api

Base endpoint for all API requests.

Authentication

All API requests (except documentation) require authentication via headers:

Header Description Required
SC-API-KEY Your API key Yes
SC-USER-ID Your user ID No

Example of authenticated request in Python:

import requests

headers = {
    'SC-API-KEY': 'your_api_key_here',
    'SC-USER-ID': 'your_user_id_here'
}

response = requests.get('https://ru.safecheck.online/api/getAccountInfo', headers=headers)
print(response.json())

Rate Limiting

The API has a rate limit of 120 requests per minute. Exceeding this limit will result in HTTP 429 responses.

GET /getAccountInfo

Retrieve information about your account, including balance, subscription details, and verification statistics.

GET /getAccountInfo

Example Request

import requests
        import json
        
        endpoint = "https://ru.safecheck.online/api"
        headers = {
            'SC-API-KEY': 'abcde',
            'SC-USER-ID': '1'
        }
        
        response = requests.get(url=endpoint+'/getAccountInfo', headers=headers)
        print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
            "error": 0,
            "msg": "",
            "result": {
                "user_id": 12345,
                "username": "username",
                "status": "1",
                "chromeextensiontime": 1755456715,
                "balance": 1539.05,
                "refferal_balance": 0.5,
                "checks_balance": 970,
                "orig_checks_cnt": 117,
                "fake_checks_cnt": 69
            }
        }

Response Fields

Field Type Description
error integer 0 for success, 1 for error
msg string Error message if error=1
result.user_id integer Your unique user ID
result.username string Your account username
result.status string Account status (1 - active, 0 - inactive)
result.chromeextensiontime integer Unix timestamp until which the Chrome extension subscription is active
result.balance float Your main account balance
result.refferal_balance float Balance earned from referral program
result.checks_balance integer Number of available checks in your account
result.orig_checks_cnt integer Total number of original checks verified
result.fake_checks_cnt integer Total number of fake checks detected

POST /check

Submit a receipt file for verification. The API supports PDF files from various banking systems worldwide.

POST /check

Parameters

Parameter Type Description
file file The receipt file to verify (PDF format)

Example Request

import requests
import json

endpoint = "https://ru.safecheck.online/api"
headers = {
    'SC-API-KEY': 'abcde',
    'SC-USER-ID': '1'
}

files = {
    'file': open('/path/to/file.pdf', 'rb')
}

response = requests.post(url=endpoint+'/check', headers=headers, files=files)
print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
    "error": 0,
    "msg": "",
    "result": {
        "status": "checking",
        "file_id": "a13f3ce6-763b-43ae-81f3-817c9a06da0f"
    }
}

Response Fields

Field Type Description
error integer 0 for success, 1 for error
msg string Error message if error=1
result.file_id string Unique ID for the check operation
result.status string Initial status ("checking")

GET /getCheck

Retrieve the result of a check operation. The verification process typically takes 5-15 seconds.

GET /getCheck

Parameters

Parameter Type Description
file_id string File ID from check operation (query parameter)

Example Request

import requests
import json

endpoint = "https://ru.safecheck.online/api"
headers = {
    'SC-API-KEY': 'abcde',
    'SC-USER-ID': '1'
}

response = requests.get(
    url=endpoint+'/getCheck?file_id=3acd6334-2a3e-423b-b1bc-cdd054e35311',
    headers=headers
)
print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
    "error": 0,
    "msg": "",
    "result": {
        "color": "white",
        "verifier": "domrf_default",
        "check_data": {
            "sum": "40000 ₽",
            "date": 1736069820,
            "status": "Исполнено",
            "sender_fio": "Олег Вячеславович Я.",
            "sender_req": "•   21230",
            "sender_bank": "Дом.РФ",
            "recipient_fio": "Александра Валерьевна К.",
            "recipient_req": "7777777777",
            "recipient_bank": "Сбербанк"
        },
        "is_original": true,
        "device_error": false,
        "struct_passed": true,
        "struct_result": "16/16",
        "recommendation": "Ok",
        "file_id": "9afddefd-7cda-4757-a4ae-e9c50977ada2",
        "status": "completed",
        "check_timestamp": 1752836110
    }
}

Response Fields

Field Type Description
error integer 0 for success, 1 for error
msg string Error message if error=1
result.color string Verification status: "white" (clean), "yellow" (suspicious), "red" (fake), "black" (fake), "not_supported" (bank not supported)
result.verifier string Bank verification module used
result.check_data object Extracted check data (amount, date, parties, etc.)
result.is_original boolean True if check is verified as original
result.device_error boolean True if file was saved incorrectly
result.struct_passed boolean True if structure check passed
result.struct_result string Structure check score (e.g. "16/16")
result.recommendation string System recommendation: "Ok", "Warning", or "Fake"
result.file_id string Unique file ID
result.status string Check status ("completed")
result.check_timestamp integer Unix timestamp of check completion

GET /getAllChecks

Retrieve results of all checks performed in the last 24 hours. Useful for batch processing and analytics.

GET /getAllChecks

Example Request

import requests
import json

endpoint = "https://ru.safecheck.online/api"
headers = {
    'SC-API-KEY': 'abcde',
    'SC-USER-ID': '1'
}

response = requests.get(url=endpoint+'/getAllChecks', headers=headers)
print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
    "error": 0,
    "msg": "",
    "result": [
        {
            "color": "white",
            "verifier": "domrf_default",
            "check_data": {
                "sum": "40000 ₽",
                "date": 1736069820,
                "status": "Исполнено",
                "sender_fio": "Олег Вячеславович Я.",
                "sender_req": "•   21230",
                "sender_bank": "Дом.РФ",
                "recipient_fio": "Александра Валерьевна К.",
                "recipient_req": "7777777777",
                "recipient_bank": "Сбербанк"
            },
            "is_original": true,
            "device_error": false,
            "struct_passed": true,
            "struct_result": "16/16",
            "recommendation": "Ok",
            "file_id": "9afddefd-7cda-4757-a4ae-e9c50977ada2",
            "status": "completed",
            "check_timestamp": 1752836110
        }
    ]
}

Note: The response contains an array of check results with the same structure as the /getCheck endpoint response.

GET /get_mail_checks

returns all receipts verified by mail.

GET /get_mail_checks

Example Request

import requests
import json

endpoint = "https://ru.safecheck.online/api"
headers = {
    'SC-API-KEY': 'abcde',
    'SC-USER-ID': '1'
}

response = requests.get(url=endpoint+'/get_mail_checks', headers=headers)
print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
    "error": 0,
    "msg": "",
    "result": [
        {
            "color": "white",
            "verifier": "domrf_default",
            "check_data": {
                "sum": "40000 ₽",
                "date": 1736069820,
                "status": "Исполнено",
                "sender_fio": "Олег Вячеславович Я.",
                "sender_req": "•   21230",
                "sender_bank": "Дом.РФ",
                "recipient_fio": "Александра Валерьевна К.",
                "recipient_req": "7777777777",
                "recipient_bank": "Сбербанк"
            },
            "is_original": true,
            "device_error": false,
            "struct_passed": true,
            "struct_result": "16/16",
            "recommendation": "Ok",
            "status": "completed",
            "check_timestamp": 1752836110
        }
    ]
}

Note: The response contains an array of check results with the same structure as the /getCheck endpoint response.

POST /check_report

Submit a report about a specific check. This helps improve our verification algorithms.

POST /check_report

Parameters

Parameter Type Description
file_id string File ID from the original check operation

Example Request

import requests
import json

endpoint = "https://ru.safecheck.online/api"
headers = {
    'SC-API-KEY': 'abcde',
    'SC-USER-ID': '1'
}
data = {
    'file_id':'1-2-3-4-5'
}
response = requests.post(url=endpoint+'/check_report', headers=headers, json=data)
print(json.dumps(response.json(), sort_keys=True, indent=4, ensure_ascii=False))

Example Response

{
    "error": 0,
    "msg": "",
    "result": true
}

Response Fields

Field Type Description
error integer 0 for success, 1 for error
msg string Error message if error=1
result boolean True if report was successfully submitted

Full Example Program

Here's a complete Python program that demonstrates the API workflow from authentication to check verification:

import requests
import json
import time

class SafeCheckAPI:
    def __init__(self, api_key, user_id=None):
        self.base_url = "https://ru.safecheck.online/api"
        self.headers = {
            'SC-API-KEY': api_key,
        }
        if user_id:
            self.headers['SC-USER-ID'] = str(user_id)
    
    def get_account_info(self):
        """Get account information including balance and stats"""
        response = requests.get(
            url=self.base_url + '/getAccountInfo',
            headers=self.headers
        )
        return response.json()
    
    def check_receipt(self, file_path):
        """Submit a receipt PDF for verification"""
        with open(file_path, 'rb') as f:
            files = {'file': f}
            response = requests.post(
                url=self.base_url + '/check',
                headers=self.headers,
                files=files
            )
        return response.json()
    
    def get_check_result(self, file_id, max_retries=10, delay=3):
        """Poll for check results with retries"""
        for _ in range(max_retries):
            response = requests.get(
                url=self.base_url + f'/getCheck?file_id={file_id}',
                headers=self.headers
            )
            data = response.json()
            
            if data.get('error', 1) == 1:
                return data
            
            if data['result']['status'] == 'completed':
                return data
            
            time.sleep(delay)
        
        return {
            "error": 1,
            "msg": "Max retries reached without completion"
        }

def main():
    # Initialize API client
    api_key = input("Enter your API key: ")
    user_id = input("Enter your user ID (optional, press Enter to skip): ")
    
    client = SafeCheckAPI(api_key, user_id if user_id else None)
    
    # Get and display account info
    print("\nFetching account information...")
    account_info = client.get_account_info()
    
    if account_info.get('error', 1) == 1:
        print(f"Error: {account_info.get('msg', 'Unknown error')}")
        return
    
    print("\nAccount Information:")
    print(f"Username: {account_info['result']['username']}")
    print(f"User ID: {account_info['result']['user_id']}")
    print(f"Checks Balance: {account_info['result']['checks_balance']}")
    print(f"USDT Balance: {account_info['result']['usdt_balance']}")
    print(f"Total Checks: {account_info['result']['total_checks_cnt']}")
    print(f"Original Checks: {account_info['result']['original_checks_cnt']}")
    print(f"Fake Checks: {account_info['result']['fake_checks_cnt']}")
    
    # Check a receipt
    file_path = input("\nEnter path to receipt PDF file: ")
    print("\nSubmitting receipt for verification...")
    check_response = client.check_receipt(file_path)
    
    if check_response.get('error', 1) == 1:
        print(f"Error: {check_response.get('msg', 'Unknown error')}")
        return
    
    file_id = check_response['result']['file_id']
    print(f"Check initiated. File ID: {file_id}")
    
    # Get check result
    print("\nWaiting for verification results...")
    check_result = client.get_check_result(file_id)
    
    if check_result.get('error', 1) == 1:
        print(f"Error: {check_result.get('msg', 'Unknown error')}")
        return
    
    print("\nVerification Results:")
    print(f"Status: {check_result['result']['status']}")
    print(f"Is Original: {check_result['result']['is_original']}")
    print(f"Recommendation: {check_result['result']['recommendation']}")
    print(f"Color: {check_result['result']['color']}")
    print(f"Structure Passed: {check_result['result']['struct_passed']}")
    print(f"Structure Result: {check_result['result']['struct_result']}")
    print(f"Verifier: {check_result['result']['verifier']}")
    
    print("\nCheck Data:")
    check_data = check_result['result']['check_data']
    print(f"Sender: {check_data['sender_fio']} ({check_data['sender_bank']})")
    print(f"Recipient: {check_data['recipient_fio']} ({check_data['recipient_bank']})")
    print(f"Amount: {check_data['sum']}")
    print(f"Date: {check_data['date']}")
    print(f"Status: {check_data['status']}")

if __name__ == "__main__":
    main()