Skip to content
On this page
Home
>任务(令牌)
>FunCaptcha

FunCaptcha 协议接口

⚠️ 通过 createTask 创建任务, 然后通过 getTaskResult 获取识别结果

任务类型type如下

  • FunCaptchaTaskProxyLess 使用服务器内置代理,不需要你传代理
  • FunCaptchaTask 需要你传入自己的代理

创建任务

通过 createTask 创建任务

参数结构

属性类型Required说明
typeStringYesFunCaptchaTaskProxyLess
FunCaptchaTask
websiteURLStringYesFunCaptcha 网页地址,一般固定值。
websitePublicKeyStringYesFunCaptcha 网站密钥,固定值。
dataStringNo有些站点可能需要附加参数,比如: blob,请将它作为 JSON 字符串提交.像这样:{"\blob\":\"HERE_COMES_THE_blob_VALUE\"}
请参考如何获取blob
proxyStringNo学习如何使用代理

请求示例

txt
POST https://api.capsolver.com/createTask
Host: api.capsolver.com
Content-Type: application/json
json
{
  "clientKey": "YOUR_API_KEY_HERE",
  "task": {
    "type":"FunCaptchaTaskProxyLess", //Required
    "websiteURL":"", //Required
    "websitePublicKey":"", //Required
    "data": "{\"blob\": \"flaR60YY3tnRXv6w.l32U2KgdgEUCbyoSPI4jOxUK7TCRrv5JX4...\"}" // Optional
  }
}

响应示例

json
{
    "errorId": 0,
    "status": "idle",
    "taskId": "61138bb6-19fb-11ec-a9c8-0242ac110006" // 请记录此ID
}

获取结果

使用 getTaskResult 方法获取识别结果

根据系统负载,您将在 1s20s 的时间间隔内得到结果

请求示例

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

响应示例

json
{
    "errorId": 0,
    "solution": {
        "token": "3AHJ_q25SxXT-pmSeBXjzScW-EiocHwwpwqtk1QXlJnGnU......"
    },
    "status": "ready"
}

使用 SDK 请求

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

import capsolver

# capsolver.api_key = "..."
solution = capsolver.solve(
    "type":"FunCaptchaTaskProxyless",
    "websitePublicKey": "",
    "websiteURL": "",
)
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":             "FunCaptchaTaskProxyLess",
		"websitePublicKey": "xxxx-xxxx-xxxx",
		"websiteURL":       "xxxx-xxxx-xxxx",
	})
	if err != nil {
		log.Fatal(err)
		return
	}
	fmt.Println(solution)
}