DummyJSON is a free, open-source REST API that provides fake JSON data for use in development and testing. It offers pre-generated datasets for resources such as products, users, posts, comments, and more, helping developers quickly prototype front-end projects without needing a backend setup.
All the resources can be used with query params to achieve pagination and get limited data. You can simulate a delay in responses using the delay param. All resources can be accessed via an authentication token to test as a logged-in user.
Example usage
Sort products
You can pass sortBy and order params to sort the results, sortBy should be field name and order should be “asc” or “desc”.
fetch('https://dummyjson.com/products?sortBy=title&order=asc')
.then(res => res.json())
.then(console.log);
Output
{
"products": [
{
"id": 167,
"title": "300 Touring", // sorted by title in ascending order
"price": 28999.99
/* rest product data */
},
{
"id": 99,
"title": "Amazon Echo Plus", // sorted by title in ascending order
"price": 99.99
/* rest product data */
},
{...}
// 30 items
],
"total": 194,
"skip": 0,
"limit": 30
}