Skip to main content
Mock API Builder
LearnAboutContact
Learning Center/Mock Data Generation
Core Concepts

Mock Data Generation

Automatically generate realistic test data with Faker.js integration

What is Mock Data?

Mock data is realistic, randomly generated test data that simulates real database records. It allows you to develop and test your frontend without needing a working backend or database.

Benefits of Mock Data

  • No Backend Required: Start frontend development immediately
  • Realistic Testing: Test with data that looks and feels real
  • Edge Cases: Generate specific scenarios (empty lists, long text, etc.)
  • Performance Testing: Create thousands of records instantly
  • Consistency: Same data structure every time

Powered by Faker.js

Mock API Builder uses Faker.js, a powerful library with 100+ data generators for creating realistic mock data across various categories:

Person Data
Names (first, last, full)
Emails
Phone numbers
Gender, job titles
Bio, avatar URLs
Location Data

• Street addresses

• Cities, states, countries

• ZIP codes

• Coordinates (lat/lng)

• Timezones

Commerce Data

• Product names

• Prices, departments

• Colors, materials

• Product descriptions

• ISBN, barcodes

Company Data

• Company names

• Catch phrases

• BS phrases

• Industry types

• Corporate suffixes

Internet Data

• Email addresses

• Usernames

• URLs, domains

• IP addresses

• User agents, emoji

Date & Time

• Past/future dates

• Recent/soon dates

• Birthdates

• Month, weekday names

• Timestamps

Finance Data

• Credit card numbers

• Account numbers

• Currency codes

• Bitcoin addresses

• IBAN, BIC codes

Text & Lorem

• Lorem ipsum text

• Paragraphs, sentences

• Words, lines

• Slugs

• Random text

How It Works

1

Define Your Schema

Create your data structure with field names and types

json
2

Smart Field Detection

The system automatically detects field purpose based on name

• "email" → faker.internet.email()

• "firstName" → faker.person.firstName()

• "city" → faker.location.city()

3

Set Record Count

Choose how many records to generate (1 to 10,000+)

10 records - Quick testing
100 records - Pagination testing
1,000+ records - Performance testing
4

Generate & Store

Data is generated and stored in your database

Generated 100 user records in 1.2 seconds

Field Name Detection

The system intelligently maps field names to appropriate Faker.js generators:

Name Fields

Field Name:

firstName

Generated Value:

"John"

Also detects: first_name, name, fullName, lastName

Email Fields

Field Name:

email

Generated Value:

"john@example.com"

Also detects: emailAddress, email_address

URL/Image Fields

Field Name:

avatar

Generated Value:

"https://..."

Also detects: image, photo, thumbnail, url, website

Date Fields

Field Name:

createdAt

Generated Value:

"2025-01-15T10:30:00Z"

Also detects: updatedAt, birthdate, date, timestamp

Generation Options

Auto-Generate (Default)

Let the system automatically generate data based on your schema

Best for:

  • • Quick prototyping
  • • Standard data types
  • • Getting started fast
Custom Faker Formulas

Specify exact Faker.js methods for precise control

json

Best for:

  • • Specific data requirements
  • • Advanced use cases
  • • Fine-tuned control
Manual Data Entry

Manually create specific test cases or seed data

Best for:

  • • Edge cases
  • • Demo data
  • • Specific scenarios

Real-World Examples

User Management API
json
100 records generated
E-commerce Products
json
500 records generated
Blog Posts
json
50 records generated

Best Practices

Use Descriptive Field Names

Clear field names help auto-detection work better:

firstName,emailAddress,phoneNumber

data1,field2,value

Start with Smaller Datasets

Generate 10-20 records first to verify the structure, then scale up to hundreds or thousands.

Mix Auto & Manual Data

Auto-generate most data, then manually create a few edge cases (empty fields, very long text, special characters).

Regenerate When Schema Changes

After updating your schema, regenerate mock data to match the new structure and avoid inconsistencies.

Test Different Scenarios

Create multiple endpoints with different data scenarios:

  • • /users - 100 normal users
  • • /users/empty - Empty array (edge case)
  • • /users/large - 10,000 users (performance)
Previous: Data Schemas & ContractsNext: Using Project Templates
Mock API Builder

Built for developers, by developers

LearnSupport / ContactPrivacy PolicyTerms of Service

© 2026 Mock API Builder. All rights reserved.

Learning Center
← Back to Dashboard
Learning Center
← Back to Dashboard