Panda API Interface Documentation Recent
1. API Request Address
ws://127.0.0.1:22222/2. API Request Structure
Both request and response are JSON data structures. Request parameters are string type unless otherwise specified.
Request example:
json
{
"action": "pushEvent",
"devices": "all",
"data": {
"type": "2"
}
}Response example:
json
{
"code": 10000,
"message": "SUCCESS",
"data": null
}3. API Public Parameters
3.1 Request Parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
action | string | YES | "pushEvent" | Request event type, case insensitive |
devices | string | YES | "all" or "xxx,xxx" | Device serial number. all = all devices. Multiple separated by commas. Can use [IP:port] if no serial number. |
data | json | NO | Request parameters (optional) |
3.2 Return Parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
code | int | 10000 | Return code, default 10000 |
message | string | "SUCCESS" | Response message |
data | json | null | JSON when data exists, null otherwise |
4. API Response Codes
| Code | Description |
|---|---|
10000 | Request successful |
10001 | Request failed |
How to Test the API
Search for "websocket online testing tool" in your browser and go to websocketking.com.
- Keep Panda software running
- Enter the server address and click Connect
- Enter the API statement and click Send to execute
API Not Working?
Cause Analysis:
- The
devicesfield was not entered correctly - The client has enabled safe mode or accessibility mode
- USB connection: Enter the device serial number in the devices field
- WiFi/OTG mode: Enter the IP address and port number
- Safe mode/Accessibility mode disable USB debugging, preventing API commands
5. API List
| # | API | ACTION | Description |
|---|---|---|---|
| 1 | Get device list | list | Get currently connected devices |
| 2 | Simulated click | pushEvent | type=2, coordinates required |
| 3 | Simulated swipe | pushEvent | type=3, start/end coordinates |
| 4 | Keyboard input | pushEvent | type=4 |
| 5 | Install APK | installApk | Install APK to devices |
| 6 | ADB command | adb | Execute ADB commands |
| 7 | Screenshot | screenShot | Capture device screen |
| 8 | Distribute text | distributeText | Send text to devices |
| 9 | Record actions | recordAction | Record automated tasks |
TIP
For the complete API with all parameters and examples, refer to the original documentation. The Panda API uses WebSocket on port 22222 while the XP API uses port 9911.