JSON & APIs — REST, GraphQL, Webhooks & More
Design JSON APIs: REST best practices, GraphQL, webhooks, pagination, logging, and real-time.
TanStack Query: Caching JSON API Responses the Right Way
TanStack Query (React Query) turns fetch-and-store boilerplate into a managed cache. Query keys, staleTime vs gcTime, background refetching, and invalidation explained.
tRPC vs REST vs GraphQL: End-to-End Type Safety for JSON APIs
tRPC gives a TypeScript client and server one shared type with no schema or codegen. How it works, how it still ships JSON over HTTP, and when REST or GraphQL is the better call.
JSON-RPC 2.0 Explained: The Protocol Behind MCP and the Blockchain
JSON-RPC 2.0 is a tiny, transport-agnostic remote-call protocol — request, response, error, batch, and notifications. Why it powers MCP, Ethereum, and Language Server Protocol.
OpenAPI 3.1 vs 3.0: What Changed and How to Migrate
OpenAPI 3.1 finally aligns with JSON Schema 2020-12. The nullable change, type arrays, webhooks, unified examples, and a practical 3.0 to 3.1 migration checklist.
Problem Details for HTTP APIs: The RFC 9457 JSON Error Format
Stop inventing a new error shape for every API. RFC 9457 (application/problem+json) is the standard JSON error format — the five base fields, extensions, and how to adopt it.
HTTP Methods and JSON: GET, POST, PUT, PATCH, DELETE, QUERY Explained
How each HTTP method uses JSON in practice — request bodies, idempotency, PUT vs PATCH, the new QUERY method, and real request/response examples for a REST API.
JSON:API: A Standard Format for REST Responses
JSON:API is a specification for how to shape REST responses — resources, relationships, includes, and errors. Learn the format and when it's worth adopting.
Server-Sent Events (SSE): Streaming JSON to the Browser
SSE is the simplest way to stream JSON from server to browser over plain HTTP — the backbone of streaming AI responses. Learn the format, code, and when to use it.
Rate Limiting APIs: 429, Retry-After & JSON Errors
Rate limiting protects your API and shapes the client experience. Learn the 429 status, Retry-After, rate-limit headers, and how to design clear JSON errors.
Designing Multi-Tenant JSON API Responses — Scoping, Isolation, and Tenant IDs
How SaaS APIs structure JSON responses so one tenant's data never leaks into another's — where the tenant ID lives, how it's enforced, and the response-shape mistakes that cause cross-tenant leaks.
API Versioning Strategies for JSON APIs — URL, Header, and Date-Based
Three real ways to version a JSON API — URL path, a custom header, and Stripe-style date-based versioning — with the tradeoffs that actually matter once you have existing clients to not break.
Content Negotiation for JSON APIs — The Accept Header, Explained
Why an API checks the Accept header before responding, what application/json vs a vendor media type like application/vnd.github+json actually signals, and where this silently breaks.
OpenAPI and JSON Schema: Documenting REST APIs the Right Way
How OpenAPI uses JSON Schema to describe request and response bodies — and how to write specs that power docs, validation, and client generation.
GraphQL vs REST: A JSON Payload Comparison
Both REST and GraphQL speak JSON — but shape it very differently. Compare payloads, over-fetching, errors, and when to choose each.
Structured JSON Logging: Best Practices
Plain-text logs do not scale. Learn how structured JSON logging makes your logs searchable, queryable, and ready for modern observability tools.
Designing Webhook JSON Payloads (with Examples)
Webhooks notify other systems in real time using JSON. Learn how to design payloads that are versioned, verifiable, and easy to consume.
Pagination Patterns for JSON APIs: Offset, Cursor & More
Returning thousands of records in one JSON response is a mistake. Compare offset, cursor, and keyset pagination with real payload examples.
Real-Time Apps with WebSockets and JSON
WebSockets keep a connection open for instant two-way messaging. Learn how to design clean JSON message protocols for chat, dashboards, and games.
Idempotency in JSON APIs: Safe Retries Explained
Networks fail and clients retry. Learn how idempotency keys let JSON APIs handle duplicate requests safely — without double-charging or double-creating.
ETag & Conditional Requests: Caching JSON APIs Efficiently
How ETag headers and conditional requests let JSON APIs skip re-sending unchanged data — 304 Not Modified, weak vs strong validators, and optimistic concurrency with If-Match.
HTTP Status Codes Explained — Complete Reference for REST APIs
Understand every HTTP status code: 2xx success, 3xx redirect, 4xx client errors, 5xx server errors. Best practices for REST API design.
JSON API Best Practices: Design Clean API Responses
10 best practices for JSON API design: consistent naming, envelope responses, ISO dates, pagination, error formats, versioning, and minification.