Skip to content
On this page
Home
>Task(Token)
>MtCaptcha

MtCaptcha: solving MtCaptcha

Create the task with the createTask method and get the result with

the getTaskResult method.

The task type types that we support:

  • MTCaptcha this task type require your own proxies.

Create Task

Create a recognition task with the createTask method.

Task Object Structure

PropertiesTypeRequiredDescription
typeStringRequiredMtCaptchaTask
MtCaptchaTaskProxyLess
websiteURLStringRequiredWeb address of the website using hcaptcha, generally it's fixed value. (Ex: https://google.com)
websiteKeyStringRequiredThe domain public key, rarely updated. (Ex: sk=MTPublic-xxx public key)
proxyStringOptionalLearn Using proxies

Example request

json
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json

{
    "clientKey": "YOUR_API_KEY",
    "task": {
        "type": "MtCaptchaTask", //Required
        "websiteURL": "http://www.mywebsite.com/demo", //Required
        "websiteKey": "MTPublic-xxxxxxxxx", //Required
        "proxy": "http:ip:port:user:pass" // socks5:ip:port:user:pass
    }
}

After you submit the task to us, you should receive in the response a 'Task id' if it's successfull. Please read errorCode: full list of errors if you didn't receive the task id.

Example Response

json
{
    "errorId": 0,
    "errorCode": "",
    "errorDescription": "",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

Getting Results

After you have the taskId, you need to submit the taskId to retrieve the solution. Response structure is explained in getTaskResult.

Depending on the system load, you will get the results within the interval of 5s to 30s

Example Request

json
POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json

{
    "clientKey": "YOUR_API_KEY",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

Example Response

json
{
  "errorId": 0,
  "taskId": "646825ef-9547-4a29-9a05-50a6265f9d8a",
  "status": "ready",
  "solution": {
    "token": ""
  }
}

Use SDK Request

python
# pip install --upgrade capsolver
# export CAPSOLVER_API_KEY='...'

import capsolver

# capsolver.api_key = "..."
solution = capsolver.solve({
    "type": "MtCaptchaTask",
    "websiteURL": "http://www.mywebsite.com/demo",
    "websiteKey": "MTPublic-xxxxxxxxx",
    "proxy": "ip:port:username:port",
})
go
package main

import (
	"fmt"
	capsolver_go "github.com/capsolver/capsolver-go"
	"log"
)

func main() {
	// first you need to install sdk
	//go get github.com/capsolver/capsolver-go
	//export CAPSOLVER_API_KEY='...' or
	//capSolver := CapSolver{ApiKey:"..."}

	capSolver := capsolver_go.CapSolver{}
	solution, err := capSolver.Solve(map[string]any{
		"type": "MtCaptchaTask",
		"websiteURL": "http://www.mywebsite.com/demo",
		"websiteKey": "MTPublic-xxxxxxxxx",
		"proxy":"ip:port:username:port",
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}

``