Serializer¶
To import this module:
from python3_anticaptcha.core import serializer
- pydantic model core.serializer.BaseAPIRequestSer¶
Show JSON schema
{ "title": "BaseAPIRequestSer", "type": "object", "properties": { "clientKey": { "maxLength": 32, "minLength": 32, "title": "Clientkey", "type": "string" } }, "required": [ "clientKey" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field clientKey: str [Required]¶
- Constraints:
min_length = 32
max_length = 32
- pydantic model core.serializer.BaseAPIResponseSer¶
Show JSON schema
{ "title": "BaseAPIResponseSer", "type": "object", "properties": { "errorId": { "default": null, "description": "Error identifier.", "title": "Errorid", "type": "integer" }, "errorCode": { "default": null, "description": "An error code.", "title": "Errorcode", "type": "string" }, "errorDescription": { "default": null, "description": "Short description of the error.", "title": "Errordescription", "type": "string" } } }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field errorCode: str = None¶
An error code.
- field errorDescription: str = None¶
Short description of the error.
- field errorId: int = None¶
Error identifier.
- pydantic model core.serializer.CreateTaskRequestSer¶
Show JSON schema
{ "title": "CreateTaskRequestSer", "type": "object", "properties": { "clientKey": { "maxLength": 32, "minLength": 32, "title": "Clientkey", "type": "string" }, "task": { "default": null, "description": "Task object.", "title": "Task", "type": "object" }, "languagePool": { "default": "en", "description": "Sets workers' pool language. Only applies to image captchas.", "title": "Languagepool", "type": "string" }, "callbackUrl": { "default": null, "description": "Web address where we can send the results of captcha task processing.", "title": "Callbackurl", "type": "string" }, "softId": { "const": "867", "default": "867", "title": "Softid" } }, "required": [ "clientKey" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field callbackUrl: str = None¶
Web address where we can send the results of captcha task processing.
- field languagePool: str = 'en'¶
Sets workers’ pool language. Only applies to image captchas.
- field softId: Literal['867'] = '867'¶
- field task: Dict = None¶
Task object.
- pydantic model core.serializer.CreateTaskRequestTaskSer¶
Show JSON schema
{ "title": "CreateTaskRequestTaskSer", "type": "object", "properties": { "type": { "allOf": [ { "$ref": "#/$defs/CaptchaTypeEnm" } ], "description": "Captcha task type name" } }, "$defs": { "CaptchaTypeEnm": { "description": "Enum with all available captcha types", "enum": [ "Control", "ImageToTextTask", "RecaptchaV2Task", "RecaptchaV2TaskProxyless", "RecaptchaV3TaskProxyless", "RecaptchaV2EnterpriseTask", "RecaptchaV2EnterpriseTaskProxyless", "FunCaptchaTask", "FunCaptchaTaskProxyless", "GeeTestTask", "GeeTestTaskProxyless", "HCaptchaTask", "HCaptchaTaskProxyless", "TurnstileTask", "TurnstileTaskProxyless", "AntiGateTask" ], "title": "CaptchaTypeEnm", "type": "string" } }, "required": [ "type" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field type: CaptchaTypeEnm [Required]¶
Captcha task type name
- pydantic model core.serializer.ProxyDataOptionsSer¶
Show JSON schema
{ "title": "ProxyDataOptionsSer", "type": "object", "properties": { "proxyType": { "allOf": [ { "$ref": "#/$defs/ProxyTypeEnm" } ], "description": "Type of proxy" }, "proxyAddress": { "description": "Proxy IP address ipv4/ipv6. No host names or IP addresses from local networks", "title": "Proxyaddress", "type": "string" }, "proxyPort": { "description": "Proxy port", "title": "Proxyport", "type": "integer" } }, "$defs": { "ProxyTypeEnm": { "description": "Enum store proxy types", "enum": [ "http", "https", "socks4", "socks5" ], "title": "ProxyTypeEnm", "type": "string" } }, "required": [ "proxyType", "proxyAddress", "proxyPort" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field proxyAddress: str [Required]¶
Proxy IP address ipv4/ipv6. No host names or IP addresses from local networks
- field proxyPort: int [Required]¶
Proxy port
- field proxyType: ProxyTypeEnm [Required]¶
Type of proxy
- pydantic model core.serializer.CreateTaskResponseSer¶
Show JSON schema
{ "title": "CreateTaskResponseSer", "type": "object", "properties": { "errorId": { "default": null, "description": "Error identifier.", "title": "Errorid", "type": "integer" }, "errorCode": { "default": null, "description": "An error code.", "title": "Errorcode", "type": "string" }, "errorDescription": { "default": null, "description": "Short description of the error.", "title": "Errordescription", "type": "string" }, "taskId": { "default": null, "description": "Task ID that you should later use in the `getTaskResult` method.", "title": "Taskid", "type": "integer" } } }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field taskId: int = None¶
Task ID that you should later use in the getTaskResult method.
- pydantic model core.serializer.GetTaskResultRequestSer¶
Show JSON schema
{ "title": "GetTaskResultRequestSer", "type": "object", "properties": { "clientKey": { "maxLength": 32, "minLength": 32, "title": "Clientkey", "type": "string" }, "taskId": { "default": null, "description": "An identifier obtained in the createTask method.", "title": "Taskid", "type": "integer" } }, "required": [ "clientKey" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field taskId: int = None¶
An identifier obtained in the createTask method.
- pydantic model core.serializer.GetTaskResultResponseSer¶
Show JSON schema
{ "title": "GetTaskResultResponseSer", "type": "object", "properties": { "errorId": { "default": null, "description": "Error identifier.", "title": "Errorid", "type": "integer" }, "errorCode": { "default": null, "description": "An error code.", "title": "Errorcode", "type": "string" }, "errorDescription": { "default": null, "description": "Short description of the error.", "title": "Errordescription", "type": "string" }, "status": { "allOf": [ { "$ref": "#/$defs/ResponseStatusEnm" } ], "default": null, "description": "Captcha solving process status." }, "solution": { "default": null, "description": "Task result data. Different for each type of task.", "title": "Solution", "type": "object" }, "cost": { "default": null, "description": "Cost of the task in USD.", "title": "Cost", "type": "number" }, "ip": { "default": null, "description": "IP from which the task was created.", "title": "Ip", "type": "string" }, "createTime": { "default": null, "description": "UNIX timestamp date of task creation.", "title": "Createtime", "type": "integer" }, "endTime": { "default": null, "description": "UNIX timestamp date of task completion.", "title": "Endtime", "type": "integer" }, "solveCount": { "default": null, "description": "Number of workers who tried to complete your task.", "title": "Solvecount", "type": "integer" }, "taskId": { "default": null, "description": "Task ID.", "title": "Taskid", "type": "integer" } }, "$defs": { "ResponseStatusEnm": { "description": "Enum store results `status` field variants", "enum": [ "processing", "ready" ], "title": "ResponseStatusEnm", "type": "string" } } }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field cost: float = None¶
Cost of the task in USD.
- field createTime: int = None¶
UNIX timestamp date of task creation.
- field endTime: int = None¶
UNIX timestamp date of task completion.
- field ip: str = None¶
IP from which the task was created.
- field solution: Dict = None¶
Task result data. Different for each type of task.
- field solveCount: int = None¶
Number of workers who tried to complete your task.
- field status: ResponseStatusEnm = None¶
Captcha solving process status.
- field taskId: int = None¶
Task ID.
- pydantic model core.serializer.TurnstileProxylessOptionsSer¶
Show JSON schema
{ "title": "TurnstileProxylessOptionsSer", "type": "object", "properties": { "type": { "allOf": [ { "$ref": "#/$defs/CaptchaTypeEnm" } ], "description": "Captcha task type name" }, "websiteURL": { "description": "Address of a target web page. Can be located anywhere on the web site.", "title": "Websiteurl", "type": "string" }, "websiteKey": { "description": "Website key", "title": "Websitekey", "type": "string" } }, "$defs": { "CaptchaTypeEnm": { "description": "Enum with all available captcha types", "enum": [ "Control", "ImageToTextTask", "RecaptchaV2Task", "RecaptchaV2TaskProxyless", "RecaptchaV3TaskProxyless", "RecaptchaV2EnterpriseTask", "RecaptchaV2EnterpriseTaskProxyless", "FunCaptchaTask", "FunCaptchaTaskProxyless", "GeeTestTask", "GeeTestTaskProxyless", "HCaptchaTask", "HCaptchaTaskProxyless", "TurnstileTask", "TurnstileTaskProxyless", "AntiGateTask" ], "title": "CaptchaTypeEnm", "type": "string" } }, "required": [ "type", "websiteURL", "websiteKey" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields:
- field websiteKey: str [Required]¶
Website key
- field websiteURL: str [Required]¶
Address of a target web page. Can be located anywhere on the web site.
- pydantic model core.serializer.TurnstileOptionsSer¶
Show JSON schema
{ "title": "TurnstileOptionsSer", "type": "object", "properties": { "proxyType": { "allOf": [ { "$ref": "#/$defs/ProxyTypeEnm" } ], "description": "Type of proxy" }, "proxyAddress": { "description": "Proxy IP address ipv4/ipv6. No host names or IP addresses from local networks", "title": "Proxyaddress", "type": "string" }, "proxyPort": { "description": "Proxy port", "title": "Proxyport", "type": "integer" }, "type": { "allOf": [ { "$ref": "#/$defs/CaptchaTypeEnm" } ], "description": "Captcha task type name" }, "websiteURL": { "description": "Address of a target web page. Can be located anywhere on the web site.", "title": "Websiteurl", "type": "string" }, "websiteKey": { "description": "Website key", "title": "Websitekey", "type": "string" } }, "$defs": { "CaptchaTypeEnm": { "description": "Enum with all available captcha types", "enum": [ "Control", "ImageToTextTask", "RecaptchaV2Task", "RecaptchaV2TaskProxyless", "RecaptchaV3TaskProxyless", "RecaptchaV2EnterpriseTask", "RecaptchaV2EnterpriseTaskProxyless", "FunCaptchaTask", "FunCaptchaTaskProxyless", "GeeTestTask", "GeeTestTaskProxyless", "HCaptchaTask", "HCaptchaTaskProxyless", "TurnstileTask", "TurnstileTaskProxyless", "AntiGateTask" ], "title": "CaptchaTypeEnm", "type": "string" }, "ProxyTypeEnm": { "description": "Enum store proxy types", "enum": [ "http", "https", "socks4", "socks5" ], "title": "ProxyTypeEnm", "type": "string" } }, "required": [ "proxyType", "proxyAddress", "proxyPort", "type", "websiteURL", "websiteKey" ] }
- Config:
use_enum_values: bool = True
validate_assignment: bool = True
- Fields: