Skip to content

Rotate CAPTCHA

Get the angle that puts the image in position. Save the image in its original orientation and identify the widget's allowed rotation increment. The returned angle must be applied using that widget's convention.

POST /createTask · example
{
  "clientKey": "capzy_YOUR_API_KEY",
  "task": {
    "type": "RotateTask",
    "body": "/9j/4AAQSkZJRgABAQ...",
    "angle": 10
  }
}

Illustrative values. Replace the inputs with values from your current integration.

Base64 image + rotation stepDirect task integrationRotation angle

Send the image at its original orientation.

Save the image in its original orientation and identify the widget's allowed rotation increment. The returned angle must be applied using that widget's convention.

Your API key authenticates Capzy.
Provider keys, challenge IDs, images, and session values belong inside task.

Preserve the starting orientation.

  1. Save the current rotation challenge's original image response before applying any widget rotation.
  2. Base64-encode those bytes into body and keep the original challenge/session identifier.
  3. Avoid saving a rendered screenshot after the user has rotated it; that changes the reference orientation.
Input collection example - replace illustrative values
import base64
from pathlib import Path

def image_bytes(filename):
    return base64.b64encode(Path(filename).read_bytes()).decode("ascii")

task_inputs = {"body": image_bytes("rotation.png")}

body is the base64 image string. The task does not consume a local filename.

How Rotate CAPTCHA works

Rotation captchas show a circular image that's been randomly rotated. The user must rotate it back to the correct orientation. Used by Baidu, TikTok (Douyin), and various Chinese platforms.

Capzy's proprietary classifier returns the rotation angle (in degrees) that orients the image upright. Designed for authorized image-analysis workflows.

  • Capzy proprietary angle prediction
  • Works with any image content
  • < 2 second solve time
  • Configurable angle step

Know what goes in.

Choose a field to see its purpose, where to get it, and its place in the request. Optional values omitted from the example can be added when your flow uses them.

The request below follows your selected task configuration.

Request authentication

Required task inputs

Optional context

body

stringRequired

Base64-encoded image

Where it comes from

Save the original CAPTCHA image bytes from the current challenge and base64-encode them. Send the encoded bytes, not a local path.

Open the input guide
Example value/9j/4AAQSkZJRgABAQ...
POST /createTask · selected configuration
{
  "clientKey": "capzy_YOUR_API_KEY",
  "task": {
    "type": "RotateTask",
    "body": "/9j/4AAQSkZJRgABAQ...",
    "angle": 10
  }
}

The selected field is highlighted when present. Preserve the declared value type and current challenge context.

Make your first request.

Create the task, keep its taskId, and poll until status is ready. Then read the selected variant's solution.

More examples
  1. Create the task

    Send clientKey and the selected task to /createTask from your server. Keep the returned taskId.

  2. Wait for the solution

    Send that same key and ID to /getTaskResult. While processing, wait two seconds before checking again. Stop on Ready or an error.

  3. Apply the result

    Use solution.angle as the orientation correction for the original image, matching the widget's direction and units before submitting the current challenge.

solve_rotate.py
import json, os, time
import requests

API = "https://api.capzy.ai"
KEY = os.environ["CAPZY_API_KEY"]
task = json.loads("{\"type\":\"RotateTask\",\"body\":\"/9j/4AAQSkZJRgABAQ...\",\"angle\":10}")

def call(path, payload):
    response = requests.post(f"{API}/{path}", json={"clientKey": KEY, **payload}, timeout=30)
    response.raise_for_status()
    data = response.json()
    if data.get("errorId", 0) or data.get("status") == "failed":
        raise RuntimeError(data.get("errorDescription") or data.get("errorCode") or "Task failed")
    return data

created = call("createTask", {"task": task})
for attempt in range(60):
    result = call("getTaskResult", {"taskId": created["taskId"]})
    if result.get("status") == "ready":
        solution = result["solution"]
        print(solution)
        break
    time.sleep(2)
else:
    raise TimeoutError("Task is still processing; keep the taskId to check it later.")

Before runningReplace all illustrative inputs with your captured values. Set CAPZY_API_KEY in your environment. Install requests with pip install requests.

Polling and failuresThe example checks HTTP/API failures, uses 30-second request timeouts, and stops after 60 result checks. Retain taskId if your task is still processing.

Understand what comes back.

Follow this task from creation to completion. Response fields and usage follow your selected request variant.

Rotation angle

Use solution.angle as the orientation correction for the original image, matching the widget's direction and units before submitting the current challenge.

number
The rotation angle in degrees (clockwise)
POST /getTaskResult · example response
{
  "errorId": 0,
  "status": "ready",
  "solution": {
    "angle": 70
  }
}

Illustrative values. Additional metadata may be returned; only Ready contains a completed solution.

Use the result

Use solution.angle as the orientation correction for the original image, matching the widget's direction and units before submitting the current challenge.

Execution context result is the parsed Ready response from the polling example. session, when referenced, is your existing requests.Session (or browser-compatible session) with the original cookie jar, headers, and solving proxy configured in session.proxies for both http and https. Keep this client for the complete flow. task is the task object you submitted. For Shape, action_body is the original protected request body as bytes or a string, with its original Content-Type in session.headers. Install curl_cffi when the fragment imports it; match the target's required browser/TLS identity.

Use the result · Python

# Step 3: Rotate — apply the angle to the captcha image control
angle = result["solution"]["angle"]
# e.g. slider.set_rotation(angle)  or  POST angle=<value> to the site
print(f"rotate by {angle} degrees")

When something doesn't work.

Check your captured values, the selected variant, and the response before starting another task.

Connect Rotate CAPTCHA to your workflow.

Get your Capzy API key and use this guide's integration.

UnavailablePer 1,000 solves
UnavailableAverage solve time

RotateTask · Live configuration
Current stats are unavailable. Check the solver catalog.