CAPTCHA / HUNT
Hunt
Send an image, get the click points (happy_puzzle) or the positions of the ball and the target (swipe_goal). The task kind is the type field.
Input
Save the whole source image as captcha.png. The response coordinates refer to this file.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| image | string | Yes | — | Source image in base64. |
| type | string | Yes | — | Task kind: happy_puzzle, swipe_goal. The old names shapes and football are accepted too. |
| confidence | number | No | 0.25 | swipe_goal: minimum confidence for detections, from 0 to 1. Does not affect extra.points. |
Task kinds
| type | Task | Response |
|---|---|---|
| happy_puzzle | Click the icons in the given order. | extra.points — the click points. |
| swipe_goal | Move the slider until the ball reaches the target. | detections — positions of the ball (ball) and the target (circle). |
Response
| Recognition data | Type | Description |
|---|---|---|
| type | string | Task kind. |
| extra.points | integer[][3] | happy_puzzle: points [number, x, y] in click order; x and y are pixels of the source image. An empty array means the points could not be built. |
| detections[].name | string | swipe_goal: ball is the ball, circle is the target. |
| detections[].center_x / center_y | number | swipe_goal: object center in pixels of the source image. |
| detections[].x1 / y1 / x2 / y2 | integer | swipe_goal: object bounds in pixels of the source image. |
Applying the answer
happy_puzzle: click the extra.points in order. swipe_goal: move the slider and send a new snapshot after each step; when the center of ball is inside the bounds of circle, release the slider. If the source image is W×H and it is shown as w×h on the page, the coordinate relative to the image on the page is x × w / W, y × h / H.
Common mistakes
- Do not pass source-file coordinates straight into a click on a scaled picture.
- A task with empty extra.points is paid like any other. Request a new image.
- swipe_goal: each snapshot is a separate paid task.
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("captcha.png"),
"type": "happy_puzzle",
}
# One ID per task; keep it for network retries.
request_id = str(uuid.uuid4())
response = requests.post(
"https://capi.z3n.pro/v1/solve/hunt",
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 order, x, y in result["extra"]["points"]:
print(order, x, y)
capi.