Faker JSON Placeholder is a simple fake REST API server for quick testing, prototyping and mocking.
When learning a new library, following a tutorial, or building prototypes, many individuals (including myself) are in need of some data.
This simple-to-use Faker JSON API server comes to the rescue in such scenarios by providing you with extensive and configurable JSON fake responses.
You can find it running here and are free to use it in your developments.
I hope you will find it useful.
Think of this as JSONPlaceholder on steroids, providing extensive and configurable JSON fake responses.
Endpoints | Query Parameter | Response |
/api/faker |
|
Responds with a list of faker JSON object with the keys specified in the query parameter or using a predefined schema |
/api/faker/:id |
|
Responds with a single faker JSON object with the keys specified in the query parameter or using a predefined schema |
To call a faker function using the keys query parameter, you are to use the double underscore __ format like this <module_name>__<method_name>.
An in-depth overview of the different methods is available in the fakerjs documentation. Below are some of modules available:
Allowing this kind of query parameter opens up a wide range with which you can customize your response.
For more information about the different functions you can check out the official documentation
Schema Name | Expected Schema Sample |
post | posts (default) |
{
"id": 1,
"title": "Nihil possimus ut beatae dicta nulla eaque sapiente.",
"body": "Fuga ea repellendus iste eaque ut sed velit eum consequatur.",
"userId": 1,
"createdBy": "Stewart Jaskolski",
"createdDate": "2022-04-15T15:27:21.885Z"
} |
todo | todos |
{
"id": 1,
"title": "Nobis rem nam et voluptate.",
"completed": true,
"userId": 1,
"completedDate": "2022-04-14T09:19:24.514Z"
} |
quote | quotes |
{
"id": 1,
"body": "Aperiam perspiciatis rerum fugit distinctio.",
"author": "Abel Leffler",
"tags": [
"explicabo",
"earum",
"odio"
]
} |
ecommerce | product | products |
{
"id": 1,
"name": "Car",
"description": "New range of formal shirts are designed keeping you in mind. With fits and styling that will make you stand apart",
"price": "329.00",
"color": "red",
"imageURL": "http://loremflickr.com/640/480/abstract"
} |
user | users | person |
{
"id": 1,
"name": "Jim Medhurst",
"email": "Nolan.Herzog45@gmail.com",
"address": {
"street": "272 Kulas Glen",
"city": "West Elyssachester",
"zipcode": "68120",
"geo": {
"lat": "81.4015",
"lng": "-98.9926"
}
},
"phone": "(575) 415-0764 x4389",
"website": "fuzzy-avalanche.org",
"company": {
"name": "Collier, Schneider and Kris",
"bs": "matrix real-time platforms"
}
} |
This system made use of @faker-js/faker extensively and it was inspired by JSONPlaceholder