HCaptchaTaskProxyless#
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.
HCaptchaTaskProxyless Task object structure#
name type Required Description type String Yes HCaptchaTaskProxyless
websiteURL String Yes The complete URL of the target page, where the Captcha is loaded websiteKey String Yes hCaptcha 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 isInvisible Boolean No Works with hCaptcha invisible version - no checkbox but challenge will appear. Typically used with callback functions enterprisePayload Object No An Object containing additional parameters, such as: `rqdata`
Request example#
API endpoint: https://api.nextcaptcha.com/createTask
method: POST
Content type: application/json
{
"clientKey" : "api key" ,
"task" : {
"type" : "HCaptchaTaskProxyless" ,
"websiteURL" : "https://hcaptcha.com/demo/hcaptcha" ,
"websiteKey" : "f7de0da3-3303-44e8-ab48-fa32ff8ccc7b" ,
"isInvisible" : false ,
"enterprisePayload" : {
"rqdata" : "eyJ0eXAi"
}
}
}
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( website_url = "https://example.com" , website_key = "SITE_KEY" )
except Exception as e:
sys.exit(e)
else :
sys.exit( 'solved: ' + str (result))
// https://github.com/nextcaptcha/nextcaptcha-go
package main
import (
" fmt "
" log "
" github.com/nextcaptcha/nextcaptcha-go "
)
func main () {
api := nextcaptcha. NewNextCaptchaAPI ( "API_KEY" )
result, err := api. HCaptcha ( "https://example.com" , "SITE_KEY" , nextcaptcha . RecaptchaV3Options {})
if err != nil {
log. Fatal (err);
}
fmt. Println ( "result " + result)
}
// https://github.com/nextcaptcha/nextcaptcha-csharp
string clientKey = "YOUR_CLIENT_KEY" ;
string solftId = "" ; // Optional
string callbackUrl = "" ; // Optional
bool openLog = true ; // Optional
var nextCaptchaAPI = new NextCaptchaAPI (clientKey, solftId, callbackUrl, openLog);
string websiteUrl = "https://example.com" ;
string websiteKey = "YOUR_WEBSITE_KEY" ;
bool isInvisible = false ; // Optional
var result = await nextCaptchaAPI. SolveHCaptchaAsync (websiteUrl, websiteKey, isInvisible);
Related Links#