CAPTCHA / YANDEX_ICONS
Yandex / Icons
Yandex SmartCaptcha with icons: icons on a busy background on the image, the same icons on the strip in the required order. The response is the click points. Available through the direct API.
Input
Prepare canvas.png, the 500×330 image, and order.png, the 300×60 strip with icons on a transparent background. Send the files of one task unchanged and keep the alpha channel of the strip.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | string | Yes | — | Source image in base64. |
| order | string | Yes | — | The icon strip in base64. |
Response
| Recognition data | Type | Description |
|---|---|---|
| confidence | number | The lowest p score among the points. |
| extra.points[].index | integer | Click number, starting at 1. The order matches the icons on the strip. |
| extra.points[].x / y | number | Click point in pixels of the original image. |
| extra.points[].name | string | Icon name. |
| extra.points[].p | number | Score of the found icon, from 0 to 1. |
| extra.points[].match | number | Similarity of the strip icon to the known icon of this name. |
| extra.size | integer[2] | Width and height of the original image. |
| extra.points[].own_class | boolean | false: no icon of this name was found on the image and another one was taken. Do not use such an answer; request a new task. |
Applying the answer
Click the extra.points in order. If the original image is W×H and it is shown on the page as w×h, the coordinate relative to the image on the page is x × w / W, y × h / H.
Common mistakes
- The image and the strip must belong to the same task.
- A strip without an alpha channel must have dark icons on a light background.
- Do not crop or scale the files before sending.
Request example
import base64
from pathlib import Path
import os
import uuid
import requests
def image64(filename):
return base64.b64encode(Path(filename).read_bytes()).decode("ascii")
payload = {
"image": image64("canvas.png"),
"order": image64("order.png"),
}
# One ID per task; keep it for network retries.
request_id = str(uuid.uuid4())
response = requests.post(
"https://capi.z3n.pro/v1/solve/yandex_icons",
headers={
"Authorization": f"Bearer {os.environ['CAPI_API_KEY']}",
"Content-Type": "application/json",
"Idempotency-Key": request_id,
},
json=payload,
timeout=90,
)
response.raise_for_status()
result = response.json()
for point in result["extra"]["points"]:
print(point["index"], point["x"], point["y"])
capi.