Join And Get Free Trial!

HCaptchaEnterpriseTask#


Token-based method of hCaptcha. The method is very similar to reCAPTCHA V2. The token can be used on the target website within the h-captcha-response form field or passed to a callback function.

HCaptchaEnterpriseTask Task object structure#

nametypeRequiredDescription
typeStringYesHCaptchaEnterpriseTask
websiteURLStringYesThe complete URL of the target page, where the Captcha is loaded
websiteKeyStringYeshCaptcha website key. Can be found in the `data-sitekey` attribute of the hCaptcha div element or the `sitekey` parameter of a request to the hCaptcha API
isInvisibleBooleanNoWorks with hCaptcha invisible version - no checkbox but challenge will appear. Typically used with callback functions
enterprisePayloadObjectNoAn Object containing additional parameters, such as: `rqdata`
proxyTypeStringYesProxy type:`http`, `socks4`, `socks5`
proxyAddressStringYesProxy server IP address or hostname
proxyPortIntegerYesproxy port
proxyLoginStringNoProxy login name
proxyPasswordStringNoProxy login password

Request example#

API endpoint: https://api.nextcaptcha.com/createTask

method: POST

Content type: application/json

{
    "clientKey":"api key",
    "task": {
        "type":"HCaptchaEnterpriseTask",
        "websiteURL":"https://hcaptcha.com/demo/hcaptcha",
        "websiteKey":"f7de0da3-3303-44e8-ab48-fa32ff8ccc7b",
        "isInvisible":false,
        "enterprisePayload": {
                "rqdata": "eyJ0eXAi"
          },
        "proxyType":"http",
        "proxyAddress":"your_proxy_address",
        "proxyPort":1234,
        "proxyLogin":"your_proxy_login",
         "proxyPassword":"your_proxy_password"
    }
}

Response example#

{
    "errorId": 0,
    "status": "ready",
    "solution": {
        "respKey": "E0_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299",
        "gRecaptchaResponse": "P1_eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9"
    },
    "createTime": 1701234567890,
    "endTime": 1701234567890
}

Sample Code#

# https://github.com/nextcaptcha/nextcaptcha-python
 
import os
import sys
from nextcaptcha import NextCaptchaAPI
 
client_key = os.getenv('NEXTCAPTCHA_KEY', "YOUR_CLIENT_KEY")
 
api = NextCaptchaAPI(client_key=client_key)
try:
  result = api.hcaptcha_enterprise(website_url="https://example.com", website_key="SITE_KEY")
 
except Exception as e:
  sys.exit(e)
 
else:
  sys.exit('solved: ' + str(result))
 

Related Links#