Skip to content

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

ParameterTypeRequiredExampleDescription
actionstringYES"pushEvent"Request event type, case insensitive
devicesstringYES"all" or "xxx,xxx"Device serial number. all = all devices. Multiple separated by commas. Can use [IP:port] if no serial number.
datajsonNORequest parameters (optional)

3.2 Return Parameters

ParameterTypeExampleDescription
codeint10000Return code, default 10000
messagestring"SUCCESS"Response message
datajsonnullJSON when data exists, null otherwise

4. API Response Codes

CodeDescription
10000Request successful
10001Request failed

How to Test the API

Search for "websocket online testing tool" in your browser and go to websocketking.com.

  1. Keep Panda software running
  2. Enter the server address and click Connect
  3. Enter the API statement and click Send to execute

API Not Working?

Cause Analysis:

  1. The devices field was not entered correctly
  2. 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

#APIACTIONDescription
1Get device listlistGet currently connected devices
2Simulated clickpushEventtype=2, coordinates required
3Simulated swipepushEventtype=3, start/end coordinates
4Keyboard inputpushEventtype=4
5Install APKinstallApkInstall APK to devices
6ADB commandadbExecute ADB commands
7ScreenshotscreenShotCapture device screen
8Distribute textdistributeTextSend text to devices
9Record actionsrecordActionRecord 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.

Some3C Phone Farm Documentation