Backend · Demo
API Mom
A mock REST API for users and movies, with CORS, pagination, and a live request console.
- Category
- Backend
- Status
- Demo
- Stack
- PHP, REST, JSON

Overview
API Mom is a PHP mock backend for frontend work. It is not a production service. It exposes REST endpoints for users and movies, always as JSON, with CORS headers so a local React or other SPA can call it without a proxy.
The users API covers list, get-by-id, create, update, and delete. List calls accept page and limit (default 10, max 100). Each user has name, email, phone, nested address, company, website, and timestamps.
The movies API adds catalog behavior: twelve sample titles, twelve categories, search across title/description/director/cast, filters (category, year, rating, IMDB score, featured), and sort (title, year, score, duration, box office). HTML consoles — unified-demo, users demo, and movies demo — let you fire requests without a REST client.
Features
- REST users. GET/POST /api/users and GET/PUT/DELETE /api/users/{id} with validation and error payloads.
- REST movies and categories. Full movie CRUD plus GET /api/categories and GET /api/categories/{id} with movie counts.
- Pagination. page and limit on collection endpoints, with total and total_pages in the users list response.
- Movie search and filters. Query params for category, year, rating, min_score, featured, search, sort, and order.
- CORS and JSON. Cross-origin requests enabled; responses are JSON with standard HTTP status codes.
- Request consoles. unified-demo.html, demo.html, and movies-demo.html to exercise endpoints in the browser.
Technologies
Backend
- PHP
- REST
- JSON responses
- CORS headers
- Input validation
Resources
- Users mock data
- Movies catalog
- Category index
- Pagination metadata
Demos
- unified-demo.html
- demo.html (users)
- movies-demo.html
- router.php
Pages
Routes below are the screens in the live demo. Open the app in a new tab and append a path after the demo URL.
| Route | Page | What it does | Access |
|---|---|---|---|
/ | Unified console | Default route that opens the unified request console. | Public |
/unified-demo.html | Unified console file | Direct file route for users and movies in one page. | Public |
/demo.html | Users demo | Console focused on the users resource. | Public |
/movies-demo.html | Movies demo | Console focused on movies and categories. | Public |
API endpoints
Collection endpoints support page and limitwhere applicable. Resource-specific filters and sorting are listed below by endpoint.
| Method | Endpoint | What it does |
|---|---|---|
GET | /api/users | List users with page and limit. |
GET | /api/users/{id} | Fetch one user. |
POST | /api/users | Create a user. |
PUT | /api/users/{id} | Update a user. |
DELETE | /api/users/{id} | Delete a user. |
GET | /api/movies | List movies with search, filters, sort, and pagination. |
GET | /api/movies/{id} | Fetch one movie. |
POST | /api/movies | Create a movie. |
PUT | /api/movies/{id} | Update a movie. |
DELETE | /api/movies/{id} | Delete a movie. |
GET | /api/categories | List categories with movie counts. |
GET | /api/categories/{id} | Fetch one category and its count. |