- Add Endpoint — Click '+ Add Endpoint'. Select an HTTP method (GET, POST, PUT, PATCH, DELETE), enter the API path (e.g. '/api/users'), choose a status code (200, 201, 404, 500, etc.), and optionally set a delay in milliseconds.
- Define Response — Write the JSON response body in the editor. Add response headers (e.g. 'Content-Type: application/json'). The tool validates JSON syntax.
- Use Presets — Load pre-built collections: REST API (CRUD operations for users), Auth API (login, register, logout, token), or E-commerce API (products, cart, orders). Customize presets to match your needs.
- Test Endpoints — Click '▶ Test' on any endpoint to see the full request/response preview with syntax-highlighted JSON, headers, and status code in a formatted panel.
- Export Collection — Copy the entire collection as JSON to clipboard, or download as a JSON file. Import collections from JSON files to restore or share with team members.
API Response Mocker — Design and Test Mock API Endpoints
The API Response Mocker is a free tool for creating mock API endpoint definitions with custom HTTP methods, status codes, headers, and JSON response bodies. Use it to design APIs, prototype frontend integrations, test error handling, and share endpoint collections with your team — all in your browser.
During frontend development, you often need to work before the backend is ready. This tool lets you define exactly what your API responses will look like, helping you build and test your frontend with realistic mock data.
Key Features
- 7 HTTP Methods — Support for GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS. Each method is color-coded for quick visual scanning: GET (green), POST (blue), PUT (amber), PATCH (purple), DELETE (red).
- 16 Status Codes — 200, 201, 204, 301, 302, 400, 401, 403, 404, 405, 409, 422, 429, 500, 502, 503. Cover success, redirect, client error, and server error scenarios.
- JSON Response Body — Write response bodies with syntax highlighting for keys (blue), strings (green), numbers (gold), and booleans (pink). JSON is validated on save.
- Custom Headers — Define response headers like Content-Type, Authorization, Cache-Control, CORS headers, etc.
- Simulated Delay — Add artificial response delays (0–10000ms) to test loading states, timeouts, and slow network conditions.
- 3 Preset Collections — Instantly load pre-built API definitions: REST API (full CRUD with pagination), Auth API (login/register/logout with JWT), E-commerce API (products/cart/orders).
- Test Preview — Click '▶ Test' to see a formatted preview of the full request and response, including method, path, status, headers, and syntax-highlighted body.
- Endpoint Management — Edit, duplicate, or delete any endpoint. Click the endpoint header to expand/collapse the response body preview.
- Export & Import — Copy the entire collection to clipboard or download as a JSON file. Import collections from JSON files.
- localStorage Persistence — All endpoint definitions persist across browser sessions.
Use Cases
- Frontend Development — Design API responses before the backend is built. Build your UI with realistic mock data.
- API Design — Prototype API contracts (paths, methods, status codes, response shapes) before implementation.
- Testing — Define error responses (401, 403, 404, 500) to test how your frontend handles failures gracefully.
- Documentation — Create and share endpoint definitions that serve as living API documentation.
- Prototyping — Quickly mock an entire API surface for hackathons, demos, and proof-of-concepts.
- Team Collaboration — Export collections and share JSON files with team members for consistent API expectations.
Privacy
The API Response Mocker processes everything in your browser. Endpoint definitions are stored in localStorage — never transmitted to any server. Export files are generated locally. The tool works offline once loaded.