A free API for retrieving product data.
Fetch all products, get a product by ID, or filter products by category.
No authentication or API key required.
http://localhost:4000
Deployed link:
https://dummistore-wuga.onrender.com
- Free to use
- No authentication required
- Simple endpoints
- JSON responses
- Product filtering by category
- Retrieve individual products by ID
Clone the repository:
git clone https://github.com/Pranjal-Sahu21/products-api-backend.gitInstall dependencies:
npm installStart the server:
node server.jsServer will run at:
http://localhost:4000
GET /
Server is Live!
GET /products
http://localhost:4000/products
[
{
"id": 1,
"title": "Item title1",
"price": 21.00,
"description": "Item description1",
"category": "Item category",
"image": "https://itemimage1.webp",
"rating": {
"rate": 3.9,
"count": 120
}
},
{
"id": 2,
"title": "Item title2",
"price": 25.00,
"description": "Item description2",
"category": "Item category",
"image": "https://itemimage2.webp",
"rating": {
"rate": 2.9,
"count": 10
}
}
]GET /products/:id
http://localhost:4000/products/1
{
"id": 1,
"title": "Item title1",
"price": 21.00,
"description": "Item description1",
"category": "Item category",
"image": "https://itemimage1.webp",
"rating": {
"rate": 3.9,
"count": 120
}
}{
"message": "Product not found"
}GET /products/category/:category
http://localhost:4000/products/category/smartphones
[
{
"id": 1,
"title": "Item title1",
"price": 21.00,
"description": "Item description1",
"category": "smartphones",
"image": "https://itemimage1.webp",
"rating": {
"rate": 3.9,
"count": 120
}
},
{
"id": 2,
"title": "Item title2",
"price": 25.00,
"description": "Item description2",
"category": "smartphones",
"image": "https://itemimage2.webp",
"rating": {
"rate": 2.9,
"count": 10
}
}
]project
│
├── data
│ └── products.json
│
├── server.js
│
├── package.json
│
└── README.md
- Node.js
- Express.js
- CORS
- JSON data
This project is free to use for learning and development.
Contributions are welcome.
Feel free to open issues or submit pull requests.