PayloadGen ❴ ⚡ ❵
Generate realistic API payloads instantly from code
PayloadGen is a powerful Visual Studio Code extension that scans JavaScript/TypeScript code and generates realistic dummy data for API testing. Perfect for Express.js and Mongoose/MongoDB workflows.

How to Use
Select the Code
Highlight a route handler, Mongoose schema, or object with field definitions.
Run the Command
- Right-click and select "Generate API Payload" from the context menu, or
- Press
Ctrl+Shift+P
/ Cmd+Shift+P
and search for "Generate API Payload"
View the Payload
A new panel shows your generated payload with syntax highlighting.
Copy or Save
Use the buttons to copy to the clipboard or save as a JSON file.
Features
- One-Click Generation: Select code, run command, get instant, realistic payloads
- Smart Field Detection: Automatically identifies fields from req.body, Mongoose schemas, and more
- Realistic Data: Generates contextually appropriate data (emails for email fields, addresses for address fields, etc.)
- Complex Structure Support: Handles nested objects, arrays, and references
- MongoDB Integration: Special support for ObjectId references and Mongoose schema patterns
- Copy & Save: Easily copy payloads to the clipboard or save as JSON files
Documentation
For comprehensive documentation including architecture details, contribution guidelines, and advanced usage examples, visit our Documentation Site.
Examples
From Mongoose Schema
TypeScript-based Mongoose Schema
import mongoose, { Document, Schema } from 'mongoose';
export interface IUser extends Document {
name: string;
email: string;
age?: number;
role?: 'admin' | 'user' | 'guest';
address?: string;
createdAt: Date;
}
const UserSchema = new Schema<IUser>({
name: { type: String, required: true },
email: { type: String, unique: true },
age: { type: Number },
role: { type: String, enum: ['admin', 'user', 'guest'] },
address: { type: String },
createdAt: { type: Date, default: Date.now },
});
export const UserModel = mongoose.model<IUser>('User', UserSchema);
Generates:
{
"name": "Shaina",
"email": "Alvena.Lowe-Lakin26@gmail.com",
"age": 62,
"role": "user",
"address": "582 Nick Motorway",
"createdAt": "2025-05-31T03:55:33.909Z"
}
From Express route Handler
JavaScript-based route handler
app.post("/blog", (req, res) => {
const { title, content, author, tags, published } = req.body;
res.status(201).json({ message: "Blog post created" });
});
Generates:
{
"title": "Adversus pel synagoga uredo audax suscipio subiungo pauci usitas.",
"content": "uxor",
"author": "blandior",
"tags": [
"record",
"besides",
"including"
],
"published": "tametsi"
}
More Examples
See more examples of PayloadGen in action
Privacy and Data Usage
PayloadGen respects your privacy
- 100% Local Processing: All code analysis and payload generation happen locally
- No Data Collection: PayloadGen don not collect, store, or transmit your code or generated payloads
- No Telemetry: PayloadGen do not track usage or collect analytics
For more details, see our Privacy Policy.
License
This project is licensed under the MIT License with commercial restrictions - see the LICENSE file for details.
Feedback and Support
Author
Created with ❤️ by Israr
Enjoy faster API testing with PayloadGen ❴ ⚡ ❵