UNLOCK API
getToken

getToken

Creates a task and waits for the answer in the same request, up to 50 seconds. If the task is not done by then, the reply is status processing with the taskId; keep checking it with getTaskResult. Result callbacks are not sent for getToken tasks.
POSThttps://unlock-api.com/getToken
Set your HTTP client timeout above 60 seconds for this method.

Request parameters

clientKey
StringRequired
Your API key, 32 characters, from the account page.
task
ObjectRequired
Task object. Its type field sets which other fields are needed. Task types
softId
IntegerOptional
Your application id, saved with the task. appId is accepted as the same field.

Request

POST /getToken
{
  "clientKey": "YOUR_API_KEY",
  "task": {
    "type": "TurnstileTaskProxyless",
    "websiteURL": "https://example.com/login",
    "websiteKey": "0x4AAAAAAAC3DHQFLr1GavRN"
  }
}

Response

{
  "errorId": 0,
  "taskId": 1001,
  "status": "ready",
  "solution": {
    "token": "0.zrSnRHO7h0HwSjSCU8oyzbjEtD8p..."
  },
  "cost": "0.00055",
  "createTime": 1791640000,
  "endTime": 1791640011,
  "solveCount": 1
}

Response fields

errorId
Integer
0 when the request worked, 1 when it did not.
taskId
Integer
Task id.
status
String
processing while the task is being solved, ready when it is done.
solution
Object
The answer. Its fields depend on the task type.
cost
String
Price of this task in US dollars.

Code samples

curl -s https://unlock-api.com/getToken \
  -H "Content-Type: application/json" \
  -d '{"clientKey":"YOUR_API_KEY","task":{"type":"TurnstileTaskProxyless","websiteURL":"https://example.com/login","websiteKey":"0x4AAAAAAAC3DHQFLr1GavRN"}}'

Errors this method can return