Screen Image Push
Push specified screen area image directly to custom API service for processing, suitable for various image recognition scenarios.
Application Scenarios
This interface is particularly suitable for the following scenarios:
- 🔤 OCR Text Recognition - Integrate third-party OCR services (such as PaddleOCR, Tesseract, etc.)
- 🎯 Captcha Recognition - Use specialized captcha recognition services
- 🖼️ Image Classification - Identify image content, object detection
- 🤖 AI Recognition - Integrate any custom image AI model
💡 How It Works
Streaming End → Capture Image → Direct POST → Your API → Return Result
Images are sent directly from the streaming end to your API, saving decoding and redundant transmission steps, improving efficiency.
Difference from getScreenShot
Comparison
| Feature | screenPush | getScreenShot |
|---|---|---|
| Data Flow | Streaming end → Your API | Streaming end → iClick main process → Caller |
| Transmissions | 1 (direct push) | 2 (first to main process, then to API) |
| Resource Usage | Low (not through main process) | High (requires decoding and passing in main process) |
Interface Description
Interface Type
screenPushParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api | string | Yes | Your API service address |
| args | object | No | Custom parameter object, will be passed as-is to API server |
| quality | number | No | Image quality (0-1), default 0.8 |
| scale | number | No | Scale ratio (0-1), default 1.0 |
Request Format
iClick will send POST request to your API. To save unnecessary resources, after the streaming end successfully pushes, it will not wait for the result and return it to the caller. screenPush will always return true, and you need to implement your own business callback logic.
Request Headers:
Content-Type: multipart/form-dataRequest Body:
image: <Image binary data (screenshot)>If args parameter is provided, all fields will be passed as additional form fields:
image: <Image binary data>
rect: [100, 100, 500, 200] // If args.rect exists
customField: "value" // Your custom field
...Basic Usage
// Captcha recognition example
await apiInvoke('screenPush', {
api: 'http://localhost:5000/resolve_captcha',
args: {
rect: [100, 300, 275, 360],
type: 'digits',
...
}
});