UNLOCK API

복합 이미지 풀이 API

복합 이미지 작업을 API로 보내면, 코드가 페이지에 제출할 답을 돌려받아요. 보내는 것: class(recaptcha, hcaptcha, funcaptcha, recognition), 이미지, 과제 문구. 받는 것: 맞는 이미지나 칸.

한눈에 보기

1,000건당 가격
$0.60 (1건당 $0.0006)
createTask 이름
ComplexImageTask
in.php 방식
보내는 것
class(recaptcha, hcaptcha, funcaptcha, recognition), 이미지, 과제 문구
받는 것
맞는 이미지나 칸

값을 찾는 곳

이미지 목록과 지시문을 metadata에 넣어 보내세요.

createTask와 getTaskResult

작업을 만들고 5초쯤 기다린 뒤, 상태가 ready가 될 때까지 5초마다 결과를 확인하세요. 작업이 실패하면 API가 오류로 답하고 비용은 잔액으로 돌아와요.

import time, requests

API = "https://unlock-api.com"
KEY = "YOUR_API_KEY"

task = requests.post(f"{API}/createTask", json={
  "clientKey": KEY,
  "task": {
      "type": "ComplexImageTask",
      "class": "recaptcha",
      "imagesBase64": [
        "/9j/4AAQSkZJRgABAQ..."
      ],
      "metadata": {
        "Task": "Select all images with a bus",
        "Grid": "3x3"
      }
    }
}).json()
if task["errorId"]:
    raise SystemExit(task["errorCode"])

while True:
    time.sleep(5)
    r = requests.post(f"{API}/getTaskResult", json={"clientKey": KEY, "taskId": task["taskId"]}).json()
    if r["errorId"]:
        raise SystemExit(r["errorCode"])   # failed tasks are refunded
    if r["status"] == "ready":
        print(r["solution"])
        break

in.php와 res.php

같은 작업을 예전 폼 방식 API로 보내는 예시예요. json=1을 붙이면 JSON으로, 빼면 OK|1001 같은 글자로 답해요.

curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&undefined&json=1"
# {"status":1,"request":"1001"}

curl -s "https://unlock-api.com/res.php?key=YOUR_API_KEY&action=get&id=1001&json=1"
# {"status":0,"request":"CAPCHA_NOT_READY"}  then  {"status":1,"request":"ANSWER"}