Start Me
Pasta
累计调用:129
奖状生成器
GET给自己一个自定义的奖状
接口地址:
https://api.qster.top/API/V1/CertificateGenerator
接口示例:
https://api.qster.top/API/V1/CertificateGenerator/?name=客聊闲源&nr=年度最佳网站&type=url
请求参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
name | string | 是 | 名字 |
nr | string | 是 | 称呼 |
rq | string | 否 | 时间 |
type | string | 否 | 不存在type时直接返回图片,image返回图片,url返回结果为链接 |
qskey | string | 否 | 申请临时密钥 |
响应参数
参数 | 说明 |
---|---|
url | 链接 |
code | 200正常400失败 查看更多 |
代码示例
<?php
// 要调用的 URL
$url = "https://api.qster.top/API/V1/CertificateGenerator";
// 参数数组
$params = [
"name" => "名字",
"nr" => "称呼",
"rq" => "时间",
"type" => "不存在type时直接返回图片,image返回图片,url返回结果为链接",
"qskey" => "0",
];
// 使用 http_build_query 将参数转换为查询字符串
$queryString = http_build_query($params);
// 在 URL 中添加查询字符串
$finalUrl = $url . '?' . $queryString;
// 使用 file_get_contents 获取内容
$response = file_get_contents($finalUrl);
// 输出响应
echo $response;
?>
import requests
url = "https://api.qster.top/API/V1/CertificateGenerator";
params = {
"name" : "名字",
"nr" : "称呼",
"rq" : "时间",
"type" : "不存在type时直接返回图片,image返回图片,url返回结果为链接",
"qskey" => "0"
}
response = requests.get(url, params=params)
print(response.text)
function fetchData(url, params) {
const queryString = Object.keys(params)
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)
.join('&');
const fullUrl = `${url}?${queryString}`;
fetch(fullUrl)
.then(response => response.text())
.then(data => {
const resultElement = document.createElement('pre');
resultElement.textContent = data;
document.body.appendChild(resultElement);
})
.catch(error => console.error('Error fetching data:', error));
}
// 示例用法
const url = "https://api.qster.top/API/V1/CertificateGenerator";
const params = {
"name" : "名字",
"nr" : "称呼",
"rq" : "时间",
"type" : "不存在type时直接返回图片,image返回图片,url返回结果为链接",
"qskey" => "0"
};
fetchData(url, params);