API Documentation
Integrate with NodeCoreX using local device APIs (port 5200) and remote server APIs. Remote requests require a SHA-256 signature built from your account, password, machine code, and timestamp.
Local device API
Base URL: http://localhost:5200
http://localhost:5200/nodes/count Get node count
Get the total number of ad nodes running on the current node.
{
"success": true,
"count": 4
} {
"success": false,
"message": "Service unavailable"
} http://localhost:5200/nodes/list Get node index list
Get the list of all node indexes for subsequent operations by index.
{
"success": true,
"nodeIndexes": [
0,
1,
2,
3
]
} {
"success": false,
"message": "Failed to list nodes"
} http://localhost:5200/nodes/status Get node status
Get the run status of each node (running, stopped, error, etc.).
{
"success": true,
"statuses": [
{
"index": 0,
"status": "running",
"uptime": 3600
},
{
"index": 1,
"status": "stopped",
"uptime": 0
},
{
"index": 2,
"status": "error",
"message": "Proxy timeout"
}
]
} {
"success": false,
"message": "Unable to read node status"
} http://localhost:5200/nodes/{nodeIndex}/start Start a node
Start the ad playback node for the given node index.
-
nodeIndex(path) — Node index (0-based)
{
"success": true,
"message": "Node started",
"index": 0
} {
"success": false,
"message": "Invalid node index or already running"
} http://localhost:5200/nodes/{nodeIndex}/stop Stop a node
Stop the ad playback node for the given node index.
-
nodeIndex(path) — Node index (0-based)
{
"success": true,
"message": "Node stopped",
"index": 0
} {
"success": false,
"message": "Invalid node index or already stopped"
} http://localhost:5200/nodes/{nodeIndex}/proxy Set proxy for a node
Configure the proxy connection (host, port, auth, etc.) for the given node index.
-
nodeIndex(path) — Node index -
ip(body) — Proxy endpoint -
port(body) — Proxy port -
username(body) — Proxy username (optional) -
password(body) — Proxy password (optional)
{
"ip": "127.0.0.1",
"port": 7890,
"username": null,
"password": null
} {
"success": true,
"message": "Proxy updated",
"index": 0
} {
"success": false,
"message": "Invalid proxy or connection failed"
} http://localhost:5200/device/info Get node info
Get basic node info such as node code, model, and version.
{
"success": true,
"machineCode": "PM-XXXX-YYYY",
"model": "Standard",
"version": "1.0.0",
"firmware": "1.2.3"
} {
"success": false,
"message": "Node info unavailable"
} http://localhost:5200/device/health Node health check
Check if the local service is running; can be used for heartbeat reporting.
{
"success": true,
"healthy": true,
"uptime": 3600,
"nodesActive": 4
} {
"success": false,
"healthy": false,
"message": "Service unhealthy"
} Remote server API
Base URL: your platform API host (see app console for environment-specific endpoints).
/api/device/ads Get ad task list
Get ad source sites, ad types, ad IDs, playback URLs, and related content.
-
sign(query) required — Signature; see Sign Algorithm below -
machineCode(query) required — Hardware node code -
timestamp(query) required — Request timestamp (seconds)
{
"success": true,
"data": {
"ads": [
{
"id": "ad-001",
"adType": "Video",
"source": "example.com",
"sourceUrl": "https://example.com/campaign/1",
"playUrl": "https://cdn.example.com/ad-001",
"duration": 30,
"rewardPerView": 0.001
}
]
}
} {
"success": false,
"message": "Invalid sign or expired timestamp",
"code": "AUTH_FAILED"
} /api/device/earnings Get earnings by node
Get earnings details or summary by node code and optional node index.
-
sign(query) required — Signature -
machineCode(query) required — Node code -
timestamp(query) required — Timestamp -
nodeIndex(query) — Node index; omit for node-wide earnings -
startDate(query) — Start date YYYY-MM-DD -
endDate(query) — End date YYYY-MM-DD
{
"success": true,
"data": {
"totalPoints": 1200,
"currency": "points",
"details": [
{
"date": "2025-03-01",
"nodeIndex": 0,
"points": 300,
"adCount": 120
},
{
"date": "2025-03-01",
"nodeIndex": 1,
"points": 280,
"adCount": 115
}
]
}
} {
"success": false,
"message": "Node not found or access denied",
"code": "FORBIDDEN"
} /api/device/heartbeat Node heartbeat
Report node online status and node run status periodically.
-
sign(query) required — Signature -
machineCode(query) required — Node code -
timestamp(query) required — Timestamp
{
"nodeStatuses": [
{
"index": 0,
"status": "running",
"uptime": 3600
},
{
"index": 1,
"status": "running",
"uptime": 3600
},
{
"index": 2,
"status": "stopped",
"uptime": 0
}
],
"deviceHealthy": true
} {
"success": true,
"message": "Heartbeat received",
"nextReportIn": 60
} {
"success": false,
"message": "Invalid sign or machineCode",
"code": "AUTH_FAILED"
} /api/device/config Get node config
Get run config for the node (e.g. task interval, region limits).
-
sign(query) required — Signature -
machineCode(query) required — Node code -
timestamp(query) required — Timestamp
{
"success": true,
"data": {
"taskInterval": 30,
"allowedRegions": [
"US",
"GB",
"DE"
],
"maxConcurrentAds": 4,
"reportInterval": 60
}
} {
"success": false,
"message": "Invalid sign or node",
"code": "AUTH_FAILED"
} Sign algorithm
Remote API requests require query parameters sign, machineCode, and timestamp.
sign = SHA256(account + password + machineCode + timestamp)