CloudFlare5s

CloudFlare5s

 

Create a task through the createTask method, and then get the result through the getTaskResult method

Task Type

Task Type

Description

Price(USD)

Task Type

Description

Price(USD)

CloudFlare5STask

CloudFlare5S solution

$1.2/k

Create Task

Create a task through the createTask method

Request host: https://api.ez-captcha.com

Request api: https://api.ez-captcha.com/createTask

Request format:POST application/json

Remarks

  1. CloudFlare 5s requires the same IP, same UA, and same TLS. For UA, please use the UA we return (header field). For TLS, please use the TLS version we return (tlsVersion field).

  2. The User-agent and TLS we return may change with version updates, please pay attention to the User-agent and TLS version we return.

  3. The proxy account password cannot be empty, otherwise the proxy may be unreachable.

  4. If you anticipate a large volume of requests within a specific time period, please contact us in advance to provision additional hosts.

Parameter Structure

Parameter

Type

Required

Description

Parameter

Type

Required

Description

clientKey

string

yes

Your client key

type

string

yes

CloudFlare5STask

websiteURL

string

yes

website url, usually a fixed value.

proxy

string

yes

The proxy you used to access the website

rqData

Object

optional

If you add the mode field, the request will be sent as a POST request. Be sure to specify whether it is FORM or JSON. The fields that follow indicate the data to be submitted:

rqData: { "mode": "JSON" ...}

If you want to upload cookies, you can add a "cookie" field within rqData, for example:
rqData: { "cookie": {"key1":"value1"...}}
If you want to add extra headers, such as authorization, you can do so. Note that you can only add extra headers. do not upload regular headers like User-Agent.
rqData: { "header": {"authorization":"Bearer...."...}}

Request Example

POST https://api.ez-captcha.com/createTask Content-Type: application/json { "clientKey": "YourClientKey", "task": { "websiteURL": "https://xxx.com", "type": "CloudFlare5STask", "proxy": "http://username:password@ip:port", "rqData":{ //optional "mode":"FORM ",//JSON or FORM is determined based on the submission method of the webpage. If you need to send it in POST format, you must add this value "name1":"value1",//your key "name2":123456, //If you need to upload cookies, you can add a cookie field. "cookie":{ "key1":"value1", "key2":"value2", } //If additional headers need to be uploaded, header fields can be added. "header":{ "authority":"api.x.com", "authorization":"Bearer ....", } ... }, } }

Reponse Example

{ "errorId": 0, "errorCode": "", "errorDescription": "", "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // Please save this ID for next step }

Get Result

Use the getTaskResult method to get the recognition result

Request host: https://api.ez-captcha.com

Request api: https://api.ez-captcha.com/getTaskResult

Request format:POST application/json

Request Example

POST https://api.ez-captcha.com/getTaskResult Content-Type: application/json { "clientKey":"YOUR_API_KEY", "taskId": "TASKID OF CREATETASK" //ID created by createTask method }

Response Data

Parameter

Type

Description

Parameter

Type

Description

errorId

Integer

Error message: 0 - no error, 1 - error

errorCode

string

Error code, click here to view all error list

errorDescription

string

Detailed error description

status

String

processing - task is in progress, please try again in 3 seconds

ready - task is complete, find the result in the solution parameter

solution

Object

The recognition result will be different for different types of captcha. For reCaptcha, the result is gRecaptchaResponse in the object.

Response Example

{ "errorId": 0, "errorCode": null, "errorDescription": null, "solution": { { "header": { "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "accept-encoding": "gzip, deflate, br, zstd", ... "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" }, "tlsVersion":"chrome131", "cookies": { "cf_clearance": "suAu.vzSYU4etZ2lc1FVhVhoAtKrKjHvbLn1.qY8m0E-1736763580-1.2.1.1-NM03fWRNYkN_gYFO1n1nlzwe9MtiNmm9YIz7ujq_Jmh_FyJvg2YA7ImuXyD_9ouZ2XYy.G73Gude_Qpzx04subKCPhHeaRr1qTKicxeGV9p6GhU_z75.6OTi.FlDFXe7ogCYwyPMn3xZKzFkzpDqpHBUv5uq40LF7Z07PIEPizwE8XZuhlVBhVkgulsWu4QCkStR95HbJxGNmKOf0h2PZSJPSStyCV5XwpmAIuZy3Zhfm46r4gDAbh7q.Isx_nMjpo6WCGYrpQrFHAfZQWd6NshmfxQyVJmItilb1p2evZrt3aVQOhmaTpKOzM4E5Rhtc8i2xYtm_hUk9ToGQm_7_g", ... }, "body": "<!DOCTYPE html>\n<html lang="en">\n<head>\n ..." } }, "status": "ready" }

Response Description

  • Successful recognition: when errorId is equal to 0 and status is equal to ready, the result is in the solution.

  • Identifying: When errorId is 0 and status is processing, please try again after 3 seconds.

  • An error occurred: when the errorId is greater than 0, please understand the error information according to the errorDescription All error descriptions

Demo

import threading import time import requests import json from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) def test(): start_time = time.time() data = { "clientKey": "YourClientKey", "task": { "type": "CloudFlare5STask",# "websiteURL": "https://xxx.com", "proxy": "http://username:password@ip:port" } } resp = requests.post("https://api.ez-captcha.com/createTask", json=data,verify=False) task_id = resp.json()['taskId'] print(f"task_id: {task_id}") for _ in range(30): data = { "clientKey": "YourClientKey",# "taskId": task_id } resp = requests.post("https://api.ez-captcha.com/getTaskResult", json=data,verify=False) if "header" in resp.text: resp_json = json.loads(resp.text) print(f"Headers: {resp_json.get('solution', {}).get('header', {})}") print(f"CF Clearance: {resp_json.get('solution', {}).get('cookies', {}).get('cf_clearance', '')}") end_time = time.time() print(f"time: {end_time - start_time}") break; elif "errorDesc" in resp.text: print(resp.text) break; time.sleep(1) if __name__ == '__main__': test()