# 十二星座 · 星座

> 本文档为机器可读 Markdown，便于 AI / SDK 自动对接。页面原文：https://www.wapi.cn/api_detail/73/184.html
> 纯文本地址：`https://www.wapi.cn/api_detail/73/184.html?format=md`

## 概览

- **接口名称**：星座
- **子接口**：十二星座（ID `184`）
- **接口简介**：提供十二星座查询，每个星座的今天、明天、本周、本月、本年星座运势今日运势查询接口。
- **计费说明**：10.00元/月
- **请求地址**：`https://uaqy.api.storeapi.net/pyi/73/184`（支持 http/https）
- **请求方式**：`GET,POST`
- **返回格式**：`json,xml`
- **Content-Type（POST）**：`application/x-www-form-urlencoded;charset=utf-8`

## 子接口列表

- `185` 星座运势查询
- `184` 十二星座 ← 当前

## 请求参数

| 名称 | 必填 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `appid` | 是 | String | 应用ID，在后台我的应用查看或者添加 | 1 |
| `format` | 否 | String | 返回数据格式类型，每个接口已经说明支持返回格式:json,xml, jsonp调用方法说明 | json |
| `sign` | 是 | String | 1.使用Md5方式验证，参数按一定规则md5后返回的字符串，详情点击这里阅读 2.使用Hash验证方式，直接跟上密钥即可。如何设置hash验证 通过我的应用里面修改验证方式 | 52a9dbe274a5c537bbf7a53e2d66c09f |
| `time` | 否 | String | 请求时传递的当前服务器时间戳 | 1545829466 |

## 签名（MD5）

按参数名排序后拼接「键名+值」，空值不参与；末尾直接追加 32 位密钥（密钥不写键名）：

```
sign = MD5(appid1formatjsontime1545829466{secret})
```

说明：示例中 `appid` 默认为 `1`，请替换为「我的应用」中的 appid；密钥为应用 Secret。

## 返回参数

| 名称 | 必填 | 类型 | 说明 | 示例 |
| --- | --- | --- | --- | --- |
| `astrodate` | 否 | String | 此月份日期出生的人所属星座 | 2-19~3-20 |
| `astroid` | 是 | Intger | 星座id,在调用查询运势的时候会用到 | 12 |
| `astroname` | 否 | String | 星座名称 | 双鱼座 |
| `astropic` | 否 | String | 星座图标地址 |  |
| `codeid` | 否 | Integer | 状态码，返回10000状态都会进行计费。具体说明可查看状态码说明 | 10000 |
| `message` | 否 | String | 请求状态说明 | 返回成功 |
| `retdata` | 否 | Array | 回数据集合,可能是数据、对象或者字符串 |  |
| `time` | 否 | String | 请求时传递的当前服务器时间戳 | 1564736603 |

## JSON 返回示例

```json
{
    "codeid": "10000",
    "message": "返回成功",
    "retdata": [
        {
            "astroid": 1,
            "astroname": "白羊座",
            "astrodate": "3-21~4-19",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/1.png"
        },
        {
            "astroid": 2,
            "astroname": "金牛座",
            "astrodate": "4-20~5-20",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/2.png"
        },
        {
            "astroid": 3,
            "astroname": "双子座",
            "astrodate": "5-21~6-21",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/3.png"
        },
        {
            "astroid": 4,
            "astroname": "巨蟹座",
            "astrodate": "6-22~7-22",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/4.png"
        },
        {
            "astroid": 5,
            "astroname": "狮子座",
            "astrodate": "7-23~8-22",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/5.png"
        },
        {
            "astroid": 6,
            "astroname": "处女座",
            "astrodate": "8-23~9-22",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/6.png"
        },
        {
            "astroid": 7,
            "astroname": "天秤座",
            "astrodate": "9-23~10-23",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/7.png"
        },
        {
            "astroid": 8,
            "astroname": "天蝎座",
            "astrodate": "10-24~11-22",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/8.png"
        },
        {
            "astroid": 9,
            "astroname": "射手座",
            "astrodate": "11-23~12-21",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/9.png"
        },
        {
            "astroid": 10,
            "astroname": "摩羯座",
            "astrodate": "12-22~1-19",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/10.png"
        },
        {
            "astroid": 11,
            "astroname": "水瓶座",
            "astrodate": "1-20~2-18",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/11.png"
        },
        {
            "astroid": 12,
            "astroname": "双鱼座",
            "astrodate": "2-19~3-20",
            "astropic": "https:\/\/cdn.storeapi.net\/data\/astro\/12.png"
        }
    ],
    "time": 1564736603
}
```

## 状态码说明

| 状态码 | 说明 |
| --- | --- |
| `10000` | 返回成功 |
| `10001` | appid必须指定，可以我的应用里面查看 |
| `10002` | sign值必须指定，加密规则请前往帮助中心查看 |
| `10003` | sign值验证不通过，加密规则请前往帮助中心查看 |
| `10004` | 时差不能超过10分钟，可以不传递这个参数，注意时间戳单位是秒 |
| `10005` | appid错误，请检查appid值,前往会员中心->我的应用查看或添加 |
| `10006` | 当前IP地址未授权，请前往用户中心->我的应用添加ip{@info} |
| `10007` | 应用被禁用，请联系客服处理 |
| `10008` | 应用内没有该接口，请到我的应用里面添加这个接口 |
| `10009` | api接口不存在 |
| `10010` | 您没有添加该api接口 |
| `10011` | api已经到期 |
| `10012` | 没有订购任何api,请前往购买后再操作 |
| `10013` | 该接口已经暂停使用 |
| `10014` | 未知的错误，可以联系客服处理 |
| `10015` | 参数个数错误 |
| `10019` | {@info} |
| `10017` | time必须是整型 |
| `10018` | 次数不足 |
| `10020` | 子接口不存在,可能已经被关闭 |
| `10021` | 服务器发生错误 |
| `10022` | 帐户余额不足，请充值！ |
| `10023` | 订单提交成功，等待回调结果 |
| `10024` | 调试模式数据 |
| `10025` | 查无数据 |

## 对接提示

1. 先在挖数据（wapi.cn）创建应用，获取 `appid` 与密钥。
2. 按上方参数组装请求，计算 `sign` 后调用接口地址。
3. 可用在线测试工具：`https://www.wapi.cn/api_debug/73/184.html`
