| 接口地址:https://v2.xxapi.cn/api/chineseCaptcha |
|---|
| 返回格式:json |
| 请求方式:get/post |
| 请求示例:https://v2.xxapi.cn/api/chineseCaptcha |
| 名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| type | string | 选填 | 传入verify为校验验证码 |
| id | string | 选填 | 传递验证码生成的ID |
| answer | string | 选填 | 传入验证码运算结果 |
| 名称 | 类型 | 说明 |
|---|---|---|
| code | int | 状态码,200 表示成功 |
| msg | string | 状态说明 |
| data | object | 验证码数据 |
| data.id | string | 验证码ID,校验时作为 id 参数传入 |
| data.url | string | 图片 base64(data:image/png;base64,...) |
| request_id | string | 请求ID |
{
"code": 200,
"msg": "数据请求成功",
"data": {
"id": "kprwygWIv7nLDso3ufhEQUw5",
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAyCAYAAAC+jCIaAAAOd0lEQVR4nOydCVwUdf/HP7sLyHIjiuBFKGkoouJ..."
},
"request_id": "85101545f7a3ce3bd00daf5c"
}| 错误码 | 说明 |
|---|---|
| 200 | 数据请求成功 |
<?php
/**
* Created by PhpStorm.
* User: FZS
* Time: 2025/4/20 07:11
*/
class freeApi
{
private $apiUrl;
public function __construct()
{
$this->apiUrl = 'https://v2.xxapi.cn/api/chineseCaptcha';
}
/**
* 获取结果
* @return array
*/
public function getResult()
{
return file_get_contents($this->apiUrl);
}
}package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
const (
APIURL = "https://v2.xxapi.cn/api/chineseCaptcha"
)
func main() {
queryUrl := fmt.Sprintf("%s",APIURL)
resp, err := http.Get(queryUrl)
if err != nil {
log.Println(err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}