UNLOCK API

API แก้ วาดล้อมรอบ

ส่งงาน วาดล้อมรอบ ไปที่ API แล้วรับคำตอบที่โค้ดของคุณส่งให้หน้าเว็บ รูปภาพแบบ base64 และสิ่งที่ต้องวาดล้อมรอบ สิ่งที่ได้: จุดของเส้นที่วาดล้อมรอบ

สรุป

ราคาต่อ 1,000
$0.60 ($0.0006 ต่องาน)
ประเภท createTask
DrawAroundTask
method ของ in.php
post, canvas=1
สิ่งที่ส่ง
รูปภาพแบบ base64 และสิ่งที่ต้องวาดล้อมรอบ
สิ่งที่ได้
จุดของเส้นที่วาดล้อมรอบ

หาค่าได้ที่ไหน

ส่งรูปภาพและคำสั่งเป็น comment

createTask และ getTaskResult

สร้างงาน รอประมาณ 5 วินาที แล้วตรวจผลทุก 5 วินาทีจนสถานะเป็น ready ถ้างานล้มเหลว API จะตอบข้อผิดพลาดและคืนเงินเข้ายอดเงิน

import time, requests

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

task = requests.post(f"{API}/createTask", json={
    "clientKey": KEY,
    "task": {
      "type": "DrawAroundTask",
      "body": "/9j/4AAQSkZJRgABAQ...",
      "comment": "Draw around the dog"
    }
}).json()
if task["errorId"]:
    raise SystemExit(task["errorCode"])

for _ in range(60):   # 60 x 5 s = the 5 minute task limit
    time.sleep(5)
    r = requests.post(f"{API}/getTaskResult", json={"clientKey": KEY, "taskId": task["taskId"]}).json()
    if r["errorId"]:
        raise SystemExit(f"{r['errorCode']}: {r.get('errorDescription', '')}")   # failed tasks are refunded
    if r["status"] == "ready":
        print(r["solution"])
        break
else:
    raise SystemExit("timed out")

in.php และ res.php

งานเดียวกันด้วย API แบบฟอร์มดั้งเดิม เพิ่ม json=1 เพื่อรับคำตอบเป็น JSON ถ้าไม่ใส่ คำตอบจะเป็นข้อความธรรมดา เช่น OK|1001

curl -s "https://unlock-api.com/in.php" -d "key=YOUR_API_KEY&method=base64&canvas=1&textinstructions=Draw+around+the+dog&body=BASE64_IMAGE&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"}

ข้อมูลอ้างอิง API ฉบับเต็ม: พารามิเตอร์ทุกตัวและออบเจ็กต์ solution