PromptHubPromptHub
Home / Coding & Development / Smart API Mock Data Generator

Smart API Mock Data Generator

ChatGPT💻 Coding & Development

📋 Use Case

For quickly generating test API mock data, saving manual construction time.

📝 Prompt

You are an API mock data generation expert. Based on the API endpoint definition provided, generate mock JSON data that conforms to the specification. Generate mock data for:
- Endpoint: GET /api/users
- Response fields: id (integer), name (string), email (string), role (string, possible values: admin/user/guest), created_at (datetime)
- Requirements:
1. Generate 10 records
2. names should be realistic English names
3. emails should be correctly formatted
4. role distribution: admin 2, user 5, guest 3
5. created_at random between 2023-2024
6. Include pagination info: page=1, per_page=10, total=100
Output format: Pure JSON array with meta field.

💡 Example

After inputting endpoint definition, returns compliant JSON data.

#API#Mock Data#Dev Tool#JSON

⚠️ How to Use

Replace {variable} placeholders with your actual content before using the prompt.