Claude Code Plugins

Community-maintained marketplace

Feedback
0
0

Template for creating API integration skills. Copy and customize for your specific API.

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name api-client-template
description Template for creating API integration skills. Copy and customize for your specific API.

API Client Template

Authentication

  • Base URL: https://api.example.com/v1
  • Auth: [Basic Auth / Bearer Token / API Key]
  • Header: Authorization: [Basic/Bearer] {TOKEN}
  • Environment variable: EXAMPLE_API_TOKEN

Endpoints

Endpoint Method Description
/resources GET List resources
/resources/{id} GET Get specific resource
/resources POST Create resource
/resources/{id} PUT Update resource
/resources/{id} DELETE Delete resource

Pagination

  • limit - Max items per request (typically 100)
  • offset or cursor - Position in result set

Python Client

import os
import requests
from typing import Dict, Optional, List

class ExampleClient:
    def __init__(self):
        self.base_url = "https://api.example.com/v1"
        token = os.getenv("EXAMPLE_API_TOKEN")
        if not token:
            raise ValueError("EXAMPLE_API_TOKEN environment variable required")
        self.headers = {
            "Authorization": f"Bearer {token}",
            "Content-Type": "application/json"
        }

    def _request(
        self,
        method: str,
        endpoint: str,
        params: Optional[Dict] = None,
        json: Optional[Dict] = None
    ) -> Dict:
        url = f"{self.base_url}{endpoint}"
        response = requests.request(
            method, url,
            headers=self.headers,
            params=params,
            json=json,
            timeout=30
        )
        response.raise_for_status()
        if response.status_code == 204:
            return {}
        return response.json()

    def list_resources(self, limit: int = 100) -> List[Dict]:
        """Paginate through all resources."""
        resources = []
        cursor = None
        while True:
            params = {"limit": limit}
            if cursor:
                params["cursor"] = cursor
            data = self._request("GET", "/resources", params=params)
            resources.extend(data.get("results", []))
            cursor = data.get("next_cursor")
            if not cursor:
                break
        return resources

    def get_resource(self, resource_id: str) -> Dict:
        return self._request("GET", f"/resources/{resource_id}")

    def create_resource(self, payload: Dict) -> Dict:
        return self._request("POST", "/resources", json=payload)

Error Handling

  • 401 - Unauthorized (check token)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Resource not found
  • 429 - Rate limited (check retry-after header)

Environment Variables

export EXAMPLE_API_TOKEN=your-token-here