Mock API examples
Generate realistic API test data with Faker
Return generated names, emails, and UUIDs from a mock API. Use Faker templates in MockOut to test frontend layouts without real customer data.
Open this example in MockOutThis fills in the form. Review it, then select Create Endpoint to make it live.
Use templates instead of customer records
Hardcoded sample data can hide layout problems. Faker templates let you try different names and email lengths without uploading real customer data. MockOut evaluates these templates when a request reaches the endpoint.
{
"id": "{{faker 'string.uuid'}}",
"name": "{{faker 'person.fullName'}}",
"email": "{{faker 'internet.email'}}"
}Keep each template inside a JSON string, including its double quotes. Open the example, review the generated path, and create the endpoint. Copy its URL, call it twice, and compare the returned values.
Choose random or fixed data for the test
Generated values can change on every request. A generated UUID is not a persistent customer ID, and separately generated names and emails do not necessarily describe the same person. Use fixed values when assertions need to be repeatable.
Mix templates with static fields to keep the part you are testing predictable. For example, use a generated name with a fixed subscription status to check how an account screen wraps text. For an exact long string or a missing field, edit the JSON explicitly instead of relying on random generation.
The documentation covers additional template helpers and request parameters.
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.