Mock API examples
Create a custom JSON endpoint
Turn your JSON into a live mock API endpoint. Choose a URL, HTTP method, status code, and response body. No account needed for public endpoints.
Open this example in MockOutThis fills in the form. Review it, then select Create Endpoint to make it live.
Give your UI a predictable response
A fixed public demo API may not match your application. With a custom JSON endpoint, you control field names, nested objects, arrays, and empty states. This example returns a product catalog you can use to build a list, price display, and availability badge.
{
"products": [
{
"id": 1,
"name": "Mechanical keyboard",
"price": 89,
"inStock": true
}
],
"total": 1
}Open the example, keep GET and status 200, and edit the JSON to match your frontend. MockOut suggests a unique path so your example is less likely to collide with another public endpoint. You can change it before creating.
Call your endpoint from JavaScript
After creating it, copy its full URL from the endpoint list. Replace the placeholder below with that URL.
const endpointUrl = "PASTE_YOUR_ENDPOINT_URL";
const response = await fetch(endpointUrl);
if (!response.ok) throw new Error("HTTP " + response.status);
const data = await response.json();
console.log(data.products);Next, change products to an empty array and total to 0 to check your empty state. Add a very long product name to find wrapping problems. MockOut returns configured responses; it does not implement a database or save changes made by POST requests.
Start with a real testing problem
Create a custom JSON endpoint
Return the exact product, user, or order data your frontend needs.
Test your frontend with real HTTP errors
Exercise expired sessions, rate limits, and server failure screens.
Generate realistic API test data with Faker
Generate fresh names, email addresses, and IDs on each request.