๐ 3-Minute Quickstart Guide
Playground API comes pre-loaded with realistic baseline mock data. Fetch data using standard fetch or axios:
fetch('https://playground-api-xi.vercel.app/posts?page=1&limit=3')
.then(res => res.json())
.then(data => console.log(data));
Unlike standard mock APIs, Playground API saves your mutations in a per-session sandbox overlay. Include credentials: 'include' to persist state via cookie, or pass X-Playground-Identity header:
fetch('https://playground-api-xi.vercel.app/posts', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
body: JSON.stringify({
title: 'My Sandboxed Post',
body: 'Persists specifically for my identity session!',
userId: 1
})
}).then(res => res.json()).then(data => console.log('Created:', data));
Test UI loading spinners with ?_delay=1500 and error boundaries with ?_status=500:
// Simulate 1.5s network delay
fetch('https://playground-api-xi.vercel.app/posts?_delay=1500');
// Force 500 Server Error
fetch('https://playground-api-xi.vercel.app/posts?_status=500');