0 0 0

获取星座运势

管理员组 安生 管理员组
9天前 16

获取星座运势

GET


接口描述

免费API提供星座运势查询服务,支持获取今日、明日、本周和本月的星座运势信息,适用于个人运势查询、占星应用和生活方式平台。

请求参数

 

请求示例

 
 
 
var axios = require('axios')
 
var config = {
method: 'get',
url: 'https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today'
}
 
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
})
 
 
 
< !--导入JQ -->
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
 
<script>
$.ajax({
url: 'https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today',
type: 'get',
beforeSend: function () {
//请求中执行的代码
},
complete: function () {
//请求完成执行的代码
},
error: function () {
//请求成功失败执行的代码
},
success: function (res) {
// 状态码 200 表示请求成功
if (res.code === 200) {
console.log(res)
} else {
console.log(res)
}
}
})
</script>
 
 
 
var requestOptions = {
method: 'GET',
redirect: 'follow'
}
 
fetch("https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error))
 
 
 
var xhr = new XMLHttpRequest()
xhr.withCredentials = true
 
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText)
}
})
 
xhr.open("GET", "https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today")
 
xhr.send()
 
 
 
<? php
 
$curl = curl_init()
 
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
))
 
$response = curl_exec($curl)
 
curl_close($curl);
echo $response
 
 
 
import requests
 
url = "https://v2.xxapi.cn/api/horoscope?type=aquarius&time=today"
 
payload = {}
headers = {
'User-Agent': 'xiaoxiaoapi/1.0.0 (https://xxapi.cn)'
}
 
response = requests.request("GET", url, headers = headers, data = payload)
 
print(response.text)

axios ajax fetch xhr php python

返回示例

 
 
 
{
"code": 200,
"msg": "数据请求成功",
"data": {
"fortune": {
"all": 4,
"health": 4,
"love": 2,
"money": 4,
"work": 4
},
"fortunetext": {
"all": "可能会迎来一些新的变化,无论是在工作还是生活中。这些变化可能会让你感到有些不适,但结果好坏取决于你的态度和应对方式。建议你保持积极乐观的心态,勇敢面对挑战,相信自己能够克服困难,迎接新的机遇。生活方面,你可以尝试做一些新鲜有趣的事情,比如尝试新的运动项目或者去参加一些社交活动,让自己的生活更加充实多彩。星8座8屋",
"health": "注意牙齿健康,尤其要提防牙周病问题。建议你要保持口腔清洁,定期刷牙漱口,并定期就诊口腔科医生进行检查。避免食用过甜食物,注意牙齿健康,保持良好口腔卫生。",
"love": "单身的你,不要因为遇到小挫折就轻易放弃寻找爱情的机会。保持积极的态度,继续努力,一定能够找到属于自己的幸福。已有伴者,遇到问题时要与伴侣共同面对,共同解决,不要逃避责任。",
"money": "财务状况可能不太理想。建议你要注意节制各方面的消费,特别是在吃喝玩乐上要控制开支,避免不必要的支出。通过精打细算,可以缓解财务压力,保持稳定的财务状况。",
"work": "需要走出舒适区才能获得更多的成长和进步。不要害怕失败,勇敢地尝试新的事物,挑战自己的极限。只有在不断地突破自己的局限性,你才能够开拓更广阔的事业和学业天地。抛开惰性和惯性思维,大胆尝试新的方法和策略,相信自己的能力和潜力。"
},
"index": {
"all": "65%",
"health": "69%",
"love": "40%",
"money": "61%",
"work": "72%"
},
"luckycolor": "5",
"luckyconstellation": "金牛座",
"luckynumber": "橘",
"name": "aries",
"shortcomment": "结果好坏取决你",
"time": "9月3日",
"title": "白羊座",
"todo": {
"ji": "忌购物超预算",
"yi": "宜阅读一本书"
},
"type": "今日运势"
}
}
看过的人 (1)
  • 3648682911
最新回复 (0)
全部楼主

    暂无评论

    • 全网机器人框架插件论坛
      2
          

请先登录后发表评论!

返回
您是第9999999位访客
机器人论坛

请先登录后发表评论!