Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Api Client Skill

ASecurity

REST API client builder with authentication, error handling, retry logic, and request management. Supports OAuth, JWT, API keys. Use when building API integrations, creating API clients, or working with REST services.

3 stars
0 votes
0 copies
0 views
Added 2/8/2026
developmentjavascriptpythongojavabashtestingapi

Works with

cliapi

Security Analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned 2/12/2026

$npx -y skills add adaptationio/Skrillz --skill api-client-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Client Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Api Client Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adaptationio-api-client-skill/badge)](https://www.skillsdirectory.com/skills/adaptationio-api-client-skill)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: api-client
description: REST API client builder with authentication, error handling, retry logic, and request management. Supports OAuth, JWT, API keys. Use when building API integrations, creating API clients, or working with REST services.
---

# API Client Builder

## Overview

Build robust REST API clients with authentication, comprehensive error handling, automatic retries, and request/response management.

## Quick Start

### Basic API Client

```javascript
const client = new APIClient({
  baseURL: 'https://api.example.com',
  apiKey: process.env.API_KEY
});

const response = await client.get('/users');
console.log(response.data);
```

## Features

- ✓ Multiple authentication methods (API key, OAuth, JWT)
- ✓ Automatic retry with exponential backoff
- ✓ Request/response logging
- ✓ Error classification and handling
- ✓ Rate limiting support
- ✓ Request timeout configuration

## Workflow

### Step 1: Configure Client

Create client with base configuration:

```javascript
const client = new APIClient({
  baseURL: 'https://api.example.com',
  timeout: 5000,
  retries: 3
});
```

### Step 2: Add Authentication

See [references/authentication-guide.md](references/authentication-guide.md) for all methods.

**API Key**:
```javascript
client.setAuth({
  type: 'apiKey',
  key: process.env.API_KEY
});
```

**OAuth 2.0**:
```javascript
client.setAuth({
  type: 'oauth',
  clientId: process.env.CLIENT_ID,
  clientSecret: process.env.CLIENT_SECRET
});
```

### Step 3: Make Requests

```javascript
// GET request
const users = await client.get('/users');

// POST request
const newUser = await client.post('/users', {
  name: 'John Doe',
  email: 'john@example.com'
});

// PUT request
const updated = await client.put('/users/123', {
  name: 'Jane Doe'
});

// DELETE request
await client.delete('/users/123');
```

### Step 4: Handle Errors

```javascript
try {
  const response = await client.get('/users');
  console.log(response.data);
} catch (error) {
  if (error.status === 401) {
    console.error('Authentication failed');
  } else if (error.status === 429) {
    console.error('Rate limit exceeded');
  } else {
    console.error('Request failed:', error.message);
  }
}
```

## Configuration

### Complete Configuration Options

```javascript
const client = new APIClient({
  // Base configuration
  baseURL: 'https://api.example.com',
  timeout: 5000,                  // Request timeout (ms)

  // Retry configuration
  retries: 3,                     // Number of retries
  retryDelay: 1000,               // Initial retry delay (ms)
  retryMult iplier: 2,              // Exponential backoff multiplier

  // Authentication (see references/authentication-guide.md)
  auth: {
    type: 'apiKey',
    key: process.env.API_KEY
  },

  // Headers
  headers: {
    'Content-Type': 'application/json',
    'Custom-Header': 'value'
  },

  // Logging
  logging: true,                  // Enable request/response logging
  logLevel: 'info'               // debug, info, warn, error
});
```

See [templates/api-config-template.json](templates/api-config-template.json) for complete configuration template.

## Authentication Methods

### Method 1: API Key

```javascript
client.setAuth({
  type: 'apiKey',
  key: process.env.API_KEY,
  header: 'X-API-Key'  // Optional, default: 'Authorization'
});
```

### Method 2: OAuth 2.0

See [references/authentication-guide.md#oauth](references/authentication-guide.md#oauth) for complete OAuth flow.

### Method 3: JWT

See [references/authentication-guide.md#jwt](references/authentication-guide.md#jwt) for JWT implementation.

## Error Handling

### Error Classification

Errors are classified into categories for appropriate handling:

| Status Code | Category | Retry? | Action |
|-------------|----------|--------|--------|
| 400 | Client Error | No | Fix request |
| 401 | Auth Error | No | Refresh token |
| 403 | Permission | No | Check permissions |
| 404 | Not Found | No | Check endpoint |
| 429 | Rate Limit | Yes | Wait and retry |
| 500 | Server Error | Yes | Retry |
| 503 | Unavailable | Yes | Retry |

See [references/error-handling.md](references/error-handling.md) for complete error handling strategies.

## Validation

Validate API configuration before using:

```bash
python scripts/validate-config.py config.json
```

## Templates

Copy templates from `templates/` directory:
- `api-config-template.json` - Complete configuration
- `error-handler-template.js` - Error handling code
- `retry-logic-template.js` - Retry implementation

## References

- [Authentication Guide](references/authentication-guide.md) - All auth methods
- [Error Handling](references/error-handling.md) - Comprehensive error strategies
- [Rate Limiting](references/rate-limiting.md) - Handle rate limits
- [Testing](references/testing-apis.md) - Test API clients

---

**Version**: 1.0
**Last Updated**: October 25, 2025
**Example Type**: Complex skill (full structure)

Attribution

adaptationioadaptationio
View sourceSee grades on GitHubMore from adaptationio →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Clean Code

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

304955 votes

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

286712 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2222 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Writing Plans

Use when you have a spec or requirements for a multi-step task, before touching code

2927051 votes
View all in development →