Enterprise Open API
Overview
Enterprise Open APIs let third-party languages call the control center over HTTP (Python, C++, Easy Language, etc.), even without EC JavaScript.
- Method: HTTP (mostly
POST,Content-Type: application/json) - URL prefix: control center base, e.g.
http://127.0.0.1:8019, plus the endpoint path - Response:
code0= success; otherwise failure, seemsg - Docs are split by module (from Apifox export + USB HID chapter). Use the table below.
Request examples
Replace BASE with your control-center URL. The samples list devices, then run USB HID: start session → set screen size → click.
Get deviceId from the device list response.
import requests
BASE = "http://127.0.0.1:8019"
def openapi_post(path, body=None): r = requests.post(f"{BASE}{path}", json=body or {}, timeout=30) r.raise_for_status() data = r.json() if data.get("code") != 0: raise RuntimeError(data.get("msg") or data) return data
# 1) Device listprint(openapi_post("/openapi/deviceList", {"deviceId": "", "groupId": ""}))
# 2) USB HID: session → screen size → clickDEVICE_ID = "90e2f3834c0977205e441aa664916a9bdde81e8d"openapi_post("/openapi/usbhidSessionStart", {"deviceId": DEVICE_ID, "gate": True})openapi_post("/openapi/usbhidSetScreenSize", {"deviceId": DEVICE_ID, "w": 1170, "h": 2532})openapi_post("/openapi/usbhidClickPoint", {"deviceId": DEVICE_ID, "x": 200, "y": 400})Dependency: pip install requests
const BASE = "http://127.0.0.1:8019";
async function openapiPost(path, body = {}) { const res = await fetch(`${BASE}${path}`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(body), }); const data = await res.json(); if (data.code !== 0) { throw new Error(data.msg || JSON.stringify(data)); } return data;}
async function main() { // 1) Device list console.log(await openapiPost("/openapi/deviceList", { deviceId: "", groupId: "" }));
// 2) USB HID: session → screen size → click const DEVICE_ID = "90e2f3834c0977205e441aa664916a9bdde81e8d"; await openapiPost("/openapi/usbhidSessionStart", { deviceId: DEVICE_ID, gate: true }); await openapiPost("/openapi/usbhidSetScreenSize", { deviceId: DEVICE_ID, w: 1170, h: 2532 }); await openapiPost("/openapi/usbhidClickPoint", { deviceId: DEVICE_ID, x: 200, y: 400 });}
main().catch(console.error);Node.js 18+ includes fetch; older versions can use node-fetch or axios.
BASE="http://127.0.0.1:8019"DEVICE_ID="90e2f3834c0977205e441aa664916a9bdde81e8d"
# 1) Device listcurl -s -X POST "$BASE/openapi/deviceList" \ -H "Content-Type: application/json" \ -d '{"deviceId":"","groupId":""}'
# 2) USB HID: session → screen size → clickcurl -s -X POST "$BASE/openapi/usbhidSessionStart" \ -H "Content-Type: application/json" \ -d "{\"deviceId\":\"$DEVICE_ID\",\"gate\":true}"
curl -s -X POST "$BASE/openapi/usbhidSetScreenSize" \ -H "Content-Type: application/json" \ -d "{\"deviceId\":\"$DEVICE_ID\",\"w\":1170,\"h\":2532}"
curl -s -X POST "$BASE/openapi/usbhidClickPoint" \ -H "Content-Type: application/json" \ -d "{\"deviceId\":\"$DEVICE_ID\",\"x\":200,\"y\":400}"using System.Net.Http;using System.Text;using System.Text.Json;
var baseUrl = "http://127.0.0.1:8019";var deviceId = "90e2f3834c0977205e441aa664916a9bdde81e8d";using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
async Task<JsonElement> OpenApiPost(string path, object body){ var json = JsonSerializer.Serialize(body); using var content = new StringContent(json, Encoding.UTF8, "application/json"); using var res = await http.PostAsync(baseUrl + path, content); res.EnsureSuccessStatusCode(); await using var stream = await res.Content.ReadAsStreamAsync(); using var doc = await JsonDocument.ParseAsync(stream); var root = doc.RootElement.Clone(); if (root.GetProperty("code").GetInt32() != 0) throw new Exception(root.TryGetProperty("msg", out var msg) ? msg.GetString() : root.ToString()); return root;}
// 1) Device listConsole.WriteLine(await OpenApiPost("/openapi/deviceList", new { deviceId = "", groupId = "" }));
// 2) USB HIDawait OpenApiPost("/openapi/usbhidSessionStart", new { deviceId, gate = true });await OpenApiPost("/openapi/usbhidSetScreenSize", new { deviceId, w = 1170, h = 2532 });await OpenApiPost("/openapi/usbhidClickPoint", new { deviceId, x = 200, y = 400 });Other endpoints follow the same POST + JSON body pattern — swap the path and body using each module page.
Modules
| Module | Description |
|---|---|
| Automation · Screenshot | Capture / stream |
| Automation · Actions | Tap, swipe, input, apps |
| Automation · Env | Start/stop automation, tunnel |
| Automation · Album | Upload / clear album |
| Automation · Files | Push / pull device files |
| Automation · IME | Custom keyboard / clipboard |
| Automation · BLE | Bluetooth HID board |
| Automation · USB HID | No extra board, USB cable control |
| Center APIs | Device list, scripts |
| App helper | Clipboard, album, port forward |
| Shortcuts helper | Requires Shortcuts helper app; see page for paths |
Notes
- USB HID: no BLE/OTG board; see the USB HID chapter for endpoints
- Screen presets: new UI guide
Legacy Apifox (backup)
Online link (incomplete USB HID — prefer on-site docs):
- https://www.apifox.cn/apidoc/shared-de0cb92e-6f29-49c1-8386-7982b3b1e051
- Password:
ZwzKf51B