cURL
curl "https://api.ruseo.cn/api/horoscope?type=aries&time=today"
查询十二星座的今日、本周、本月、本年运势,包含综合运势、爱情运势、事业运势、财运等。
https://api.ruseo.cn/api/horoscope
接口调用前需要确认的核心配置。
/api/horoscopehoroscope必填参数必须传入,示例值可直接用于联调。
免费API不强制要求API Key,但如果您希望统计个人调用次数,请在请求时附加参数 key=您的API_KEY。
注册账号后即可获得API Key。
| 参数名 | 必填 | 类型 | 说明 | 示例值 |
|---|---|---|---|---|
key |
否 | string | 可选参数:携带此参数可统计您的个人调用次数。请注册账号获取API Key。 | YOUR_API_KEY |
type |
是 | string | 星座英文小写:aries, taurus, gemini, cancer, leo, virgo, libra, scorpio, sagittarius, capricorn, aquarius, pisces | aries |
time |
是 | string | 时间类型:today(今日), week(本周), month(本月), year(本年) | today |
优先使用示例地址测试请求参数是否正确。
https://api.ruseo.cn/api/horoscope?type=aries&time=today
curl "https://api.ruseo.cn/api/horoscope?type=aries&time=today"
$url = 'https://api.ruseo.cn/api/horoscope?type=aries&time=today';
$response = file_get_contents($url);
$data = json_decode($response, true);
fetch('https://api.ruseo.cn/api/horoscope?type=aries&time=today')
.then(res => res.json())
.then(data => console.log(data));
实际返回内容以接口脚本处理结果为准。
{
"code": 0,
"msg": "success",
"data": {
"route": "horoscope",
"example": true
}
}
| 参数名 | 类型 | 说明 | 示例值 |
|---|---|---|---|
name |
string | 星座英文名 | aries |
title |
string | 星座中文名 | 白羊座 |
type |
string | 运势类型 | 今日运势 |
time |
string | 日期 | 9月3日 |
shortcomment |
string | 简评 | 结果好坏取决你 |
fortune |
object | 运势评分 | {"all":4,"health":4,"love":2,"money":4,"work":4} |
fortunetext |
object | 运势详情 | {"all":"...","health":"..."} |
index |
object | 运势指数 | {"all":"65%","health":"69%"} |
luckycolor |
string | 幸运颜色 | 橘 |
luckyconstellation |
string | 幸运星座 | 金牛座 |
luckynumber |
string | 幸运数字 | 5 |
todo |
object | 宜忌 | {"yi":"宜阅读一本书","ji":"忌购物超预算"} |
source |
string | 数据来源 | xxapi |
点击左侧“发送请求”查看结果...