ガイド
タスク(トークン)
MTCaptcha

MtCaptcha: MTCaptchaの解決

TIP

createTaskメソッドでタスクを作成し、 getTaskResultメソッドで結果を取得します。

当社がサポートするタスクタイプ types:

  • MTCaptcha このタスクタイプには独自のプロキシが必要です。

タスクの作成

createTaskメソッドで認識タスクを作成します。

タスクオブジェクトの構造

プロパティタイプ必須説明
typeString必須MtCaptchaTask
MtCaptchaTaskProxyLess
websiteURLString必須ウェブサイトが使用するWebアドレスで、通常は固定値です。(例: https://google.com)
websiteKeyString必須ドメインの公開鍵で、めったに更新されません。(例: sk=MTPublic-xxx 公開鍵)
proxyStringオプションプロキシの使用方法を学ぶ

リクエスト例

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
    }
}

タスクを送信した後、成功すればレスポンスで「taskId」を受け取るはずです。タスクIDを受け取らなかった場合は、 errorCode: エラーの完全なリストをお読みください。

レスポンス例

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

結果の取得

taskIdを取得したら、ソリューションを取得するためにtaskIdを送信する必要があります。レスポンスの構造は getTaskResultで説明されています。

システムの負荷にもよりますが、5秒から30秒の間に結果が得られます。

リクエスト例

POST https://api.capsolver.com/getTaskResult
Host: api.capsolver.com
Content-Type: application/json
 
{
    "clientKey": "YOUR_API_KEY",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006"
}

レスポンス例

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

SDKリクエストの使用

# 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",
})