API Reference for Jobs, Tasks, Payments, and User Management
All API endpoints require authentication using a Bearer token. Include the following header in your requests:
Authorization: Bearer <your_access_token>
Manage job postings, retrieve applicants, and handle job-related operations.
Retrieves a list of job applicants for a specified job. Allows for sorting, pagination, and searching within job applicants.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | Yes | The ID of the job for which to retrieve applicants | - |
task_id | string | No | The ID of the job task; used when only one task details is needed. If presend, the task result list array will contain only one task or empty array if task not found. | - |
sortby | string | No | Field by which to sort job applicants | - |
order | string | No | Sort order. Can be 'asc' for ascending or 'desc' for descending | asc |
page | integer | No | Page number for pagination | 1 |
limit | integer | No | Number of applicants per page | 10 |
hours_ago | integer | No | The day interval, specified as the number of days starting from the given hours_ago up to today | 10 |
status | string | No | The status of the task ('processing', 'confirmed', 'notcomplete', 'declined', 'pending') | confirmed |
search | string | No | Search term to filter applicants based on worker name, job proof, job title, or worker IP | developer |
Status Code | Description | Response Body |
---|---|---|
200 | Successfully retrieved job applicants | Returns job details with applicant information including planned_task, job tasks, total tasks, job done count, pending tasks, satisfied tasks, declined tasks, and failed tasks |
400 | Invalid request data | Error message describing validation error |
404 | Job not found or no applicants found | Error message indicating job or applicants not found |
Updates the status of specified job tasks. It supports changing the status, adding comments, and handles referral bonuses if the task is confirmed.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
JobTasks_Ids | array | Yes | An array of job task IDs to be updated | ["60d21b4667d0d8992e610c85", "60d21b4667d0d8992e610c86"] |
status | string | Yes | The new status to set for the job tasks | confirmed |
job_id | string | Yes | The ID of the job to which the tasks belong | 60d21b4667d0d8992e610c85 |
comment | string | No | Optional comment to add regarding the task update | Task successfully completed. |
Status Code | Description | Response Body |
---|---|---|
204 | Successfully updated job task statuses. No content is returned. | - |
400 | Bad request. Invalid input data or invalid status provided. | - |
404 | Job or job tasks not found. | - |
Returns job details for a specific job ID.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | No | Unique identifier for the job | 68910c4a5e1c7092a1fdc03a |
{
"_id": "68910c4a5e1c7092a1fdc03a",
"job_id": "68910c4a5e1c7092a1fdc03a",
"job_type": "job",
"payment_type": "action",
"title": "Create a Google account",
"category": ["Google"],
"description": "Create a Google account. ...",
"proof": "Google account email. ...",
"Target_Workers": ["worldwide"],
"few_times": true,
"premium": false,
"featured": false,
"duration": "3",
"positions": "3",
"job_price": 0.06,
"price": "0.30",
"status": "active",
"files": [...],
"added": "2025-08-04T19:38:50.204Z",
"user": {...},
"totla_tasks_count": 1,
"tasks_done_count": 0,
"tasks_confirmed_count": 0,
"tasks_running_count": 0,
"tasks_pending_count": 0
}
This endpoint checks if a given search term exists in the job proofs. You can specify the search option to look for exact words or substrings.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
search | string | Yes | The term to search for in job proofs | developer |
option | string | No | The search option to use. Can be "word" for exact word matching or "charactor" for substring matching | word |
Status Code | Description | Response Body |
---|---|---|
200 | Successfully checked for uniqueness | Returns a boolean indicating if the search term is unique |
400 | Bad request. Either the search term is missing, or an invalid search option is provided | Error message describing the validation error |
This endpoint allows a user to retrieve a paginated list of jobs associated with their account. The results can be filtered and sorted based on various parameters.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
page | integer | No | Page number for pagination | 1 |
limit | integer | No | Number of items per page | 10 |
job_id | string | No | Filter jobs by a specific job ID | - |
status | string | No | Filter jobs by status (e.g., 'active', 'completed') | - |
orientation | string | No | The orientation for the data sorting (e.g., 'asc' or 'desc') | asc |
Query | string | No | Search query for job title or description | - |
SortBY | string | No | Field to sort the results by | - |
Returns a paginated list of jobs matching the provided filters. Supports search, category, price, location, and other filters.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
page | string | No | Page number for pagination | 1 |
limit | string | No | Number of jobs per page | 10 |
searchTerm | string | No | Search term for job title or description | - |
job_category | string | No | Filter by job category | - |
min_price | string | No | Minimum job price | - |
location | string | No | Filter by worker location | - |
Featured | boolean | No | Filter for featured jobs | - |
Premium | boolean | No | Filter for premium jobs | - |
orientation | string | No | Sort orientation (asc, desc) | desc |
SortBY | string | No | Field to sort by | added |
This endpoint allows users to create a new job posting. It requires specific details about the job, including title, description, category, number of positions, job price, and duration.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
title | string | Yes | The title of the job posting | Software Developer |
category | string | Yes | Category of the job | Engineering |
description | string | Yes | Detailed description of the job | We are looking for a skilled software developer... |
proof | string | Yes | Proof or evidence related to the job posting | Sample proof text. |
is_proof_file | boolean | No | Indicates if the proof is a file or text | false |
auto_rate | boolean | No | Whether the job should be automatically rated | true |
vcode | string | No | Verification code for the job posting | cdcdc |
Target_Workers | array | No | List of target workers or countries | ["worldwide"] |
few_times | boolean | No | Indicates if the job can be posted a few times | false |
premium | boolean | No | Indicates if the job is premium | false |
featured | boolean | No | Whether the job is featured or not | false |
duration | integer | Yes | Duration for which the job is posted (in days) | 60 |
positions | integer | Yes | Number of available positions for the job | 3 |
daily_limit | integer | No | Daily limit for the job posting | 0 |
job_price | number | Yes | Price for posting the job | 100 |
Status Code | Description | Response Body |
---|---|---|
201 | Job created successfully | Success message indicating job creation |
400 | Bad request. Invalid or missing required fields | List of validation error messages |
Updates the status of a specific job.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | Yes | The ID of the job | 60c72b2f9b1e8c001c8e4d8a |
status | string | Yes | New status for the job (active, inactive) | active |
Status Code | Description | Response Body |
---|---|---|
204 | Job status updated successfully | - |
400 | Invalid request body or status | - |
401 | Unauthorized action | - |
404 | Job not found or invalid job_id | - |
Manage job tasks, apply for tasks, and submit task completions.
This API must be called before tasks/submit API for jobs that have job variables. This endpoint allows workers to apply to an active job. Job variables (if any) will be returned.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | Yes | Unique identifier for the job | 68868530c189957861cd698a |
{
"_id": "68910c4a5e1c7092a1fdc03c",
"var1": "Custom variable value 1",
"var2": "Custom variable value 2"
}
Returns the list of recent tasks of the user. If task_id query param is provided, it will return details of a single task.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
task_id | string | No | The ID of the job task to fetch details for | 686f668db9c27eea026e60c7 |
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
page | integer | No | Page number for pagination (starts from 1) | 1 |
limit | integer | No | Number of tasks to return per page | 10 |
{
"_id": "686f668db9c27eea026e60c7",
"job_task_id": "686f668db9c27eea026e60c7",
"worker_id": "676d3525e618d4ad99dae7ff",
"job_id": "686f44cf8abf68ace53ebc8f",
"job_title": "Create a Google account",
"job_price": 0.06,
"job_proof": "",
"comment": "",
"country_code": "IN",
"worker_ip": "192.168.249.223",
"status": "confirmed",
"failureReason": null,
"reviewed": null,
"device_owner_share": null,
"added": "2025-07-10T07:06:53.631Z",
"updated": "2025-07-10T07:06:53.631Z",
"proof_files_info": []
}
This endpoint allows workers to submit a task to an active job.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | Yes | ID of the job | 68868530c189957861cd698a |
job_proof | string | Yes | Proof of the task done | irjfoirf@gmail.com:iejowiedj:ehiuehwd@outlook.com:wuehuidhewd |
custom_vars | object | No | Custom vars obtained from tasks/apply. Required for jobs with variables | {"_id": "68910c4a5e1c7092a1fdc03c", "var1": "value1"} |
proof_files_base64 | array | No | Array of required and optional proof files in base64 format | [{"fieldName": "screenshot", "fileName": "image.jpg", "base64": "..."}] |
Status Code | Description | Response Body |
---|---|---|
201 | Job task submitted successfully | Success message indicating task submission, job task id and job id |
404 | Job not found | Error message indicating job not found |
This endpoint allows automation agents to submit task proofs. It handles task status updates, proof submission, automation iteration lifecycle management, and implements blacklisting for failed or declined tasks. Comments can be included in the job_proof JSON and will be extracted automatically.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_proof | string | Yes | Proof of task completion. Should be a JSON string containing task results and optional comments field | {"result": "completed", "comments": "Task finished successfully"} |
job_task_id | string | Yes | The ID of the job task being submitted | 60c72b2f9b1e8c001c8e4d8a |
status | string | No | Optional status to set for the task (failed, declined, running, success). If the task is currently running, it will be updated to this status or 'pending' if not specified | failed |
finish | boolean | No | Whether this submission marks the task as finished. If true and status is failed/declined/pending, the automation iteration will be deleted | true |
Status Code | Description | Response Body |
---|---|---|
201 | Task updated successfully | {"msg": "task has been updated successfully"} |
400 | Bad request - Invalid job proof | {"error": "invalid job proof"} |
404 | Task or iteration not found - The task must be an automation task with valid iteration and device IDs | {"error": "task not found"} or {"error": "iteration not found"} |
500 | Internal server error | {"error": "Internal server error"} |
This endpoint allows users to submit multiple planned tasks for a specific job. Planned tasks are pre-defined inputs that will be used when workers apply for the job.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
job_id | string | Yes | The ID of the job to submit planned tasks for | 60c72b2f9b1e8c001c8e4d8a |
inputs | array | Yes | Array of input strings for planned tasks (usually JSON strings, minimum 1, maximum 10,000 characters per string) | ["{\"fname\":\"John\",\"lname\":\"Doe\",\"email\":\"john@example.com\"}", "{\"fname\":\"Jane\",\"lname\":\"Smith\",\"email\":\"jane@example.com\"}"] |
Status Code | Description | Response Body |
---|---|---|
200 | Planned tasks submitted successfully | {"success": true} |
400 | Bad request - Invalid input data, exceeds available positions, or validation errors | {"success": false, "error": "Invalid job id"} or {"success": false, "message": "No enough positions left. Received X tasks in excess."} |
404 | Job not found or user doesn't own the job | {"success": false, "error": "Job not found"} |
500 | Internal server error | {"success": false, "message": "Internal Server Error"} |
This endpoint allows employers to delete a job task. Only tasks with certain statuses can be deleted to maintain data integrity (failed, declined).
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
task_id | string | Yes | The ID of the job task to delete | 60c72b2f9b1e8c001c8e4d8a |
Status Code | Description | Response Body |
---|---|---|
200 | Job task deleted successfully | {"success": true, "message": "Job task deleted successfully"} |
400 | Bad request - Invalid task ID or task cannot be deleted due to status restrictions | {"success": false, "error": "Invalid task id"} or {"success": false, "message": "Cannot delete job task with status 'confirmed'. Only tasks with status: pending, failed, declined, notcomplete can be deleted."} |
403 | Forbidden - User doesn't have permission to delete this job task | {"success": false, "message": "You don't have permission to delete this job task"} |
404 | Job task not found | {"success": false, "message": "Job task not found"} |
500 | Internal server error | {"success": false, "message": "Internal Server Error"} |
This endpoint allows employers to re-initiate a single failed or declined task. This makes the planned task available again for workers to apply.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
task_id | string | Yes | The ID of the job task to re-initiate | 60c72b2f9b1e8c001c8e4d8a |
Status Code | Description | Response Body |
---|---|---|
200 | Task re-initiated successfully | {"success": true, "message": "Task successfully reinitiated"} |
400 | Bad request - Invalid task ID or task cannot be reinitiated due to status restrictions | {"success": false, "error": "Invalid task id"} or {"success": false, "message": "Cannot reinitiate task with status 'confirmed'. Only failed or declined tasks can be reinitiated."} |
403 | Forbidden - User doesn't have permission to reinitiate this task | {"success": false, "message": "You don't have permission to reinitiate this task"} |
404 | Job task not found or no planned task associated with this job task | {"success": false, "message": "Job task not found"} |
500 | Internal server error | {"success": false, "message": "Internal Server Error"} |
Handle payment operations including withdrawals.
Initiate a withdrawal to a wallet address.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
amount | number | Yes | Amount to withdraw | 10 |
wallet_address | string | Yes | Wallet address to receive the withdrawal | 0x1234567890abcdef |
Status Code | Description | Response Body |
---|---|---|
200 | Withdrawal successful | {"msg": "withdraw done"} |
400 | Insufficient balance, below minimum payout, or invalid request | Error message with specific reason |
401 | Unauthorized or missing token | - |
500 | Server error | - |
Returns the list & details of recent withdrawals made by the user.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
page | integer | No | Page number for pagination (starts from 1) | 1 |
limit | integer | No | Number of withdrawals to return per page | 10 |
Status Code | Description | Response Body |
---|---|---|
200 | Details of the withdrawals made by the user | - |
401 | Unauthorized or missing token | - |
404 | No transactions found | - |
500 | Server error | - |
{
"total_count": 3,
"transactions": [
{
"_id": "67d9f0b57131be1625d301c4",
"reference_id": "26795145",
"user_id": "676d3619e618d4ad99dae899",
"recipient_id": null,
"crypto_uuid": null,
"payment_type": "Withdrawal",
"payment_method": "cryptomus",
"payment_details": "",
"transaction_fee": "0",
"currency": "USD",
"amount": "-10",
"wallet_address": "2w",
"status": "paid",
"reason": null,
"created": "2025-03-18T22:16:21.895Z",
"updated": "2025-03-18T22:16:21.895Z",
"process_date": "2025-03-18T22:16:21.895Z",
"transaction_id": "67d9f0b57131be1625d301c4",
"transaction_proof": "2ca560b36dcdd7c8",
"__v": 0
}
],
"page": 1,
"balance": 3.54,
"total_withdraw": -30,
"total_deposit": 0
}
User account management and balance information.
Returns the user's current balance and active balance.
Status Code | Description | Response Body |
---|---|---|
200 | User balance information retrieved successfully | - |
401 | Unauthorized or missing token | - |
500 | Server error | - |
{
"balance": 4.434,
"active_balance": 4.434
}
Device management and information retrieval endpoints.
Retrieves a list of devices that are either owned by the user or rented with live payment type.
Status Code | Description | Response Body |
---|---|---|
200 | Successfully retrieved devices list | - |
401 | Unauthorized or missing token | - |
500 | Server error | - |
[
{
"remote_device_id": "device_123456",
"added": "2025-08-19T10:00:00Z",
"automations": [],
"brand": "Samsung",
"country": "US",
"isEmulator": false,
"model": "Galaxy S21",
"name": "Galaxy S21 Ultra",
"networkType": "wifi",
"numberOfCores": 8,
"online": true,
"processor": "Snapdragon 888",
"ramMb": 8192,
"sdkVersion": "31",
"version": "12"
}
]
Submits a device automation request and launches automation on the specified device.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
device_id | string | Yes | The ID of the device to run automation on | device_123456 |
command | string | Yes | Command to execute (start or stop) | start |
code | string | Yes | Automation code to execute on the device | console.log('hello') |
Status Code | Description | Response Body |
---|---|---|
200 | Automation launched successfully | - |
400 | Bad request or invalid parameters | Error message describing the validation error |
401 | Unauthorized or missing token | Authentication error message |
Submits an automation stop request and stopps all the automations running on a perticular device.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
device_id | string | Yes | The ID of the device where all the automations will be stopped | device_123456 |
Status Code | Description | Response Body |
---|---|---|
200 | All automations stopped successfully | - |
400 | Bad request or invalid parameters | Error message describing the validation error |
401 | Unauthorized or missing token | Authentication error message |
Retrieves automation logs. Only returns logs from the last 10 minutes. When 'from' parameter is provided, only logs that appear after the specified log ID will be returned.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
device_id | string | Yes | The ID of the device to get logs from | device_123456 |
automation_ids | array | Yes | Array of automation IDs to get logs for | ["83ba7359-d8eb-4374-8ecb-055af01fddfe"] |
from | string | No | Log ID to get logs after this point | e0e1a3ef-7b2a-42b5-8f21-b845fa41c8b9 |
Status Code | Description | Response Body |
---|---|---|
200 | Automation logs retrieved successfully | - |
400 | Bad request or invalid parameters | Error message describing the validation error |
401 | Unauthorized or missing token | Authentication error message |
{
"logs": [
{
"id": "e0e1a3ef-7b2a-42b5-8f21-b845fa41c8b9",
"automationId": "83ba7359-d8eb-4374-8ecb-055af01fddfe",
"message": "test testValue",
"lineNumber": 1,
"messageLevel": "log",
"timestamp": 1755811585870
}
]
}
File upload and temporary file access endpoints.
Uploads a file to temporary storage. Files are automatically deleted after 15 minutes. Maximum file size is 50 MB. Use multipart/form-data with 'file' field name.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
file | file | Yes | File to upload (multipart/form-data) | Binary file data |
Status Code | Description | Response Body |
---|---|---|
200 | File uploaded successfully | { "success": true, "message": "File uploaded successfully", "data": { "filename": "1234567890_example.pdf", "originalName": "example.pdf", "size": 1024000, "url": "https://api.example.com/temp/1234567890_example.pdf", "expiresAt": "2025-10-08T12:15:00.000Z" } } |
400 | No file uploaded | { "success": false, "message": "No file uploaded" } |
401 | Unauthorized or missing token | Authentication error message |
500 | Server error during upload | { "success": false, "message": "Error uploading file", "error": "Error details" } |
{
"success": true,
"message": "File uploaded successfully",
"data": {
"filename": "1234567890_example.pdf",
"originalName": "example.pdf",
"size": 1024000,
"url": "https://api.example.com/temp/1234567890_example.pdf",
"expiresAt": "2025-10-08T12:15:00.000Z"
}
}
Retrieves a previously uploaded temporary file. Files expire after 15 minutes from upload time.
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
filename | string | Yes | Filename returned from the upload endpoint (path parameter) | 1234567890_example.pdf |
Status Code | Description | Response Body |
---|---|---|
200 | File retrieved successfully | Binary file data |
400 | Filename is required | { "success": false, "message": "Filename is required" } |
404 | File not found or expired | { "success": false, "message": "File not found or expired" } |
401 | Unauthorized or missing token | Authentication error message |
500 | Server error during retrieval | { "success": false, "message": "Error retrieving file", "error": "Error details" } |
Range of functions and APIs available to use when creating an automation
Returns to the home screen
Promise<void>
- Promise that resolves when navigation is complete
Go to home screen
await goHome();
Opens the recent apps view
Promise<void>
- Promise that resolves when recents view is opened
Show recent apps
await recents();
Simulates pressing the back button
Promise<void>
- Promise that resolves when back action is complete
Go back
await goBack();
Hides the software keyboard if it is visible
Promise<void>
- Promise that resolves when keyboard is hidden
Hide keyboard
await hideKeyboard();
Gets information about the current device
{ id: string, brand: string, model: string, sdkVersion: number, processor: string, numberOfCores: number, ramMb: number, country: string, isEmulator: boolean, width: number, height: number }
- Device information object
Get device info
const deviceInfo = getDeviceInfo();
console.log(`Device: ${deviceInfo.brand} ${deviceInfo.model}`);
Toggles airplane mode
Promise<void>
- Promise that resolves when airplane mode is turned on and then off
Toggle airplane mode
await airplane();
Saves data to a file
Promise<void>
- Promise that resolves when file is saved
Save text file
await saveFile('example.txt', 'Hello World');
Checks if a file or directory exists at the given path
boolean
- true if the path exists, false otherwise
Check if file exists
if (fileExists('/storage/emulated/0/example.txt')) {
console.log('File exists!');
}
Gets the size of a file in bytes
number
- File size in bytes, or -1 if file doesn't exist or is not a file
Get file size
const size = getFileSize('/storage/emulated/0/example.txt');
if (size >= 0) {
console.log(`File size: ${size} bytes`);
}
Reads entire file as Base64-encoded string. WARNING: Loads entire file into memory. Use streaming methods for large files.
string
- Base64-encoded file content, or empty string if file doesn't exist
Read image as base64
const base64 = readFullFileBase64('/storage/emulated/0/image.png');
if (base64) {
console.log('Image loaded as base64');
// Use with recognizeText or other functions
const textData = await recognizeText(base64);
}
Reads entire file as UTF-8 text string. WARNING: Loads entire file into memory. Use streaming methods for large files.
string
- File content as UTF-8 string, or empty string if file doesn't exist
Read text file
const content = readFullFile('/storage/emulated/0/notes.txt');
if (content) {
console.log('File content:', content);
const lines = content.split('\n');
console.log(`File has ${lines.length} lines`);
}
Lists all files and directories in a directory
FileInfo[]
- Array of FileInfo objects containing: - name: File or directory name - path: Absolute path - isDirectory: Whether this is a directory - isFile: Whether this is a file - size: File size in bytes (0 for directories) - lastModified: Last modified timestamp in milliseconds Returns empty array if directory doesn't exist or is not accessible
List files in directory
const files = listFiles('/storage/emulated/0/Download');
for (const file of files) {
console.log(file.name, file.isFile ? 'file' : 'dir', file.size);
}
// Filter to only get files
const onlyFiles = files.filter(f => f.isFile);
// Sort by last modified
files.sort((a, b) => b.lastModified - a.lastModified);
Gets detailed information about a file or directory
DirectoryInfo | FilePathInfo | PathNotFoundInfo
- Path information object: For directories (DirectoryInfo): - exists: true - path, name: Path and name - isDirectory: true, isFile: false - lastModified: Timestamp - canRead, canWrite: Permission flags - fileCount, directoryCount, totalItems: Content counts For files (FilePathInfo): - exists: true - path, name: Path and name - isDirectory: false, isFile: true - lastModified: Timestamp - canRead, canWrite: Permission flags - size: File size in bytes For non-existent paths (PathNotFoundInfo): - exists: false - error: Optional error message
Get file/directory info
const info = getPathInfo('/storage/emulated/0/Download');
if (info.exists) {
console.log('Path:', info.path);
console.log('Name:', info.name);
console.log('Can write:', info.canWrite);
if (info.isDirectory) {
console.log('Directory with', info.totalItems, 'items');
console.log('Files:', info.fileCount, 'Dirs:', info.directoryCount);
} else if (info.isFile) {
console.log('File size:', info.size, 'bytes');
}
} else {
console.log('Path does not exist');
}
Gets the root directory of main storage (typically /storage/emulated/0)
string
- Absolute path to storage root, or empty string on error
Get storage root
const root = getStorageRoot();
console.log('Storage root:', root);
// Use it to construct paths
const downloadPath = root + '/Download';
const files = listFiles(downloadPath);
Calculates MD5, SHA-1, and SHA-256 hashes of a file (up to 100MB)
FileHashes | FileHashError
- On success (FileHashes): - md5: MD5 hash in hexadecimal - sha1: SHA-1 hash in hexadecimal - sha256: SHA-256 hash in hexadecimal - size: File size in bytes On error (FileHashError): - error: Error message
Calculate file hashes
const result = getFileHashes('/storage/emulated/0/document.pdf');
if ('error' in result) {
console.log('Error:', result.error);
} else {
console.log('MD5:', result.md5);
console.log('SHA-1:', result.sha1);
console.log('SHA-256:', result.sha256);
console.log('Size:', result.size, 'bytes');
}
Converts Base64 string to Uint8Array
Uint8Array
- Byte array representation
Convert base64 to bytes
const base64 = readFullFileBase64('/storage/emulated/0/data.bin');
const bytes = base64ToBytes(base64);
console.log('Byte array length:', bytes.length);
// Access individual bytes
console.log('First byte:', bytes[0]);
Converts byte array to Blob
Blob | null
- Blob object or null on error
Convert bytes to blob
const bytes = [137, 80, 78, 71, 13, 10, 26, 10]; // PNG header
const blob = bytesToBlob(bytes, 'image/png');
if (blob) {
console.log('Blob created, size:', blob.size);
console.log('Type:', blob.type);
}
Reads file as Base64 and converts to Blob
Blob | null
- Blob object or null on error
Read file as blob
const blob = readFileAsBlob('/storage/emulated/0/image.png', 'image/png');
if (blob) {
console.log('Image blob created, size:', blob.size);
// Can be used with APIs that accept Blob objects
}
Launches an Android intent
Launch activity intent
await launchIntent(
'android.intent.action.VIEW',
'com.example.app',
null,
null,
null,
0,
'activity'
false
);
Opens a URL in the default browser
Open URL
await browse('https://example.com');
Clicks at a random point within a specified rectangle
Random click in area
randomClick(100, 100, 300, 400);
Performs a random swipe within a specified rectangle
Random swipe up
randomSwipe(100, 100, 300, 400, 'up');
Displays HTML content in a specified area of the screen
Display HTML
displayHTMLCode(
'<div>Hello World</div>',
100, 100, 300, 200,
0.8
);
Hides any displayed HTML content
Hide HTML
hideHTMLCode();
Performs a tap action at the specified coordinates
Promise<void>
- Promise that resolves when tap is complete
Simple tap
await tap(100, 200);
Tap center of screen
const device = getDeviceInfo();
await tap(device.width / 2, device.height / 2);
Performs a swipe gesture from one point to another
Promise<void>
- Promise that resolves when swipe is complete
Swipe up
// Swipe up from bottom to top
await swipe(500, 1500, 500, 500, 300);
Performs a long press at specified coordinates
Long press
await hold(100, 200, 1000); // Hold for 1 second
Performs multiple taps in sequence at specified coordinates
Multi-tap sequence
// Tap three times at different positions
await multiTap([
[100, 200],
[150, 250],
[200, 300]
], 100, 200);
Performs a complex swipe gesture following multiple points
Complex pattern
// Draw a triangle
await swipePoly(100, 100, [
[200, 100],
[150, 200],
[100, 100]
], 1000, true);
Types the specified text
Promise<void>
- Promise that resolves when text is written
Type text
// Find input field first
const inputField = findNode(await screenContent(), f => f.isEditText());
if (inputField) {
await nodeAction(inputField, ACTION_FOCUS);
await writeText("Hello World!");
}
Gets content currently in the clipboard including text, raw data, and files
Promise<{ text: string, data: any, files?: { uri: string, mimeType: string, name: string, dataBase64?: string }[] }>
- The clipboard content including text, raw data dump, and any files with their metadata and base64 encoded data
Read clipboard text
const { text } = await reverseCopy();
console.log("Clipboard content:", text);
Read clipboard files
const { text, data, files } = await reverseCopy();
if ((files?.length || 0) > 0) {
console.log("Clipboard contains files:", files.map(f => f.name));
}
Pastes text from clipboard
Promise<void>
- Promise that resolves when paste is complete
Paste text
await copyText("Hello");
await paste();
Copies text to clipboard
Promise<void>
- Promise that resolves when text is copied
Copy and paste
await copyText("Text to copy");
await paste();
Performs text recognition on a base64 encoded image using OCR. Returns hierarchical text data with blocks, lines, elements, and individual symbols
Promise<TextJSON>
- Hierarchical text recognition data with the following structure: - text: Complete recognized text - textBlocks: Array of text blocks, each containing: - text: Block text - recognizedLanguage: Detected language - boundingBox: {left, top, right, bottom} - lines: Array of text lines, each containing: - text: Line text - angle: Text angle - confidence: Recognition confidence - recognizedLanguage: Language - boundingBox: Line coordinates - elements: Array of text elements (words), each containing: - text: Element text - angle: Element angle - confidence: Recognition confidence - recognizedLanguage: Language - boundingBox: Element coordinates - symbols: Array of individual characters with: - text: Character - angle: Character angle - confidence: Recognition confidence - recognizedLanguage: Language - boundingBox: Character coordinates
Recognize text with full hierarchy
// Take a screenshot and recognize text
const { screenshot } = await screenshot(1080, 1920, 80);
if (screenshot) {
const textData = await recognizeText(screenshot);
console.log("Complete text:", textData.text);
// Access hierarchical text data
for (const block of textData.textBlocks) {
console.log("Block:", block.text);
// Iterate through lines in the block
for (const line of block.lines) {
console.log(" Line:", line.text, "Confidence:", line.confidence);
// Iterate through elements (words) in the line
for (const element of line.elements) {
console.log(" Word:", element.text, "Confidence:", element.confidence);
// Iterate through symbols (characters) in the element
for (const symbol of element.symbols) {
console.log(" Char:", symbol.text, "Confidence:", symbol.confidence);
}
}
}
}
}
Find text at specific coordinates
const { screenshot } = await screenshot(1080, 1920, 80);
if (screenshot) {
const textData = await recognizeText(screenshot);
// Find text at specific coordinates
const x = 500, y = 300;
for (const block of textData.textBlocks) {
for (const line of block.lines) {
if (line.boundingBox &&
x >= line.boundingBox.left && x <= line.boundingBox.right &&
y >= line.boundingBox.top && y <= line.boundingBox.bottom) {
console.log("Text at position:", line.text);
}
}
}
}
Gets current screen UI hierarchy
Promise<Node>
- Screen content tree
Analyze screen
const screen = await screenContent();
Gets UI hierarchy for all visible screens
Promise<{ allScreensContent: Node[] }>
- Array of screen content trees
Get all screens
const { allScreensContent } = await allScreensContent();
Performs an action on a specific UI node
Promise<{ actionPerformed: boolean }>
- Whether the action was successful
Click a node
const node = findNodesByText(await screenContent(), "Submit")[0];
if (node) {
await nodeAction(node, ACTION_CLICK);
}
Takes a screenshot with optional cropping
Take screenshot
const { screenshot, originalWidth, originalHeight } =
await screenshot(1080, 1920, 80);
Gets information about the current automation script
{ name: string, description: string, id: string, revisionId: string, revision: string, timestamp: string }
- Current automation script information
Get automation info
const info = getAutomationInfo();
console.log(`Running automation: ${info.name}`);
Stops the currently running automation script
Stop automation
stopCurrentAutomation();
Launches an application
Launch app
// Launch fresh instance
await launchApp("com.example.app", true);
Lists installed applications
Promise<{appList: {[packageName: string]: string}}>
- Map of package names to app names
List apps
const { appList } = await listApps();
const packages = Object.keys(appList);
console.log("Installed apps:", packages.length);
Shows a notification on the device
Promise<void>
- Promise that resolves when notification is shown
Show notification
await showNotification(
"Task Complete",
"Your automation has finished running"
);