> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Get task result

# Get Task Result

Retrieves the result of a previously created captcha solving task.

## API Endpoint

```
POST /getTaskResult
```

## Request Parameters

<ParamField body="clientKey" type="string" required>
  Your API key.
</ParamField>

<ParamField body="taskId" type="string" required>
  The ID of the task returned by the createTask request.
</ParamField>

## Response

<ResponseField name="status" type="string">
  The status of the task. Can be one of:

  * `processing` - The task is still being processed
  * `ready` - The task has been completed
  * `failed` - The task has failed
</ResponseField>

<ResponseField name="solution" type="object">
  The solution data. Only present when status is `ready`.
</ResponseField>

<ResponseField name="error" type="object">
  Error details. Only present when status is `failed`.
</ResponseField>

<ResponseField name="solution.gRecaptchaResponse" type="string">
  The reCAPTCHA response token. Only present for reCAPTCHA tasks.
</ResponseField>

<ResponseField name="solution.token" type="string">
  The hCaptcha response token. Only present for hCaptcha tasks.
</ResponseField>

<ResponseField name="solution.token" type="string">
  The Turnstile response token. Only present for Turnstile tasks.
</ResponseField>

<ResponseField name="solution.text" type="string">
  The text from the image. Only present for ImageToText tasks.
</ResponseField>

<ResponseField name="solution.score" type="number">
  The score value for reCAPTCHA v3. Only present for reCAPTCHA v3 tasks.
</ResponseField>

<ResponseField name="solution.userAgent" type="string">
  The User-Agent used to solve the captcha. Present if a custom User-Agent was used.
</ResponseField>

## Example Request

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/getTaskResult \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "taskId": "9d55c404-5a45-4e7b-8a93-b8ed9f26bdcf"
  }'
```

## Example Response - Processing

```json theme={null}
{
  "status": "processing"
}
```

## Example Response - Ready (reCAPTCHA)

```json theme={null}
{
  "status": "ready",
  "solution": {
    "gRecaptchaResponse": "03AGdBq25nDZASDNcKOSrPQJ2Qy7RgC8GzP64fZunlJ-KFk2bvOr9kRCdvlrqrn8c3M2cXY..."
  }
}
```

## Example Response - Ready (hCaptcha)

```json theme={null}
{
  "status": "ready",
  "solution": {
    "token": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXNza2V5IjoiRXJ1SU..."
  }
}
```

## Example Response - Failed

```json theme={null}
{
  "status": "error",
  "error": {
    "errorId": 1,
    "errorCode": "ERROR_CAPTCHA_UNSOLVABLE",
    "errorDescription": "The captcha could not be solved"
  }
}
```

## Error Codes

Common error codes:

* `ERROR_CAPTCHA_UNSOLVABLE` - The captcha could not be solved
* `ERROR_KEY_DOES_NOT_EXIST` - Invalid API key
* `ERROR_TASK_NOT_FOUND` - Task not found
* `ERROR_PROXY_CONNECTION_FAILED` - Proxy connection failed

## Notes

* The solution format varies depending on the captcha type.
* You should poll this endpoint until the status is either `ready` or `failed`. We recommend using a polling interval of 3-5 seconds.
* The solution is typically ready within 5-30 seconds, depending on the captcha type and difficulty.
