MockApiHub — Documentation

Everything you need to call the API, test endpoints, and drop code into your app.

Get Started

  1. Confirm your base URL: https://mockapihub.com
  2. Hit your first endpoint: https://mockapihub.com/api/users
  3. Open the Playground to try requests interactively. Playground

Base URL

By default, requests are served from the same origin.

https://mockapihub.com

Endpoints

MethodPathDescription
GET/api/usersList users (search & paginate)
GET/api/users/:idGet user by ID
GET/api/postsList posts (search & paginate)
GET/api/posts/:idGet post by ID
GET/api/productsList products
GET/api/recipesList recipes
GET/api/todosList todos
GET/api/commentsList 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())
Documentation — MockApiHub