Argus API
Screenshots: detect
Detect UI elements and read text in a screenshot.
POST
/
api
/
v1
/
screenshots:detect
Detect Screenshot
curl --request POST \
--url https://argus.axilio.ai/api/v1/screenshots:detect \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"image": "<string>",
"confidence_threshold": 0.25,
"inference_type": "combined",
"nms_iou_threshold": 0.45,
"ocr_engine": "free"
}
'import requests
url = "https://argus.axilio.ai/api/v1/screenshots:detect"
payload = {
"image": "<string>",
"confidence_threshold": 0.25,
"inference_type": "combined",
"nms_iou_threshold": 0.45,
"ocr_engine": "free"
}
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: '<string>',
confidence_threshold: 0.25,
inference_type: 'combined',
nms_iou_threshold: 0.45,
ocr_engine: 'free'
})
};
fetch('https://argus.axilio.ai/api/v1/screenshots:detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://argus.axilio.ai/api/v1/screenshots:detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => '<string>',
'confidence_threshold' => 0.25,
'inference_type' => 'combined',
'nms_iou_threshold' => 0.45,
'ocr_engine' => 'free'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Axilio-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://argus.axilio.ai/api/v1/screenshots:detect"
payload := strings.NewReader("{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://argus.axilio.ai/api/v1/screenshots:detect")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://argus.axilio.ai/api/v1/screenshots:detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"metadata": {
"icon_detections_after_nms": 123,
"icon_detections_before_nms": 123,
"image_height": 123,
"image_width": 123,
"inference_time_ms": 123,
"detect_ns": 123,
"ocr_ns": 123,
"queue_wait_ns": 123
},
"hash_result": {
"ahash": "<string>",
"dhash": "<string>",
"phash": "<string>",
"content_bounds": {
"bottom_y": 123,
"top_y": 123
},
"histogram": [
[
123
]
]
},
"icon_detections": [
{
"bbox": {
"x1": 123,
"x2": 123,
"y1": 123,
"y2": 123
},
"class_id": 123,
"class_name": "<string>",
"confidence": 0.5
}
],
"ocr_results": [
{
"bbox": {
"x1": 123,
"x2": 123,
"y1": 123,
"y2": 123
},
"confidence": 0.5,
"text": "<string>"
}
]
},
"analyzer_type": "all",
"type": "analyzer_result"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}Detect icons and UI elements and read the text in a screenshot you supply.
Send the image as base64 PNG or JPEG.
inference_type chooses icons
(detect), text (ocr), or both (combined), and ocr_engine chooses the
free or premium text engine.
Detection is billed per page through the Axilio model line. See
Models for the tiers and prices.
To find one described element instead of every element, use
Screenshots: locate. You can pass
the text this operation returns as that request’s texts.
Errors use the problem details shape.Authorizations
Axilio API key (axl_*).
Body
application/json
Base64 encoded image data
Maximum string length:
16777216Minimum confidence threshold for detections and OCR results
Required range:
0 <= x <= 1Type of inference to perform
Available options:
detect, ocr, combined IoU threshold for Non-Maximum Suppression (NMS)
Required range:
0 <= x <= 1OCR engine to use: 'free' or 'premium'
⌘I
Detect Screenshot
curl --request POST \
--url https://argus.axilio.ai/api/v1/screenshots:detect \
--header 'Content-Type: application/json' \
--header 'X-Axilio-Api-Key: <api-key>' \
--data '
{
"image": "<string>",
"confidence_threshold": 0.25,
"inference_type": "combined",
"nms_iou_threshold": 0.45,
"ocr_engine": "free"
}
'import requests
url = "https://argus.axilio.ai/api/v1/screenshots:detect"
payload = {
"image": "<string>",
"confidence_threshold": 0.25,
"inference_type": "combined",
"nms_iou_threshold": 0.45,
"ocr_engine": "free"
}
headers = {
"X-Axilio-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Axilio-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
image: '<string>',
confidence_threshold: 0.25,
inference_type: 'combined',
nms_iou_threshold: 0.45,
ocr_engine: 'free'
})
};
fetch('https://argus.axilio.ai/api/v1/screenshots:detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://argus.axilio.ai/api/v1/screenshots:detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'image' => '<string>',
'confidence_threshold' => 0.25,
'inference_type' => 'combined',
'nms_iou_threshold' => 0.45,
'ocr_engine' => 'free'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Axilio-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://argus.axilio.ai/api/v1/screenshots:detect"
payload := strings.NewReader("{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Axilio-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://argus.axilio.ai/api/v1/screenshots:detect")
.header("X-Axilio-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://argus.axilio.ai/api/v1/screenshots:detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Axilio-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"image\": \"<string>\",\n \"confidence_threshold\": 0.25,\n \"inference_type\": \"combined\",\n \"nms_iou_threshold\": 0.45,\n \"ocr_engine\": \"free\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"metadata": {
"icon_detections_after_nms": 123,
"icon_detections_before_nms": 123,
"image_height": 123,
"image_width": 123,
"inference_time_ms": 123,
"detect_ns": 123,
"ocr_ns": 123,
"queue_wait_ns": 123
},
"hash_result": {
"ahash": "<string>",
"dhash": "<string>",
"phash": "<string>",
"content_bounds": {
"bottom_y": 123,
"top_y": 123
},
"histogram": [
[
123
]
]
},
"icon_detections": [
{
"bbox": {
"x1": 123,
"x2": 123,
"y1": 123,
"y2": 123
},
"class_id": 123,
"class_name": "<string>",
"confidence": 0.5
}
],
"ocr_results": [
{
"bbox": {
"x1": 123,
"x2": 123,
"y1": 123,
"y2": 123
},
"confidence": 0.5,
"text": "<string>"
}
]
},
"analyzer_type": "all",
"type": "analyzer_result"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"errors": [
{}
],
"type": "about:blank"
}