Giter VIP home page Giter VIP logo

ovi / dummyjson Goto Github PK

View Code? Open in Web Editor NEW
1.3K 16.0 154.0 9.33 MB

DummyJSON.com provides different types of REST Endpoints filled with JSON data which you can use in developing the frontend with your favorite framework and library without worrying about writing a backend.

Home Page: http://dummyjson.com

License: Other

JavaScript 31.31% SCSS 11.83% EJS 56.65% Dockerfile 0.20%
json json-api json-server javascript javascript-library nodejs placeholder placeholderapi api api-rest

dummyjson's Introduction

Uptime Robot status

DummyJSON - Generate Placeholder Data on the Fly!

DummyJSON is your go-to free online REST API for instantly generating placeholder data without the hassle of setting up a server. Perfect for front-end development, teaching, testing, and prototyping!

Explore the detailed documentation at DummyJSON/Docs for quick samples.

Why DummyJSON?

Ever felt bogged down by the complexities of setting up a backend just to fetch dummy data for your front-end project? Or perhaps you dreamt of a learning app where obtaining realistic data didn't involve navigating through convoluted public APIs and cumbersome registration processes. Well, say hello to DummyJSON!

Say goodbye to wrestling with complicated backend setups! With DummyJSON, you can focus on your work without the hassle of intricate configurations. The straightforward backend server effortlessly meets your data needs, saving you from dealing with complex public APIs. No more complicated setups – just a smooth experience to speed up your development process.

Give it a spin at DummyJSON and make your development process smoother.

Features that Enhance Your Experience

  • No Sign-up/Registration: Dive in and start using it hassle-free.
  • Zero-configuration: Enjoy a seamless experience without the need for setup.
  • Basic and Advanced API: Covering everything from simple to sophisticated data.
  • Resource Relationships: Effortlessly understand and model data relationships.
  • Filters and Nested Resources: Tailor your data to fit your needs perfectly.
  • HTTP Methods Support: We've got all your HTTP methods covered - GET, POST, PUT, PATCH, and DELETE.
  • Delay Responses: Simulate real-world conditions with adjustable response delays.
  • Cross-framework Compatibility: Seamlessly integrate with React, Angular, Vue, Ember, or vanilla JavaScript.

Available Resources

Over 10 resources ready for use:

How to Fetch Data

Use any method you prefer - fetch API, Axios, jQuery AJAX - it all works seamlessly.

Example: Get all products

fetch('https://dummyjson.com/products')
  .then(res => res.json())
  .then(json => console.log(json));

OR

const res = await fetch('https://dummyjson.com/products');
const json = await res.json();
console.log(json);

Note: Pagination is also supported.

Explore all the routes and more at DummyJSON/Docs.


Dummy Image Generator

Dummy Image Generator is a simple Node.js service for generating placeholder images with customizable options.

Usage

You can use the service by making HTTP requests to the following URL:

https://dummyjson.com/image

Basic Examples

Customization Options

Image Formats

Additional Customizations

Supported Fonts

  • Bitter
  • Cairo
  • Comfortaa
  • Cookie
  • Dosis
  • Gotham
  • Lobster
  • Marhey
  • Pacifico
  • Poppins
  • Quicksand
  • Qwigley
  • Satisfy
  • Ubuntu

License

This project is open-source and available under the MIT License.

dummyjson's People

Contributors

debarshi121 avatar djscruggs avatar erik-j-d avatar hmdshfq avatar mzacuna avatar ovi avatar penevl avatar rifaldhiaw avatar shubhanshu2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dummyjson's Issues

Login with different user's data

Discussed in #4

Originally posted by rogerok August 8, 2022
Hi, I really enjoy your dummysjon and use it in my pet project. Is there any possibility to get auth token except kminchelle user?
Thanks!

Request - Add celebrities

Hi.

Is there any way to add celebrities to resources?

It would be beneficial.

Let me know if it is possible. I will create them and send PR.

Accept Header

Hello,
The application doesn't accept the header "Accept: application/json". Could you please correct this ?
Cheers,
Hemie143

can't Auth endpoint!

when i put the body key-value pairs username and password the response is message with : invalid credentials please check it out.
note: i used the user that in the docs.
https___dummyjson com_users_add - My Workspace - Google Chrome 13-Jan-23 12_20_34 AM

Request: Make Mock HTTP endpoint RFC 7807 compliant

RFC 7807 defines a "Problem Details" JSON object that is used as the body of a 4xx or 5xx HTTP response. The current response from the Mock HTTP endpoint is almost compliant. Making it compliant would allow DummyJSON to be used by libraries and applications that expect error HTTP responses to be formatted as Problem Details.

To make it compliant:

  • The "message" field should be renamed to "title" for 4xx and 5xx responses.
  • The Content-Type for 4xx and 5xx responses should be "application/problem+json" instead of the current "application/json".

Support for role

It would be great to add roles for some users with at least one ADMINISTRATOR and several USER with optionally other roles at your own discretion. This could help us quickly mock front-end for an upcoming API.

New post routes

Hello devs,

I would like to use this api in some educational projects and for that I realized that some interesting end-points are missing.
Two that I can list initially are:

  1. a GET that returns a list of all post tags;
  2. a GET that filters all posts that have the category received as payload.

I have experience with javascript and if you find it interesting, I can implement this functionality and create a pull request.

yours sincerely,
Higor Moroni

Support for sorting

For products maybe you could sort by price, rating, stock; for posts you can sort by reactions, etc

support for {page}

Could someone please help with the page funtionality, to make is easier when try to create things like pagination and infinity scroll

Comma missing in codeblock

Hi, just a small thing on ur website

under Posts DummyJson in the Section 'Add a new Post' there is a comma missing in line 5 of the corresponging codeblock. Noticed it when testing my application

unique ids when adding new products

hi there , i created a website using Dummyjsons products and i am using the addproduct method mentioned in the docs but all new added products have the same id and i tried everything and it didnt work , here is whats showing in the console

{id: 101, title: 'test', price: '2', thumbnail: '1', description: '1'}
description
:
"1"
id
:
101
price
:
"2"
thumbnail
:
"1"
title
:
"test"
[[Prototype]]
:
Object
App.js:109 Product added successfully!
App.js:113
{id: 101, title: 'test2', price: '2', thumbnail: '2', description: '2'}
description
:
"2"
id
:
101
price
:
"2"
thumbnail
:
"2"
title
:
"test2"
[[Prototype]]
:
Object

`limit` and `skip` support into `/products/category` endpoint.

First, thanks for this dummy JSON, It's nice to practice and testing some researchs for anything.

But I noticed a lack in the endpoint to get products from a category concerning limit and skip queries, it always returning just 5 records.

Captura de pantalla 2024-02-15 a la(s) 9 13 26 p  m

No matter if you're passing https://dummyjson.com/products/category/${category}?limit=10&skip=5 via fetch or axios.

Thanks in advance.

Title mismatch in sidebar and main page

Hi, I was working with the library. I find it very useful. I found a small issue. The below picture will highlight that issue, it's a title mismatch. The title on the sidebar and main page item do not match. I can send a PR, if you assign me this issue as my Good First Issue, please.
image

Cart Update is not working as expected

Request URL: https://dummyjson.com/carts/1
Request Method: PUT
Status Code: 200 OK
request payload: {"products":[{"id":59,"quantity":4}]}

response data:

{
    "id": "1",
    "products": [
        {
            "id": 18,
            "title": "Oil Free Moisturizer 100ml",
            "price": 40,
            "quantity": 4,
            "total": 160,
            "discountPercentage": 13.1,
            "discountedPrice": 139
        },
        {
            "id": 39,
            "title": "Women Sweaters Wool",
            "price": 600,
            "quantity": 3,
            "total": 1800,
            "discountPercentage": 17.2,
            "discountedPrice": 1490
        },
        {
            "id": 59,
            "title": "Spring and summershoes",
            "price": 20,
            "quantity": 2,
            "total": 40,
            "discountPercentage": 8.71,
            "discountedPrice": 37
        },
        {
            "id": 88,
            "title": "TC Reusable Silicone Magic Washing Gloves",
            "price": 29,
            "quantity": 2,
            "total": 58,
            "discountPercentage": 3.19,
            "discountedPrice": 56
        },
        {
            "id": 95,
            "title": "Wholesale cargo lashing Belt",
            "price": 930,
            "quantity": 1,
            "total": 930,
            "discountPercentage": 17.67,
            "discountedPrice": 766
        }
    ],
    "total": 2988,
    "discountedTotal": 2488,
    "userId": 97,
    "totalProducts": 5,
    "totalQuantity": 12
}

You see I am trying to update productId:59 with quantity 4 but product id 18 got updated

Limit and skip products - skip returns wrong type, string instead of int - "total":100,"skip":"10","limit":10

When you run the Limit and skip products, the JSON returned shows the skip value returned is a String instead of an int.

Limit and skip products query:
https://dummyjson.com/products?limit=10&skip=10&select=title,price

Returns:
"total":100,"skip":"10","limit":10

The skip is a String instead of an int.

In the documentation https://dummyjson.com/docs/products/#limit_skip it shows that the skip value is an int not a String.

Output from documentation:

  "total": 100,
  "skip": 10,
  "limit": 10

If you run the query https://dummyjson.com/products the return skip value is an int.

Output:
"total":100,"skip":0,"limit":30

Any thoughts? Is this correct or should it match and the skip value returned should be an int.
Thank you.

Proposal to Add an API /me

Hi,

First of all, I want to thank you for the DummyJSON API, which I find very useful.

However, I noticed that there is no "/me" API to check if the token is still valid, and I find that quite unfortunate.

Can I do it myself? Or can you implement it? This would really add the missing functionality.

Thank you in advance.
Best regards.

Allow for both methods of multiple search query values

I tried to GET 'https://dummyjson.com/products?select=thumbnail&select=price' but I got an internal server error. I know it's supposed to be 'https://dummyjson.com/products?select=thumbnail,price' but can you please make it possible to also query endpoints using the first method?

Authentication returns Invalid credentials

When you try to login via https://dummyjson.com/auth/login with username rshawe2 and password OWsTbMUgFc it returns the message: {"message":"Invalid credentials"}

I tried different username and passwords from https://dummyjson.com/users or from https://dummyjson.com/users?select=username,password with the same results.

Any ideas?
Thanks.

OpenApi json file support

Hi,
Thanks for this useful apis.
Is it possible to add openapi like swagger to this app? For example, a swagger.json file.
We could use this swagger.json file for generating different clients

JWT_SECRET to verify token

I was wondering if there is a public jwt secret we can use to verify the returned token got from the dummy auth, as the example states it returns a token:

{
   ...
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTUsInVzZXJuYW1lIjoia21pbmNoZWxsZSIsImVtYWlsIjoia21pbmNoZWxsZUBxcS5jb20iLCJmaXJzdE5hbWUiOiJKZWFubmUiLCJsYXN0TmFtZSI6IkhhbHZvcnNvbiIsImdlbmRlciI6ImZlbWFsZSIsImltYWdlIjoiaHR0cHM6Ly9yb2JvaGFzaC5vcmcvYXV0cXVpYXV0LnBuZz9zaXplPTUweDUwJnNldD1zZXQxIiwiaWF0IjoxNjM1NzczOTYyLCJleHAiOjE2MzU3Nzc1NjJ9.n9PQX8w8ocKo0dMCw3g8bKhjB8Wo7f7IONFBDqfxKhs"
}

but nowhere on the docs it says a secret to verify the token with, when I looked at the source I found that the secret gets stored in an environment variable, but I was wondering if there maby is a public secret that we can use to verify the tokens?

Docker image

There is a Dockerfile in the project, did you publish a ready-to-use image of DummyJSON on Dockerhub or on another registry?

HTTP 204 Mock failing

Hi,

Thanks for bringing us DummyJSON, that's a great tool I use a lot for prototyping.
Unfortunately I found out that using the 204 HTTP Mock route fail unexpectedly with the following error :

upstream connect error or disconnect/reset before headers. reset reason: protocol error

I tried to run DummyJSON localy and everything works as intented.
So, I dont know if it might be an error with Railway itself. But here is a way to reproduce.

image

Cheers,

Pagination isn't working

GitHub Issue Description:

Title: Issue with Localhost API Endpoint Returning Empty Array

Description:
I am currently experiencing an issue with the local development environment when trying to fetch data from the API endpoint http://localhost:3000/products?skip=5&limit=10. Strangely, the same request to the remote server https://dummyjson.com/products?skip=5&limit=10 works perfectly fine.

Problem:

Steps to Reproduce:

  1. Run the application locally.
  2. Make a GET request to http://localhost:3000/products?skip=5&limit=10.

Expected Behavior:

  • The local API should return data similar to the remote API.

Actual Behavior:

  • The local API returns an empty array.

Additional Information:

  • Both endpoints use the same parameters (skip and limit).
  • No error messages are displayed.

Environment:

  • Operating System: MacOS
  • Node.js Version: 20

How to Fix:
If anyone has encountered this issue or has insights into potential solutions, please share your thoughts on how to resolve this discrepancy between the remote and local API endpoints.

issue with add users

also when i try to add user it's increments the id but there's no any data saved.
Screenshot 13-Jan-23 12_22_14 AM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.