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
Method | Path | Description |
---|---|---|
GET | /api/users | List users (search & paginate) |
GET | /api/users/:id | Get user by ID |
GET | /api/posts | List posts (search & paginate) |
GET | /api/posts/:id | Get post by ID |
GET | /api/products | List products |
GET | /api/recipes | List recipes |
GET | /api/todos | List todos |
GET | /api/comments | List comments |
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())