DummyAPI
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/products

Returns 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/products
Query Parameters
NameTypeDefaultDescription
pagenumber1Page number for pagination.
limitnumber20Number of items per page.
searchstringSearch 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/:id

Returns 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/:id
Path Parameters
NameTypeRequiredDescription
idstringRequiredThe 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