Back to QuickTools

Mock API

Free REST API with mock data for products and food categories.

Mock API - Free REST API

Free REST API with mock data for testing and prototyping. No authentication required.

Base URL:

Mock product data with categories, prices, stock status, and ratings.

GET
/api/mock-api/products

Get 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 ] }
GET
/api/mock-api/products?id=1

Get a specific product by ID

Query Parameters:

id(number) - Product ID

Response 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" }
GET
/api/mock-api/products?category=Electronics

Filter products by category

Query Parameters:

category(string) - Electronics | Accessories

Response Example:

{ "total": 5, "products": [ // ... filtered products ] }
GET
/api/mock-api/products?limit=5

Limit the number of results

Query Parameters:

limit(number) - Number of items to return

Response Example:

{ "total": 5, "products": [ // ... limited products ] }
GET
/api/mock-api/products?inStock=true

Filter by stock availability

Query Parameters:

inStock(boolean) - true | false

Response 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/products
Tips
  • All 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.