# 使用方法

#### 1. 1接口地址

`https://api.8i5.net/hot/v2/pc-online.php`

#### 1.2 接口描述

该接口用于获取AI软件热度排行榜数据，返回数据包含软件排名、名称、LOGO、简介、热度值、所属公司、适用场景等核心信息，数据实时更新，可直接用于应用开发、数据展示等场景。

#### 1.3 请求方式

`GET`

### 2. 请求参数

该接口无需传入额外请求参数，直接发起GET请求即可返回完整排行榜数据。

### 3. 返回数据说明

#### 3.1 数据格式

返回格式为`JSON`，编码为`UTF-8`，数据结构分为根节点和数据列表节点两层，字段命名规范、易解析。

#### 3.2 根节点参数说明

| 参数名       | 类型     | 是否必返 | 说明                            |
| --------- | ------ | ---- | ----------------------------- |
| date      | string | 是    | 接口响应时间，格式：YYYY-MM-DD HH:MM:SS |
| platform  | string | 是    | 接口标识，固定值：8i5.net              |
| category  | string | 是    | 数据分类，固定值：AI软件排行榜              |
| api\_time | string | 否    | 数据更新时间（与排行榜数据同步更新）            |
| data      | array  | 是    | AI软件排行榜数据列表（错误时为错误对象）         |

#### 3.3 data列表项参数说明（正常返回时）

| 参数名          | 类型      | 是否必返 | 说明                        |
| ------------ | ------- | ---- | ------------------------- |
| id           | string  | 是    | 软件唯一标识ID                  |
| rank         | int     | 是    | 软件当前热度排名（数值越小排名越靠前）       |
| name         | string  | 是    | 软件名称                      |
| logo         | string  | 是    | 软件LOGO图片URL（可直接用于前端展示）    |
| short\_desc  | string  | 是    | 软件简短介绍（100字以内，便于快速了解）     |
| description  | string  | 是    | 软件详细描述（包含核心功能、特点等）        |
| scene\_list  | array   | 是    | 软件适用场景标签列表（如：文字办公、图像处理等）  |
| hot\_degree  | float   | 是    | 软件热度值（数值越高表示热度越高）         |
| growth\_rate | float   | 是    | 热度增长率（负数=热度下降，正数=热度上升）    |
| company      | string  | 是    | 软件所属公司/开发团队名称             |
| last\_rank   | int     | 是    | 上一期排名（用于对比排名变化）           |
| highlight    | boolean | 是    | 是否为推荐软件（true=推荐，false=普通） |

#### 3.4 data错误对象参数说明（异常返回时）

| 参数名   | 类型     | 是否必返 | 说明               |
| ----- | ------ | ---- | ---------------- |
| error | string | 是    | 错误详细描述信息（便于问题排查） |

### 4. 返回示例

#### 4.1 正常返回示例

```json
{
    "date": "2025-12-21 23:50:00",
    "platform": "8i5.net",
    "category": "AI软件排行榜",
    "api_time": "2025-12-21 22:56:19",
    "data": [
        {
            "id": "1",
            "rank": 1,
            "name": "豆包",
            "logo": "https://img.pconline.com.cn/images/upload/upc/tx/pcncc/2510/22/c1/564707057_1761128523274.png",
            "short_desc": "一款专业性强的智能助手，能在知识问答、内容创作等多个方面为用户提供帮助。",
            "description": "豆包是字节跳动推出的AI智能助手，集成了大模型技术，提供语音交互、信息查询、旅游出行、英语学习及情感交流等服务。豆包还推出了面向开发者的工具豆包MarsCode，提升编程效率。",
            "scene_list": [
                "文字办公",
                "图像处理",
                "学习教育",
                "聊天机器人",
                "文字写作",
                "效率提升",
                "创意生图",
                "一键抠图",
                "图片扩展",
                "角色扮演"
            ],
            "hot_degree": 14475.00,
            "growth_rate": -0.0066,
            "company": "字节跳动",
            "last_rank": 1,
            "highlight": false
        },
        {
            "id": "74",
            "rank": 2,
            "name": "DeepSeek",
            "logo": "https://img.pconline.com.cn/images/upload/upc/tx/pcncc/2506/27/c2/530621860_1751012031786.png",
            "short_desc": "一款功能强大的聊天AI助手，能够提供智能对话服务。",
            "description": "DeepSeek 是一款强大的聊天 AI 助手，能够提供智能对话服务。它具有自然语言理解和生成的能力，能够回答问题、提供建议和进行闲聊。DeepSeek 的主要功能包括语义分析、情感识别、知识图谱等。无论是提供技术支持，还是陪伴聊天，DeepSeek 都能为用户提供个性化的服务。",
            "scene_list": [
                "文字办公",
                "文字写作",
                "效率提升"
            ],
            "hot_degree": 13906.00,
            "growth_rate": -0.0043,
            "company": "深度求索",
            "last_rank": 2,
            "highlight": false
        }
    ]
}
```

#### 4.2 异常返回示例（如请求失败）

```json
{
    "date": "2025-12-21 23:55:00",
    "platform": "8i5.net",
    "category": "AI软件排行榜",
    "api_time": "",
    "data": {
        "error": "接口访问失败，请检查网络连接或稍后重试"
    }
}
```

### 5. 错误码说明

| 错误描述                   | 可能原因            | 解决方案                 |
| ---------------------- | --------------- | -------------------- |
| 接口访问失败，请检查网络连接或稍后重试    | 服务器网络异常/接口暂时不可用 | 检查网络状态，1-5分钟后重试      |
| HTTP请求失败，状态码: 403      | 请求头不合法/访问权限限制   | 使用标准浏览器请求头，避免频繁请求    |
| JSON解析失败: Syntax error | 数据传输过程中出现异常     | 重新发起请求，若多次失败联系接口维护人员 |
| 未抓取到排行榜数据，接口返回数据为空     | 数据更新中/暂无有效排行数据  | 稍后重试，一般数据更新周期不超过10分钟 |
| HTTP请求失败，状态码: 500      | 服务器内部处理异常       | 记录请求时间和场景，联系接口维护人员   |

### 6. 调用示例

#### 6.1 curl调用示例

```bash
curl -X GET "https://api.8i5.net/hot/v2/pc-online.php"
```

#### 6.2 JavaScript调用示例（Fetch）

```javascript
// 前端跨域调用示例
fetch('https://api.8i5.net/hot/v2/pc-online.php')
  .then(response => {
    if (!response.ok) throw new Error('请求失败');
    return response.json();
  })
  .then(data => {
    console.log('AI软件排行榜数据：', data);
    // 后续处理：渲染页面、数据筛选等
  })
  .catch(error => {
    console.error('接口调用失败：', error.message);
  });
```

#### 6.3 Python调用示例（requests）

```python
import requests

api_url = 'https://api.8i5.net/hot/v2/pc-online.php'
try:
    # 发起GET请求
    response = requests.get(api_url, timeout=30)
    response.raise_for_status()  # 抛出HTTP错误
    result = response.json()
    
    # 打印结果
    print(f"接口响应时间：{result['date']}")
    print(f"排行榜数据总数：{len(result['data'])}")
    for item in result['data'][:5]:  # 打印前5条数据
        print(f"排名{item['rank']}：{item['name']}（热度：{item['hot_degree']}）")
except requests.exceptions.RequestException as e:
    print(f"调用失败：{str(e)}")
```

### 7. 注意事项

1. 接口请求频率限制：建议控制在1次/分钟以内，避免频繁请求影响服务稳定性；
2. 数据使用规范：返回的软件LOGO、描述等信息仅可用于非商业场景展示，请勿擅自用于商业用途或篡改数据；
3. 缓存建议：生产环境使用时，建议增加本地缓存机制（如Redis缓存5-10分钟），减少接口调用次数，提升响应速度；
4. 兼容性处理：部分字段（如api\_time）可能为空，建议前端调用时增加字段判空处理，避免渲染异常；
5. 问题反馈：若长期出现调用失败或数据异常，可记录请求时间、错误信息等，联系接口提供方进行排查。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-doc.8i5.net/ai-pai-xing-bang/shi-yong-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
