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
Response Example:
{
"total": 10,
"products": [
{
"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
]
}/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:
{
"total": 5,
"products": [
// ... filtered products
]
}/api/mock-api/products?limit=5Limit the number of results
Query Parameters:
limit(number) - Number of items to returnResponse Example:
{
"total": 5,
"products": [
// ... limited products
]
}/api/mock-api/products?inStock=trueFilter by stock availability
Query Parameters:
inStock(boolean) - true | falseResponse Example:
{
"total": 9,
"products": [
// ... in-stock products
]
}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, limit data, 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.