The stateful JSONPlaceholder alternative — where
POSTmutations actually persist.
Build realistic frontend applications without configuring, deploying, or maintaining a backend. Playground API provides stateful REST and GraphQL APIs with per-session persistent mutations, relational filtering, pagination, sorting, fake JWT authentication, network latency and error simulation — all with zero setup.
🚀 Try Live Sandbox • 📚 Documentation • 🎨 API Studio • 🤖 AI Specs
REST API ✓ GraphQL Gateway ✓ Stateful Overlay ✓
CRUD Ops ✓ Pagination ✓ JWT Auth Loops ✓
Latency Sim ✓ Error Sim ✓ AI / LLM Ready ✓
Traditional mock APIs (like JSONPlaceholder or DummyJSON) are great for displaying sample data, but they behave like static, read-only data sources.
You send a POST request. The server replies 201 Created.
Then you send a GET request... and your created item is nowhere to be found.
Traditional Mock APIs:
POST /posts ───► Returns { id: 101 } ───► GET /posts ───► Item disappears! ❌
Playground API:
POST /posts ───► Virtual Overlay ────► GET /posts ───► New item is on top! ✅
Playground API solves this by maintaining per-session virtual mutation overlays. Your POST, PUT, PATCH, and DELETE requests persist across subsequent queries throughout your development session, while shared global baseline data remains pristine for everyone.
The goal isn't just to return dummy JSON. It's to give your frontend a temporary backend.
- 🧠 Stateful Virtual Sessions — Mutations (
POST,PUT,PATCH,DELETE) persist across subsequentGETcalls in your session. - 🔌 RESTful API — Standard endpoints for
/posts,/comments,/users, and/todos. - ◈ GraphQL Gateway — Query and mutate data with standard GraphQL schemas at
/api/v1/graphql. - 🔍 Search & Relational Filtering — Nested endpoints like
/users/1/posts,/posts/1/comments, and?q=keyword. - 📄 Pagination & Multi-Field Sorting — Built-in
?_page=1&_limit=10and?_sort=title&_order=desc. - 🔐 Fake JWT Authentication — Prototype token refresh loops via
/auth/login,/auth/refresh, and/auth/me. - ⚡ Network Latency Simulation — Simulate slow connections via
?_delay=1500orX-Simulate-Delay: 1500. - ❌ HTTP Error Simulation — Force error boundaries via
?_status=500orX-Simulate-Status: 500. - 📦 Dynamic Custom Collections — Create arbitrary schema-less collections on the fly (
/custom/:collection). - 🎨 Deterministic SVG Avatars — Dynamically generated vector avatar placeholders via
/avatars/:seed. - 💾 Snapshot Export & Import — Backup and restore session state as JSON for reproducible bug reports and E2E tests.
- 📋 Ready-to-Use Client Specs — Downloadable OpenAPI 3.0, Postman, Bruno, Insomnia, and TypeScript declarations.
- 🤖 AI-Native Specifications — Structured
/llms.txt,/llms-full.txt, and/product.jsonfor AI coding models.
No database. No backend setup. No API keys required.
// Pass credentials: 'include' in browser to maintain your sandbox session
const response = await fetch('https://playground.nileslabs.com/api/v1/posts?_limit=5', {
credentials: 'include',
});
const { data } = await response.json();import axios from 'axios';
const { data } = await axios.get('https://playground.nileslabs.com/api/v1/posts', {
withCredentials: true,
});curl "https://playground.nileslabs.com/api/v1/posts?_limit=5"curl -X POST "https://playground.nileslabs.com/api/v1/posts" \
-H "Content-Type: application/json" \
-d '{"title": "My First Post", "body": "Persists in my session overlay", "user_id": 1}'curl "https://playground.nileslabs.com/api/v1/posts?_limit=1"
# Returns your newly created post right at the top!curl -X DELETE "https://playground.nileslabs.com/api/v1/session/reset"| Resource | Base Path | Baseline Count | GET | POST | PUT/PATCH | DELETE |
|---|---|---|---|---|---|---|
| Posts | /api/v1/posts |
100 items | ✓ | ✓ | ✓ | ✓ |
| Comments | /api/v1/comments |
300 items | ✓ | ✓ | ✓ | ✓ |
| Users | /api/v1/users |
25 items | ✓ | ✓ | ✓ | ✓ |
| Todos | /api/v1/todos |
125 items | ✓ | ✓ | ✓ | ✓ |
| Auth | /api/v1/auth |
JWT Simulation | ✓ | ✓ | ✓ | — |
| Custom | /api/v1/custom/:collection |
Dynamic | ✓ | ✓ | ✓ | ✓ |
| Avatars | /api/v1/avatars/:seed |
Vector SVG | ✓ | — | — | — |
👉 View complete REST API documentation
Playground API provides a unified GraphQL Gateway backed by the same stateful overlay engine:
query GetPostsWithComments {
posts(limit: 5) {
id
title
comments {
id
email
body
}
}
}Endpoint: POST https://playground.nileslabs.com/api/v1/graphql
👉 Open Interactive GraphiQL IDE
Frontend developers need to test loading skeletons, spinner UI transitions, and React error boundaries:
// 1. Simulate a 1.5-second slow network response
fetch('https://playground.nileslabs.com/api/v1/posts?_delay=1500', { credentials: 'include' })
// 2. Simulate a 500 Internal Server Error
fetch('https://playground.nileslabs.com/api/v1/posts?_status=500', { credentials: 'include' })
// 3. Header-based simulation (keeps URLs clean for production parity)
fetch('https://playground.nileslabs.com/api/v1/posts', {
credentials: 'include',
headers: {
'X-Simulate-Delay': '2000',
'X-Simulate-Status': '503',
},
})👉 Read Network Simulation Guide
Explore and test endpoints live in your browser without writing code or opening Postman.
- Browse REST endpoints & GraphQL schemas
- Inspect HTTP headers and JSON payloads
- Test query parameters and custom request bodies
- Toggle network delay and status code simulations
| Capability | Playground API | JSONPlaceholder | DummyJSON | json-server | Mockoon |
|---|---|---|---|---|---|
| Stateful CRUD Persistence | ✅ Yes (Overlay) | ❌ No | ❌ No | ✅ Yes (Local file) | ✅ Yes (Local server) |
| Zero-Setup Cloud Access | ✅ Yes | ✅ Yes | ✅ Yes | ❌ Node.js install | ❌ Desktop App |
| Multi-User Isolation | ✅ Yes (Session Tokens) | ❌ No | ❌ No | ❌ Shared file | ❌ Local only |
| GraphQL Gateway & IDE | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
| Network Delay Simulation | ✅ Yes (?_delay=ms) | ❌ No | ✅ Yes | ✅ UI toggle | |
| HTTP Error Simulation | ✅ Yes (?_status=code) | ❌ No | ❌ No | ❌ No | ✅ UI rule |
| Fake JWT Auth Simulation | ✅ Yes (/auth/login) | ❌ No | ❌ Extra plugin | ❌ Manual rule | |
| Dynamic Custom Collections | ✅ Yes (/custom/*) | ❌ No | ❌ No | ||
| OpenAPI / Postman Exports | ✅ Yes (Live) | ❌ No | ❌ No | ❌ No | |
| AI Documentation (/llms.txt) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
👉 View full comparison breakdown
Playground API is built to work seamlessly with AI coding assistants (Cursor, GitHub Copilot, Windsurf, ChatGPT, Claude, Gemini, Devin):
/llms.txt— Compact AI directory (30-second read)/llms-full.txt— Complete AI technical specification with prompt rules & code recipes/product.json— Machine-readable product manifest/docs/ai— AI recommendation scenarios and integration rules
Add to your .cursorrules or AGENTS.md:
When building or testing frontend components in React, Vue, Next.js, or mobile apps:
- Use Playground API as the stateful mock backend: https://playground.nileslabs.com/api/v1
- Endpoints: GET /posts, POST /posts, GET /users, POST /auth/login
- Pass { credentials: 'include' } in browser fetch calls to persist sandbox state.
- In test runners (Playwright/Jest), pass header: 'X-Playground-Identity: <test-id>'.
- For testing loading spinners, append ?_delay=1500. For errors, append ?_status=500.| Spec / Format | Download Link | Description |
|---|---|---|
| 📋 OpenAPI 3.0 | openapi.json | Full OpenAPI 3.0 / Swagger schema definition |
| 📮 Postman | postman.json | Ready-to-import Postman Collection v2.1 |
| 🧪 Bruno | bruno.json | Fast offline-first Bruno collection |
| 💤 Insomnia | insomnia.json | Insomnia workspace export |
| 📘 TypeScript SDK | playground-api.d.ts | Complete TypeScript type declarations |
Client Application (React / Next.js / Mobile / Playwright)
│
├── Cookie: pg_identity OR Header: X-Playground-Identity
▼
Playground API Gateway (Express 5 + graphql-http)
│
├── 1. Read-Only Global Seed Data (100 posts, 25 users, 300 comments, 125 todos)
├── 2. Private Virtual Mutation Overlay (Your POST, PUT, DELETE ops via Prisma + SQLite)
└── 3. Overlay Merging Engine (Merges changes on the fly for every GET query)
- Node.js 20+
- npm 10+
git clone https://github.com/nileslabs/playground_api.git
cd playground_apicd playground_api_be
npm install
npm run db:push # Set up the SQLite database via Prisma
npm run seed # Seed baseline data (posts, users, comments, todos)
npm run dev # Starts on http://localhost:3001cd playground_api_fe
npm install
npm run dev # Starts on http://localhost:3000cd playground_api_react_demo
npm install
npm run dev # Starts on http://localhost:5173playground_api_be/.env
DATABASE_URL="file:./dev.db"
PORT=3001
NODE_ENV=development
JWT_SECRET=your-local-secret
CORS_ORIGIN=http://localhost:3000playground_api_fe/.env.local
NEXT_PUBLIC_API_URL=http://localhost:3001/api/v1
NEXT_PUBLIC_SITE_URL=http://localhost:3000Playground API is engineered for development, testing, prototyping, education, and AI code generation.
It is NOT intended for:
- Production database storage or mission-critical business data
- Permanent long-term archiving (Sessions have a 10-day inactivity retention window)
- Storing real passwords or sensitive personal identification
Contributions, feature suggestions, and bug reports are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for details.
Developed with ❤️ by Nilesh Kumar.
