Home - thanhle1547/DummyJSON GitHub Wiki

Welcome to the DummyJSON wiki!

DummyJSON can be used with any type of front end project that needs products, carts, users, todos or any dummy data in JSON format. You can use examples below to check how DummyJSON works.

Feel free to enjoy it in your awesome projects!

Intro

Test Route

See if your internet is working 😉

Could be POST/PUT/PATCH/DELETE

GET /test

Response:

{ "status": "ok", "method": "GET" }

Limiting Resources

💡 All the resources can be used with query params to achieve pagination and get limited data. limit=0 clears the limit and you get all items

/RESOURCE/?limit=10&skip=5&select=key1,key2,key3

It can be comma separated, OR, you can use multiple select query params to get multiple keys.

/RESOURCE/?limit=10&skip=5&select=key1&select=key2&select=key3

Delay Responses

💡 You can simulate a delay in responses using the delay param, delay can be any number between 0 and 5000 milliseconds

/RESOURCE/?delay=1000

Authorizing Resources

💡 Go to auth module and generate an auth token to get data as an authorized user

GET /RESOURCE

headers: {
  'Authorization': 'Bearer /* YOUR_TOKEN_HERE */', 
  'Content-Type': 'application/json'
},