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": "a787ddeecb2eb200c6839b2937a42c0807d0be3119e909cd0f37f22dd4c7d68f64c072aff98569587a8b212e341b47b688cb1bccf931e488",
"url": "http://58.linkpc.net/api/data/qqrcode/img/1743653379.png",
"base64": "iVBORw0KGgoAAAANSUhEUgAAAG8AAABvAQAAAADKvqPNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABaElEQVQ4jbXVsY3EIBAF0G8RkNkNWKINMrcEDdi+BuyWyGgDiQbsjAAxN/i0wSXg4G61gZ8lVvxhmAX9+uAPmQF1yTAuwQBbjxspcti8uil3aeRstCo6Wze/4eRi0fNLjhCnp/sFN5o3D97bZ5MtArP19fuJ3yCXL48LR46fwjaYDdSu54nUBdXl5IlSgIxfqc8VmHwYHN1edDmCiowXB3c1UZN0LYpX7VIdOlKHeSD6crAOQ6o/1SbnPROdPo/P2iY5bKQ0b0kUrXrMGz87Pn11yOf0W+QOyTbB6Lhr9JhXLciFibgBnrK3SMcSDxlsErfrMkPCenGSoERdrjLwxbnq6deObZM3UxA57+3q6be5LmEgcSd++YIQ3CpFAk9hm6x3gVMYmetd67DOnKJ5V/gpbJt8f63jhuG1ffJk4BRYZiC+oaU6Rg6E7QWhub3VvhD1yNOmaBjwmFJdoj5wiYKRosd/+5v4BusPeb1WOpV+AAAAAElFTkSuQmCC"
}

错误码格式说明:

名称 类型 说明

代码示例:

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