While we can generate data using Faker.JS, we can also leverage artificial intelligence to produce data in a realistic and rapid manner. We can provide examples and request almost anything. The AI will deliver a JSON with our request in just seconds.
To use artificial intelligence to generate data for our mock API, it's as simple as using "//" in the code editor followed by what we want to request. For instance, let's ask for a list of football players:
//a list of football playersAfter a few seconds, the editor will display exactly what we requested in JSON format:
{
"players": [
{
"name": "Lionel Messi",
"age": 33,
"nationality": "Argentina"
},
{
"name": "Cristiano Ronaldo",
"age": 36,
"nationality": "Portugal"
},
{
"name": "Neymar Jr",
"age": 29,
"nationality": "Brazil"
}
]
}That's not all; we can request more complex data. Imagine you have an endpoint at /users, but you only have one user object mocked:
{
"users": [
{
"id": 1,
"name": "test",
"age": 23
}
]
}Now, let's say we want to add two more users and introduce a new "address" field for the users. We can request this as follows:
//get an array of 3 users with a new address field like this array
{"users": [
{
"id": 1,
"name": "test",
"age": 23
}
]
}
The API might respond with something like this:
{
"users": [
{
"id": 1,
"name": "John",
"age": 25,
"address": "123 Main St"
},
{
"id": 2,
"name": "Jane",
"age": 30,
"address": "456 Elm St"
},
{
"id": 3,
"name": "Tom",
"age": 28,
"address": "789 Oak St"
}
]
}By using this method, we can save a significant amount of time, create APIs from scratch, and even incorporate suggestions from the AI.
Another way to generate mock API data with AI is by using the our modal. To access it, simply click on a button that appears when the endpoints is a JSON endpoint:

Then a modal will appear where you can input your request and generate mock API data using AI:

This modal is especially useful when you want to generate data for complex endpoints or when you prefer a larger interface to input your requests.
Remember, this feature is available for premium users only.
Create a project