> ## 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.

# hCaptcha

> Solve standard and enterprise hCaptcha challenges with VastCap's API

## Service Details

* **Service ID**: `hcaptcha`
* **Price**: \$0.0025 $per solve$ (\$2.5 per 1000 solves) (subject to change very soon)
* **Average Solve Time**: 8 seconds
* **Success Rate**: 90-98%

## Required Parameters

<ParamField body="websiteURL" type="string" required>
  The URL of the page where the hCaptcha is located.
</ParamField>

<ParamField body="websiteKey" type="string" required>
  The site key of the hCaptcha from the target website.
</ParamField>

<ParamField body="proxy" type="string" required>
  Proxy in format `login:password@ip_address:port`. Required for accurate solving.
</ParamField>

## Optional Parameters

<ParamField body="userAgent" type="string">
  The User-Agent header that will be used when solving the captcha. Must match the one used in your browser.
</ParamField>

<ParamField body="rqdata" type="string">
  The rqdata value from the hCaptcha challenge. Required for some implementations.
</ParamField>

<ParamField body="enterprise" type="boolean">
  Set to `true` for enterprise hCaptcha (Discord, Epic Games, TikTok, etc).
</ParamField>

<ParamField body="invisible" type="boolean">
  Set to `true` if the captcha is invisible (e.g., discord.com/register uses invisible captcha).
  More info: [https://docs.hcaptcha.com/invisible/](https://docs.hcaptcha.com/invisible/)
</ParamField>

## Example Request - Standard hCaptcha

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "HCaptchaTask",
      "websiteURL": "https://modrinth.com",
      "websiteKey": "4a7a2c80-68f2-4190-9d52-131c76e0c14e",
      "proxy": "user:pass@ip:port"
    }
  }'
```

## Example Request - Enterprise hCaptcha

```bash theme={null}
curl -X POST https://captcha.vast.sh/api/solver/createTask \
  -H "Content-Type: application/json" \
  -d '{
    "clientKey": "YOUR_API_KEY",
    "task": {
      "type": "HCaptchaTask",
      "websiteURL": "https://discord.com/register",
      "websiteKey": "a9b5fb07-92ff-493f-86fe-352a2803b3df",
      "proxy": "user:pass@ip:port",
      "rqdata": "...",
      "enterprise": true,
      "invisible": true
    }
  }'
```

> Set `enterprise: true` for Discord, Epic Games, TikTok, and other enterprise sites.
> Discord Register, for example, uses invisible hcaptcha.

## Solution Format

```json theme={null}
{
  "token": "P1_eyJ0eXAiOiJKV1..."
}
```

## Integration Examples

### Python

```python theme={null}
import requests
import time

# Create a task
task_data = {
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "HCaptchaTask",
        "websiteURL": "https://modrinth.com",
        "websiteKey": "4a7a2c80-68f2-4190-9d52-131c76e0c14e",
        "proxy": "user:pass@ip:port"
    }
}

response = requests.post(
    "https://captcha.vast.sh/api/solver/createTask", 
    json=task_data
)
task_id = response.json()["taskId"]

# Get the result
while True:
    result_data = {
        "clientKey": "YOUR_API_KEY",
        "taskId": task_id
    }
    result = requests.post(
        "https://captcha.vast.sh/api/solver/getTaskResult", 
        json=result_data
    ).json()
    
    if result.get("status") == "ready":
        # Use the token in your form submission
        hcaptcha_token = result["solution"]["token"]
        break
    
    time.sleep(3)  # Wait before trying again
```

## Notes

* The solution token is typically valid for 2 minutes after being issued.
* For both standard and enterprise hCaptcha, use `HCaptchaTask`. Set `enterprise: true` for enterprise sites (Discord, Epic Games, TikTok, etc).
* Proxy usage is required for accurate solving.
* The old `HCaptchaEnterpriseTask` is deprecated. Use `HCaptchaTask` with the `enterprise` parameter instead.
