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".

16 stars

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

$curl -o ~/.claude/skills/api-integrator/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/api-integrator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/api-integrator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How api-integrator Compares

Feature / Agentapi-integratorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

10
from diegosouzapw/awesome-omni-skill

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.

Coding & Development

obsidian-daily

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

NVIDIA NIM inference microservices for deploying AI models with OpenAI-compatible APIs, self-hosted or cloud

numpy-string-ops

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

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

16
from diegosouzapw/awesome-omni-skill

Create and document Jupyter notebooks for reproducible analyses

nomistakes

16
from diegosouzapw/awesome-omni-skill

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.