实用工具类
todayfortunes & v1

2025-06-06 11:14:17

Start Me
Pasta

累计调用:430

头像
客源
未开源

专注于企业级API开发与架构设计,5年以上开发经验

今日运势

GET

你的今日运势如何?快来测一测吧!

接口地址: https://api.qster.top/API/v1/todayfortunes
接口示例: https://api.qster.top/API/v1/todayfortunes/?qskey=0&type=text

请求参数

参数名 类型 必填 说明
type string 默认json返回结果 可选json/text
qskey string
免费密钥: qstertop 建议注册账号获取密钥 延迟5秒 该密钥会限速影响体验 当前速率:150次/300秒 可联系管理员过白账号

响应参数

参数 说明
messages 返回结果
code 200正常400失败 查看更多

代码示例

<?php
$curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.qster.top/API/v1/todayfortunes", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_POSTFIELDS => [ "type" => "默认json返回结果 可选json/text",
"qskey" => "0",
], CURLOPT_HTTPHEADER => [ "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0", ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }

?>

import requests

url = "https://api.qster.top/API/v1/todayfortunes";
params = {
"type" : "默认json返回结果 可选json/text",
"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/todayfortunes";
const params = {
"type" : "默认json返回结果 可选json/text",
"qskey" => "0"
};
fetchData(url, params);

在线调试

小小赞助支持 你的支持就是我们的动力,非常感谢赞助