Skip to main content
Are you experiencing issues obtaining the token?
Contact support

AmazonTask | AWS WAF Captcha and Challenge

AmazonTask
$1.4 / 1000 tokens
99%

Solving CAPTCHA and challenge in AWS WAF

Warning!

This task will be performed using our proxy servers.

Possible captcha variants

Request parameters

type<string>required

AmazonTaskProxyless


websiteURL<string>required

The address of the main page where the captcha is solved.


challengeScript<string>required

Link to challenge.js (see description below)


captchaScript<string>required

Link to captcha.js (see description below)


websiteKey<string>required

A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.key


context<string>required

A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.context


iv<string>required

A string that can be retrieved from an html page with a captcha or with javascript by executing the window.gokuProps.iv


cookieSolution<boolean>optional

By default false. If you need to use cookies "aws-waf-token", specify the value true. Otherwise, what you will get in return is "captcha_voucher" and "existing_token".

How to get websiteKey, context, iv and challengeScript parameters

When you go to a website, you get a 405 response and an html page with a captcha. It is from this page that you can get all the parameters:

Create task method

POST
https://api.capmonster.cloud/createTask

Request

{
"clientKey": "API_KEY",
"task": {
"type": "AmazonTaskProxyless",
"websiteURL": "https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest",
"challengeScript": "https://41bcdd4fb3cb.610cd090.us-east-1.token.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/challenge.js",
"captchaScript": "https://41bcdd4fb3cb.610cd090.us-east-1.captcha.awswaf.com/41bcdd4fb3cb/0d21de737ccb/cd77baa6c832/captcha.js",
"websiteKey": "AQIDA...wZwdADFLWk7XOA==",
"context": "qoJYgnKsc...aormh/dYYK+Y=",
"iv": "CgAAXFFFFSAAABVk",
"cookieSolution": true
}
}

Response

{
"errorId":0,
"taskId":407533072
}

Get task result method

Use the getTaskResult method to get the AmazonTask solution.

POST
https://api.capmonster.cloud/getTaskResult

Request

{
"clientKey":"API_KEY",
"taskId": 407533072
}

Response

{
"errorId":0,
"status":"ready",
"solution": {
"cookies": {
"aws-waf-token": "10115f5b-ebd8-45c7-851e-cfd4f6a82e3e:EAoAua1QezAhAAAA:dp7sp2rXIRcnJcmpWOC1vIu+yq/A3EbR6b6K7c67P49usNF1f1bt/Af5pNcZ7TKZlW+jIZ7QfNs8zjjqiu8C9XQq50Pmv2DxUlyFtfPZkGwk0d27Ocznk18/IOOa49Rydx+/XkGA7xoGLNaUelzNX34PlyXjoOtL0rzYBxMAQy0D1tn+Q5u97kJBjs5Mytqu9tXPIPCTSn4dfXv5llSkv9pxBEnnhwz6HEdmdJMdfur+YRW1MgCX7i3L2Y0/CNL8kd8CEhTMzwyoXekrzBM="
},
"userAgent": "userAgentPlaceholder"
}
}

Use SDK Library

# https://github.com/ZennoLab/capmonstercloud-client-python

import asyncio
from capmonstercloudclient import CapMonsterClient, ClientOptions
from capmonstercloudclient.requests import AmazonWafProxylessRequest

client_options = ClientOptions(api_key="your_api_key") # Replace with your CapMonster Cloud API key
cap_monster_client = CapMonsterClient(options=client_options)

amazon_waf_request = AmazonWafProxylessRequest(
websiteUrl="https://example.com", # URL с CAPTCHA
challengeScript="https://example.com/path/to/challenge.js",
captchaScript="https://example.com/path/to/captcha.js",
websiteKey="your_website_key",
context="your_context_value",
iv="your_iv_value",
cookieSolution=False
)

async def solve_captcha():
return await cap_monster_client.solve_captcha(amazon_waf_request)

responses = asyncio.run(solve_captcha())
print(responses)