DocsProducts
Products API
The products endpoint provides a comprehensive dataset of sample product information, including details like names, prices, descriptions, images, and categories, ideal for testing and prototyping e-commerce applications.
GET
/productsReturns a paginated list of products.
Code Examples
fetch
fetch('https://api.dhanyalvian.my.id/dummy/v1/products', {
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));URL
https://api.dhanyalvian.my.id/dummy/v1/productsQuery Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| page | number | 1 | Page number for pagination. |
| limit | number | 20 | Number of items per page. |
| search | string | — | Search by name, SKU, brand, category, or tags. |
Response (200 OK)
{
"meta": {
"reqId": "e7d7f82a-d56d-43c8-8002-6cb2aba1d4ec",
"code": "200"
},
"message": "",
"pagination": {
"page": 1,
"next": 2,
"record": 1,
"totalPage": 250,
"totalRecord": 250
},
"records": [
{
"id": "250",
"name": "DEET-Free Insect Repellent Max",
"sku": "PETS-PET-250",
"brand": "StarGaze",
"category": "Pets",
"tags": [
"ergonomic",
"eco-friendly",
"lightweight"
],
"thumbnail": "https://picsum.photos/seed/prod250a/200",
"price": 53.12,
"discount": 0,
"stock": 41
}
]
}Try it Yourself
GET
Query Params
page:
limit:
search:
GET
/products/:idReturns a single product by ID.
Code Examples
fetch
fetch('https://api.dhanyalvian.my.id/dummy/v1/products/1', {
headers: { 'Content-Type': 'application/json' }
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));URL
https://api.dhanyalvian.my.id/dummy/v1/products/:idPath Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Required | The unique identifier of the product. |
Response (200 OK)
{
"meta": {
"reqId": "e9d7f82a-d56d-43c8-8002-6cb2aba1d4ec",
"code": "200"
},
"message": "",
"record": {
"id": "250",
"name": "DEET-Free Insect Repellent Max",
"sku": "PETS-PET-250",
"brand": "StarGaze",
"category": "Pets",
"tags": [
"ergonomic",
"eco-friendly",
"lightweight"
],
"thumbnail": "https://picsum.photos/seed/prod250a/200",
"price": 53.12,
"discount": 0,
"stock": 41,
"images": [
"https://picsum.photos/seed/prod250a/400",
"https://picsum.photos/seed/prod250b/400"
],
"weight": 6.63,
"dimensions": {
"width": 75.81,
"height": 164.65,
"depth": 94.45
}
}
}Error Response
{
"meta": {
"reqId": "ead7f82a-d56d-43c8-8002-6cb2aba1d4ec",
"code": "400"
},
"message": "Data not found"
}Try it Yourself
GET