implementing-api-patterns

Design and implement REST, GraphQL, gRPC, and tRPC APIs across Python, TypeScript, Rust, and Go.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/masermediagroup-stack/maser-media --skill implementing-api-patterns-masermediagroup-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: implementing-api-patterns
Source: https://github.com/masermediagroup-stack/maser-media/tree/main/.cursor/skills/community/ai-design-components/skills/implementing-api-patterns
Command: npx skills add https://github.com/masermediagroup-stack/maser-media --skill implementing-api-patterns-masermediagroup-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires aiohttp, pyyaml, fastapi, and includes scripts (resource) and references (resource) components.

What problem does it solve? Choosing the right API pattern and framework is difficult when building backend services, and teams often struggle with pagination, rate limiting, caching, and OpenAPI documentation across different languages and paradigms. ## Core Features & Use Cases - Framework Selection Guidance: Decision frameworks for choosing between REST (FastAPI, Hono, Axum, Gin), GraphQL (Strawberry, Pothos, async-graphql, gqlgen), gRPC (Tonic, Connect-Go), and tRPC based on API consumers and performance needs. - Production Patterns: Cursor-based pagination, rate limiting, caching strategies, API versioning, and automatic OpenAPI documentation generation. - Validation & Benchmarking Scripts: Token-free utilities to generate OpenAPI specs, validate OpenAPI 3.1 compliance, and load test endpoints with latency percentiles. - Use Case: When building a public API for a mobile app, use the decision framework to select FastAPI, implement cursor pagination for the feed endpoint, and auto-generate Swagger docs at /docs. ## Quick Start Ask the agent to design a REST API with FastAPI including cursor-based pagination and automatic OpenAPI documentation for your data models.

Frequently Asked Questions about implementing-api-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose between REST, GraphQL, gRPC, and tRPC for my API?▼

Choose REST for public third-party APIs, GraphQL when frontends need flexible queries or mobile bandwidth is constrained, gRPC for high-performance service-to-service communication, and tRPC for TypeScript full-stack projects needing end-to-end type safety.

What is the difference between cursor-based and offset pagination?▼

Cursor-based pagination scales to billions of records without skipped or duplicate rows and handles real-time data changes. Offset pagination is simpler and supports direct page access but should only be used for small, static datasets under 10k records.

Which API framework is fastest: FastAPI, Hono, Axum, or Gin?▼

Axum (Rust) leads at roughly 140k requests per second with sub-millisecond latency, followed by Gin (Go) at 100k+, Hono (TypeScript) at 50k with under 5ms cold starts for edge deployment, and FastAPI (Python) at 40k with the best developer experience.

Does FastAPI generate OpenAPI documentation automatically?▼

Yes, FastAPI generates OpenAPI specs automatically from Python type hints with zero configuration. Interactive Swagger UI is available at /docs, ReDoc at /redoc, and the raw spec at /openapi.json.

How do I prevent N+1 queries in GraphQL?▼

Use the DataLoader pattern to batch and cache resolver requests into single database queries. DataLoader groups related fetches by key, so querying a list of users with their posts requires only two queries instead of one per user.

When should I avoid using gRPC?▼

Avoid gRPC for browser clients due to limited native support, simple CRUD APIs where REST is simpler, and public APIs where human-readable debugging matters. Use Connect-Go when browser compatibility with gRPC semantics is required.