api-integrator
Integrate external REST and GraphQL APIs with proper authentication (Bearer, Basic, OAuth), error handling, retry logic, and JSON schema validation. Use when making API calls, database queries, or integrating external services like Stripe, Twilio, AWS. Achieves 10-30x cost savings through direct execution vs LLM-based calls. Triggers on "API call", "REST API", "GraphQL", "external service", "API integration", "HTTP request".
Best use case
api-integrator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Integrate external REST and GraphQL APIs with proper authentication (Bearer, Basic, OAuth), error handling, retry logic, and JSON schema validation. Use when making API calls, database queries, or integrating external services like Stripe, Twilio, AWS. Achieves 10-30x cost savings through direct execution vs LLM-based calls. Triggers on "API call", "REST API", "GraphQL", "external service", "API integration", "HTTP request".
Teams using api-integrator should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/api-integrator/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How api-integrator Compares
| Feature / Agent | api-integrator | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Integrate external REST and GraphQL APIs with proper authentication (Bearer, Basic, OAuth), error handling, retry logic, and JSON schema validation. Use when making API calls, database queries, or integrating external services like Stripe, Twilio, AWS. Achieves 10-30x cost savings through direct execution vs LLM-based calls. Triggers on "API call", "REST API", "GraphQL", "external service", "API integration", "HTTP request".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# API Integrator
## Purpose
Robust patterns for integrating external APIs and databases with authentication, error handling, retry logic, and response validation.
## When to Use
- Making REST or GraphQL API calls
- Querying databases
- Integrating external services (Stripe, Twilio, AWS, etc.)
- Need robust error handling and retry logic
- Require response schema validation
- Bulk API operations
## Core Instructions
### REST API Pattern
```python
import requests
from tenacity import retry, stop_after_attempt, wait_exponential
@retry(
stop=stop_after_attempt(3),
wait=wait_exponential(multiplier=1, min=1, max=10)
)
def call_api(endpoint, method="GET", headers=None, data=None):
"""
Make API call with retries
"""
if not headers:
headers = {}
# Auto-add auth from environment
if os.getenv('API_TOKEN'):
headers["Authorization"] = f"Bearer {os.getenv('API_TOKEN')}"
response = requests.request(
method=method,
url=endpoint,
headers=headers,
json=data,
timeout=30
)
response.raise_for_status()
return response.json()
```
### Error Handling Strategy
- **2xx Success**: Return data
- **4xx Client Error**: Log and raise (no retry - client's fault)
- **5xx Server Error**: Retry with exponential backoff
- **Timeout**: Retry up to 3 times
- **Network Error**: Retry with backoff
### Authentication Methods
**Bearer Token:**
```python
headers = {"Authorization": f"Bearer {token}"}
```
**Basic Auth:**
```python
from requests.auth import HTTPBasicAuth
auth = HTTPBasicAuth('username', 'password')
response = requests.get(url, auth=auth)
```
**OAuth 2.0:**
```python
from requests_oauthlib import OAuth2Session
oauth = OAuth2Session(client_id, token=token)
response = oauth.get(url)
```
### GraphQL Pattern
```python
def call_graphql(endpoint, query, variables=None):
"""
Execute GraphQL query
"""
payload = {
'query': query,
'variables': variables or {}
}
return call_api(endpoint, method='POST', data=payload)
```
### Response Validation
```python
from pydantic import BaseModel, ValidationError
class APIResponse(BaseModel):
id: int
name: str
email: str
def validate_response(data):
try:
return APIResponse(**data)
except ValidationError as e:
# Handle validation errors
log_error(e)
raise
```
## Integration Examples
### Example 1: GitHub API
```python
# Get user info
response = call_api('https://api.github.com/users/github')
print(f"GitHub created: {response['created_at']}")
```
### Example 2: Stripe Payment
```python
import stripe
stripe.api_key = os.getenv('STRIPE_KEY')
# Create payment intent
intent = stripe.PaymentIntent.create(
amount=1000,
currency='usd'
)
```
### Example 3: Database Query (PostgreSQL)
```python
import psycopg2
conn = psycopg2.connect(
host=os.getenv('DB_HOST'),
database=os.getenv('DB_NAME'),
user=os.getenv('DB_USER'),
password=os.getenv('DB_PASSWORD')
)
cursor = conn.cursor()
cursor.execute("SELECT * FROM users WHERE active = true")
results = cursor.fetchall()
```
## Best Practices
1. **Use Environment Variables**: Store credentials in `.env`, never hardcode
2. **Implement Retries**: Use `tenacity` for automatic retry with backoff
3. **Validate Responses**: Use Pydantic or JSON Schema
4. **Handle Rate Limits**: Respect API rate limits, implement backoff
5. **Log Requests**: Log all API calls for debugging
6. **Timeout Properly**: Always set request timeouts (default: 30s)
## Performance
- **10-30x cost reduction** vs calling LLM for each API operation
- **< 100ms overhead** for request/retry logic
- **95%+ success rate** with proper retry strategy
## Dependencies
- Python 3.8+
- `requests` - HTTP library
- `tenacity` - Retry logic
- `pydantic` - Response validation (optional)
- `requests-oauthlib` - OAuth support (optional)
## Version
v1.0.0 (2025-10-23)Related Skills
beads-integrator
Merge Beads task branches into main/master safely (serialized), verify, push to remote, record merge SHAs back into tasks, and clean worktrees. Use when merging branches, integrating code to base branch, or finalizing reviewed task branches.
agent-integrator
Use this skill to create or update the root AGENTS.md file to register AgenticDev skills for AI agent discovery. Triggers include "register AgenticDev", "update AGENTS.md", "setup agent guide", or initializing a new project.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
obsidian-daily
Manage Obsidian Daily Notes via obsidian-cli. Create and open daily notes, append entries (journals, logs, tasks, links), read past notes by date, and search vault content. Handles relative dates like "yesterday", "last Friday", "3 days ago".
obsidian-additions
Create supplementary materials attached to existing notes: experiments, meetings, reports, logs, conspectuses, practice sessions, annotations, AI outputs, links collections. Two-step process: (1) create aggregator space, (2) create concrete addition in base/additions/. INVOKE when user wants to attach any supplementary material to an existing note. Triggers: "addition", "create addition", "experiment", "meeting notes", "report", "conspectus", "log", "practice", "annotations", "links", "link collection", "аддишн", "конспект", "встреча", "отчёт", "эксперимент", "практика", "аннотации", "ссылки", "добавь к заметке".
observe
Query and manage Observe using the Observe CLI. Use when the user wants to run OPAL queries, list datasets, manage objects, or interact with their Observe tenant from the command line.
observability-review
AI agent that analyzes operational signals (metrics, logs, traces, alerts, SLO/SLI reports) from observability platforms (Prometheus, Datadog, New Relic, CloudWatch, Grafana, Elastic) and produces practical, risk-aware triage and recommendations. Use when reviewing system health, investigating performance issues, analyzing monitoring data, evaluating service reliability, or providing SRE analysis of operational metrics. Distinguishes between critical issues requiring action, items needing investigation, and informational observations requiring no action.
nvidia-nim
NVIDIA NIM inference microservices for deploying AI models with OpenAI-compatible APIs, self-hosted or cloud
numpy-string-ops
Vectorized string manipulation using the char module and modern string alternatives, including cleaning and search operations. Triggers: string operations, numpy.char, text cleaning, substring search.
nova-act-usability
AI-orchestrated usability testing using Amazon Nova Act. The agent generates personas, runs tests to collect raw data, interprets responses to determine goal achievement, and generates HTML reports. Tests real user workflows (booking, checkout, posting) with safety guardrails. Use when asked to "test website usability", "run usability test", "generate usability report", "evaluate user experience", "test checkout flow", "test booking process", or "analyze website UX".
notebook-writer
Create and document Jupyter notebooks for reproducible analyses
nomistakes
Error prevention and best practices enforcement for agent-assisted coding. Use when writing code to catch common mistakes, enforce patterns, prevent bugs, validate inputs, handle errors, follow coding standards, avoid anti-patterns, and ensure code quality through proactive checks and guardrails.