QQ扫码获取Cookie
如初助手API

接口地址: https://www.58.linkpc.net/api/qqrcode

返回格式: 请看返回示例

请求方式: GET

请求示例: https://www.58.linkpc.net/api/qqrcode

请求参数说明:

名称 必填 类型 说明
type Int 不填就是群的可选,1为qun.qq.com,2为vip.qq.com,3为qzone.qq.com,4为huifu.qq.com,5为id.qq.com,6为docs.qq.com,7为connect.qq.com
qrsig String qrsig值,不填则为获取二维码

返回参数说明:

名称 类型 说明

返回示例:

{
"code": 1,
"qrsig": "7baafbb26a652013f3be53f0185646ee2734b25e0452f9fac9b07e769f470bd193c059c3e30b692fbef35714f1e135a0b93b779087bfe71e",
"url": "http://58.linkpc.net/api/data/qqrcode/img/1732230993.png",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAG8AAABvAQAAAADKvqPNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABbklEQVQ4jbXVsY3EIBAF0G8RkK0bQKINMloyDRhvA6YlMtqwRAPnjAB5btjdCy4BB3cra8ULxsYzzBj064c/ZAX0Mx2rPRbAj+hJnxFTpJPqkItULorL8L+6w9XQfpswYpfivEFPCvLwSbnPJnsElEvt+nn9Djl9dZV04fCfxHZYF+hQNJH+gh5y5pwbznl+lvbcLikkxQWaEy84ts/K1blkvqCm2G7VJa+xWrFZNZdMI27ycAku5pNabJ9nUj7qkOrDttg+Q6EzVhf5cXrE6kjvNockdrSCdkmb5bONxeTNYMQ6c6zEXNSUBA1Im+G657Pk1yHss84RrnCBRIh1yAe49HqT+suO6YqC5ZwrV9om+/SlLpa7BivGXCQ8lzIBeDd7h60XeFcXr5Masc2cELlGfGAEjcj9+wB3jXrH9vmaDAeMAl4tOeJq8y5bWf0NTrylojfzie2Q5+TFM6cAUg/JM6e9Mh0r8oj/9pn4BmCEaG5cuGf1AAAAAElFTkSuQmCC"
}

错误码格式说明:

名称 类型 说明

代码示例:

<?php
header('Content-type: application/json; charset=utf-8');
date_default_timezone_set('PRC');
$url = 'https://58.linkpc.net/api/qqrcode';
$type = isset($_GET['type']) ? $_GET['type'] : '';
if ($type == 'json' || $type == 'JSON') {
$result = file_get_contents($url . '?type=json');
echo $result;
} else {
// 使用cURL获取URL内容
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

// 检查内容类型并输出相应内容
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
curl_close($ch);

if (strpos($contentType, 'image') !== false) {
// 输出图片
header('Content-Type: ' . $contentType);
echo $response;
} elseif (strpos($contentType, 'text') !== false) {
// 输出文字
header('Content-Type: ' . $contentType);
echo $response;
} elseif (strpos($contentType, 'application/json') !== false) {
// 输出JSON
header('Content-Type: application/json');
echo $response;
} else {
// 输出网页返回内容
header('Content-Type: text/html');
echo $response;
}
}
?>