MockApiHub — Documentation
Everything you need to call the API, test endpoints, and drop code into your app.
Get Started
- Confirm your base URL: https://mockapihub.com
- Hit your first endpoint: https://mockapihub.com/api/users
- Open the Playground to try requests interactively. Playground
Base URL
By default, requests are served from the same origin.
https://mockapihub.com
Endpoints
Writes (POST / PATCH / DELETE) return a realistic, shape-correct response but data is not persisted. The next GET returns the same deterministic data as before.
| Method | Path | Description |
|---|---|---|
| GET | /api/users | List users (search & paginate) |
| GET | /api/users/:id | Get user by ID |
| POST | /api/users | Create a user — not persisted, returns the new shape. |
| PATCH | /api/users/:id | Update a user — not persisted, echoes the patch. |
| DELETE | /api/users/:id | Delete a user — not persisted, returns { success: true, id }. |
| GET | /api/users/:id/posts | List posts authored by this user. |
| GET | /api/users/:id/todos | List todos owned by this user. |
| GET | /api/posts | List posts (search & paginate) |
| GET | /api/posts/:id | Get post by ID |
| GET | /api/posts/:id/comments | List comments on this post. |
| GET | /api/products | List products |
| GET | /api/recipes | List recipes |
| GET | /api/todos | List todos |
| GET | /api/comments | List comments |
OpenAPI & Postman
Try every endpoint live, download the spec, or import it into Postman in one click.
Auth
Almost all endpoints are public, but some may require keys. In that case, send:
Authorization: Bearer <access_key>
Examples
cURL
BASH
curl "https://mockapihub.com/api/users"JavaScript (fetch)
JS
await fetch("https://mockapihub.com/api/posts")
.then(r => r.json())Python
PY
import requests
res = requests.get("https://mockapihub.com/api/users")
print(res.json())