Got tired of fake dataset?
PseudoJson provides a variety of REST endpoints that deliver JSON data, allowing you to focus on front-end development using your preferred frameworks and libraries without the need to develop a backend.
Example Code
fetch('https://pseudojson.com/products/1')
.then(res => res.json())
.then(json => console.log(json))
{
"message": "Hello, World!"
}
Resources
PseudoJson comes with different sets of common resources:
Products endpoints:
Method | Endpoint | Description |
---|---|---|
GET | /products | Returns a list of all products. |
GET | /products/1 | Fetch product with id 1. |
GET | /products/2 | Fetch product with id 2. |
GET | /products/category/smartphones | Fetch products which has the category smartphones. |
POST | /products | Adds a new product to the database. Requires a JSON payload with product details. Body: |
{
"brand": "Apple",
"category": "smartphones",
"description": "An apple mobile which is nothing like apple",
"discountPercentage": 12.96,
"id": 31,
"images": [
"https://unsplash.com/photos/a-close-up-of-a-person-holding-a-cell-phone-KX_7S9bXYjY"
],
"price": 1449,
"rating": 12.69,
"stock": 188,
"thumbnail": "https://unsplash.com/photos/a-close-up-of-a-person-holding-a-cell-phone-KX_7S9bXYjY",
"title": "iPhone 15 pro"
}
Headers:
Content-Type: application/json
Response Examples:
Success - 201 Created:
{
"_id": "mongodb_generated_id",
"id": "unique_product_id",
"title": "Product Title",
"price": 100,
"category": "Category Name",
// Additional fields...
}
Error - 400 Bad Request (Missing ID):
{
"error": "ID is required"
}
Error - 409 Conflict (ID already exists):
{
"error": "Product with this ID already exists"
}
**Note:** by default you will get 30 results and the total count, you can pass "skip" & "limit" query string to get more results. For example: /products?skip=5&limit=10