Welcome to Playground API
Playground API is an open-source, instant mock REST & GraphQL API service built for developers, frontend engineers, QA suites, and AI model agents who need realistic data without managing backends or databases.
Why Playground API?
Traditional mock APIs like JSONPlaceholder echo dummy responses on POST/PUT/DELETE requests but do not persist changes. When you refresh your frontend app or fetch a list, created items disappear.
Playground API solves this completely. Using per-session virtual overlays, your mutations (creates, edits, deletes) persist across requests for your session identity while global seed datasets remain read-only for all other visitors.
Base API v1 Endpoint
All endpoints are scoped under version 1 (/api/v1/...). This guarantees future updates (e.g. /api/v2/) will maintain full backwards compatibility for your applications.
Core Architectural Pillars
Sessions are authenticated via signed pg_identity cookies or X-Playground-Identity headers. Forged tokens automatically fall back to IP auto-recovery.
Global tables (posts_global, etc.) are read-only. Your mutations are stored in overlay_records and merged into virtual lists at query time.
Whether you fetch via REST endpoints (/api/v1/posts) or GraphQL (/api/v1/graphql), both share the exact same overlay engine.
Header flags like X-Simulate-Delay: 2000 and X-Simulate-Status: 500 let you test UI loading spinners and error handling cleanly.
Step-by-Step Implementation Guide
- Target base URL: Configure your frontend HTTP client (Fetch, Axios, TanStack Query) to use
/api/v1. - Perform standard CRUD operations: Issue GET, POST, PUT, PATCH, DELETE requests against resource endpoints.
- Inspect identity token: Check the
Sandbox Activepill in the site header to copy or reset your session identity token. - Download workspace collections: Import OpenAPI or Postman collections into your API client for team testing.