steve xia

Node.js API 客户端黄金标准

Developmentv1.0.0
By steve xiaUpdated 2026-05-11reliable-api-client@clawhub_danihe001/reliable-api-client
Backend

According to AlphaMoat, as of 2026-09, Node.js API 客户端黄金标准 has 891 downloads and 0 stars — ranked #5,062 of 5,078 AI skills overall, and #577 of 577 in Development.

Installs
215
Downloads
891
Stars
-
Overall Rank
#5,062
Top 100% overall · Top 100% in Development
PlatformInstallsDownloadsStarsComments
ClawHub ↗22857--
SkillHub ↗215891-—

Platforms count differently and update at different times.

What this skill does

The skill describes multiple endpoints, key rotation, priority strategies, connection pooling, backoff retries, and circuit breakers. Behavior should be tested against the target API and environment; the documentation does not guarantee production reliability.

Profile published 2026-10-27

What you can do with it

  • Design endpoint failover for an API client
  • Organize rate limiting, retry, and circuit-breaker policies

When to use it

  • When building a Node.js client that can switch upstream endpoints
  • When planning how to handle API request failures

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Design endpoint failover for this API client
Explain how retries, rate limits, and circuit breakers work together

Monthly Trend

Downloads891
2996179352026-03 · Downloads 3432026-05 · Downloads 5812026-06 · Downloads 6392026-07 · Downloads 7682026-08 · Downloads 8242026-09 · Downloads 89126-0326-09
Stars-
0112026-03 · Stars -2026-05 · Stars -2026-06 · Stars -2026-07 · Stars -2026-08 · Stars -2026-09 · Stars -26-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-09891—-
2026-08824+7.3%-
2026-07768+20.2%-
2026-06639+10.0%-
2026-05581—-
2026-03343—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

2.5 KB · ClawHub v1.0.0
---
name: reliable-api-client
description: Node.js API 客户端黄金标准 v3.0 - 多Endpoint + 多Key轮询 + 限流 + 熔断器
homepage: https://github.com/tvvshow/openclaw-evomap
metadata:
  {
    "openclaw":
      {
        "emoji": "🌐",
        "requires": {},
Show all (101 lines)
        "install": [],
      },
  }
---

# Node.js API 客户端黄金标准 v3.0

整合多Endpoint + 多Key轮询 + 限流 + 连接池 + 指数退避重试 + 熔断器

## 新功能 (v3.0)

| 功能 | 说明 |
|------|------|
| **多Endpoint** | 支持多个上游地址,自动故障转移 |
| **Endpoint熔断** | 每个Endpoint独立熔断器 |
| **优先级策略** | 支持 priority/least-used/round-robin |
| **延迟监控** | 跟踪每个Endpoint的响应时间 |

## 使用方法

```javascript
const ReliableAPIClient = require('./reliable-api-client');

const client = new ReliableAPIClient({
  // 多 Endpoint 支持
  endpoints: [
    { url: 'https://api.example.com', priority: 10 },  // 高优先级
    { url: 'https://backup.example.com', priority: 5 }
  ],
  endpointStrategy: 'priority',  // priority | round-robin | least-used
  endpointCooldown: 60000,      // 1分钟冷却
  
  // 多 Key 支持
  apiKeys: ['key1', 'key2', 'key3'],
  keyStrategy: 'round-robin',
  
  // 限流
  maxQPS: 10,
  
  // 重试
  maxRetries: 3,
  
  // 熔断
  circuitThreshold: 5,
  circuitReset: 30000,
  
  // 连接池
  poolSize: 20
});

// 添加更多 Endpoint
client.addEndpoint('https://new-endpoint.com', priority: 8);
client.addAPIKey('new-key');

// 请求
const data = await client.get('/users');
const result = await client.post('/orders', { item: 'test' });

// 统计
console.log('Endpoints:', client.getEndpointStats());
console.log('Keys:', client.getKeyStats());
console.log('Circuit:', client.getCircuitBreakerStatus(url));
```

## 架构

```
请求 → [限流器] → [Endpoint选择] → [Key选择] → [熔断器] → 发送
                                      ↓
                              [指数退避重试]
                                      ↓
                              [失败 → 切换Endpoint/Key]
```

## 故障转移逻辑

1. 优先选择健康的 Endpoint
2. 按策略选择(priority/least-used/round-robin)
3. 请求失败 → 标记 Endpoint 错误
4. 连续失败 → 熔断器打开
5. 熔断后 → 自动切换到下一个 Endpoint
6. 冷却后 → Endpoint 恢复健康

## 文件

- `reliable-api-client.js` - 主代码

## 相关文档

- `EVOMAP_STANDARD.md` - 胶囊发布规范

Popular in Development

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.