Mock API
Free REST API with mock data for products and food categories.
Free REST API with mock data for testing and prototyping. No authentication required.
Mock product data with categories, prices, stock status, and ratings.
/api/mock-api/productsGet all products (paginated)
Response Example:
{
"data": [
{
"id": 1,
"name": "Wireless Headphones",
"category": "Electronics",
"price": 79.99,
"currency": "USD",
"inStock": true,
"rating": 4.5,
"description": "High-quality wireless headphones...",
"imageUrl": "https://picsum.photos/200/200?random=1"
}
// ... more products
],
"pagination": {
"total": 10,
"page": 1,
"limit": 10,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
}
}/api/mock-api/products?page=2&limit=3Paginate products
Query Parameters:
page(number) - Page number (default: 1)limit(number) - Items per page (default: 10)Response Example:
{
"data": [
// ... products for page 2
],
"pagination": {
"total": 10,
"page": 2,
"limit": 3,
"totalPages": 4,
"hasNext": true,
"hasPrevious": true
}
}/api/mock-api/products?id=1Get a specific product by ID
Query Parameters:
id(number) - Product IDResponse Example:
{
"id": 1,
"name": "Wireless Headphones",
"category": "Electronics",
"price": 79.99,
"currency": "USD",
"inStock": true,
"rating": 4.5,
"description": "High-quality wireless headphones...",
"imageUrl": "https://picsum.photos/200/200?random=1"
}/api/mock-api/products?category=ElectronicsFilter products by category
Query Parameters:
category(string) - Electronics | AccessoriesResponse Example:
{
"data": [
// ... filtered products
],
"pagination": {
"total": 5,
"page": 1,
"limit": 10,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
}
}/api/mock-api/products?inStock=trueFilter by stock availability
Query Parameters:
inStock(boolean) - true | falseResponse Example:
{
"data": [
// ... in-stock products
],
"pagination": {
"total": 9,
"page": 1,
"limit": 10,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
}
}How to Use
JavaScript / Fetch:
fetch('/api/mock-api/products')
.then(response => response.json())
.then(data => console.log(data));cURL:
curl /api/mock-api/productsAll endpoints are completely free to use. No authentication required.
Standard REST API patterns with JSON responses. Perfect for testing and prototyping.
Use query parameters to filter results, paginate data (page & limit), and get specific items.
Cross-Origin Resource Sharing (CORS) is enabled, so you can use it from any domain.
Great for learning, testing, or building demo applications without setting up a backend.
All data is static and reset-proof - perfect for consistent testing and demos.