Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DummiStore API

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.


Base URL

http://localhost:4000

Deployed link:

https://dummistore-wuga.onrender.com

Features

  • Free to use
  • No authentication required
  • Simple endpoints
  • JSON responses
  • Product filtering by category
  • Retrieve individual products by ID

Installation

Clone the repository:

git clone https://github.com/Pranjal-Sahu21/products-api-backend.git

Install dependencies:

npm install

Start the server:

node server.js

Server will run at:

http://localhost:4000

API Endpoints

Check Server Status

GET /

Response

Server is Live!

Get All Products

GET /products

Example Request

http://localhost:4000/products

Example Response

[
    {
        "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 Product by ID

GET /products/:id

Example Request

http://localhost:4000/products/1

Success Response

    {
        "id": 1,
        "title": "Item title1",
        "price": 21.00,
        "description": "Item description1",
        "category": "Item category",
        "image": "https://itemimage1.webp",
        "rating": {
            "rate": 3.9,
            "count": 120
        }
    }

Error Response

{
  "message": "Product not found"
}

Get Products by Category

GET /products/category/:category

Example Request

http://localhost:4000/products/category/smartphones

Response

[
    {
        "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 Structure

project
│
├── data
│   └── products.json
│
├── server.js
│
├── package.json
│
└── README.md

Tech Stack

  • Node.js
  • Express.js
  • CORS
  • JSON data

License

This project is free to use for learning and development.


Contribution

Contributions are welcome.
Feel free to open issues or submit pull requests.

About

Free product API with endpoints for products, categories, and individual items, featuring simple integration, no authentication requirements, and built-in rate limiting of 20 requests per minute for reliable usage control.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages