dummyapi
🛍️

Products

8 endpoints

200 products across 24 categories with prices, ratings, stock levels, and images. Perfect for building e-commerce prototypes.

Base URLhttps://dummyapi.codesmash.in/api
GET

Get all products. Supports ?limit&skip&sortBy&order.

🔗

GET https://dummyapi.codesmash.in/api/products

?limit?skip?sortBy?order
fetch('https://dummyapi.codesmash.in/api/products')
.then(res => res.json())
.then(console.log);
ℹ️
Pagination — By default you will get 30 items. Use ?limit and ?skip to paginate through all items. Max limit is 200.
?limit=10Number of items to return (default: 30, max: 200)
?skip=10Number of items to skip (default: 0)
// By default you get 30 items
fetch('https://dummyapi.codesmash.in/api/products?limit=10&skip=0')
.then(res => res.json())
.then(console.log);
// Get next page (items 11–20)
fetch('https://dummyapi.codesmash.in/api/products?limit=10&skip=10')
.then(res => res.json())
.then(console.log);
// Get ALL 200 at once
fetch('https://dummyapi.codesmash.in/api/products?limit=200')
.then(res => res.json())
.then(console.log);
GET

Get a single product by ID.

🔗

GET https://dummyapi.codesmash.in/api/products/:id

fetch('https://dummyapi.codesmash.in/api/products/:id')
.then(res => res.json())
.then(console.log);
GET

Get all product categories.

🔗

GET https://dummyapi.codesmash.in/api/products/categories

fetch('https://dummyapi.codesmash.in/api/products/categories')
.then(res => res.json())
.then(console.log);
GET

Get products by category slug.

🔗

GET https://dummyapi.codesmash.in/api/products/category/:name

fetch('https://dummyapi.codesmash.in/api/products/category/:name')
.then(res => res.json())
.then(console.log);
POST

Create a new product (demo).

🔗

POST https://dummyapi.codesmash.in/api/products

fetch('https://dummyapi.codesmash.in/api/products', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
PUT

Update a product.

🔗

PUT https://dummyapi.codesmash.in/api/products/:id

fetch('https://dummyapi.codesmash.in/api/products/:id', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
DELETE

Delete a product.

🔗

DELETE https://dummyapi.codesmash.in/api/products/:id

fetch('https://dummyapi.codesmash.in/api/products/:id', {
method: 'DELETE',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({})
})
.then(res => res.json())
.then(console.log);
Buy me a coffee