Free Product Catalog API — Mock REST API for Testing & Development
Prototyping e-commerce storefronts requires realistic product descriptions, prices, image URLs, categories, and stock levels. The Product Catalog API supplies mock catalog items spanning electronics, apparel, and accessories, along with filtering by category and product ID lookups.
Interactive Live API Explorer
/api/products
Retrieves a list of products. Supports optional query parameters for filtering (e.g., `?category=electronics&inStock=true`) and `limit` to control the number of products returned (e.g., `?limit=1`).
You can add or change query parameters in the path above (e.g., ?name=User).
/api/products/{productId}
Retrieves details for a specific product by ID. Replace {productId} with an ID like `prod_123`.
Replace placeholders (e.g., {userId}) with actual values in the path above. You can also add/edit query parameters (e.g., ?key=value).
/api/products
Adds a new product to the catalog.
/api/products/{productId}
Updates an existing product by ID. Replace {productId} with an ID like `prod_123`.
Replace placeholders (e.g., {userId}) with actual values in the path above.
/api/products/{productId}
Deletes a product by ID. Replace {productId} with an ID like `prod_456`.
Replace placeholders (e.g., {userId}) with actual values in the path above.
Code Integration Examples
// Free Product Catalog API - JavaScript Fetch Example
async function fetchProductCatalogAPI() {
try {
const response = await fetch('https://gen-endpoint.com/api/products', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log('Success:', data);
return data;
} catch (error) {
console.error('Fetch error:', error);
}
}
fetchProductCatalogAPI();Sample JSON Response
[
{
"id": "prod_123",
"name": "The Pragmatic Programmer",
"category": "Books",
"price": 29.99,
"stock": 150,
"imageUrl": "https://placehold.co/300x200.png",
"description": "From journeyman to master.",
"details": {
"pages": 352,
"author": "David Thomas, Andrew Hunt"
},
"reviews": [
{
"rating": 5,
"comment": "A must-read!"
}
],
"createdAt": "2024-01-10T10:00:00Z"
}
]Common Developer Use Cases
Building e-commerce product grids, detail pages, and search filters.
Testing responsive image galleries and price formatting logic.
Integrating with shopping cart state and checkout prototypes.
Practicing infinite scroll or pagination in React, Vue, or Angular.
Related Free REST APIs
Shopping Cart API
Manage shopping cart operations with session handling, item management, and checkout preparation.
Inventory Management API
Track stock levels, handle reservations, manage warehouses, and process stock adjustments.
Payment Processing API
Handle payment flows, refunds, and transaction history with multiple payment methods.
Advanced Search API
Demonstrates complex querying, filtering, sorting, and pagination with full-text search capabilities.
Frequently Asked Questions
What fields are included in each product object?
Each item contains an id, title, price, description, category, image URL, rating, and inventory count.
Can I filter by category?
Yes, use query parameter ?category=electronics or query GET /api/categories for the list of available categories.
Are product images real URLs?
Yes, product images use placeholder service URLs that render cleanly in frontend UI components.