A magic mock API built using faker 🔮 Github
It generates data based on a query. In order to generate data you need to send a stringified JSON as a data query parameter with following format:
{
"count": 2,
"fields": {
"id": "random.uuid",
"firstName": "name.firstName",
"lastName": "name.lastName",
"email": "internet.email",
"phone": "phone.phoneNumberFormat"
}
}
Example request:
https://pitch-bookcase.glitch.me/mock?data={"count":2,"fields":{"id":"random.uuid","firstName":"name.firstName","lastName":"name.lastName","email":"internet.email","phone":"phone.phoneNumberFormat"}}
- count: number of records you want to generate
- fields: object containing all the fields you want to generate per record
Each field should be in the following format: { "key": "fakerAPIMethod" }