Build your React UI without waiting for the backend. Rest Faker gives you a real REST API with live CRUD endpoints and realistic fake data — call it with fetch, Axios, or TanStack Query just like a production backend.
Frontend work stalls when backend endpoints aren't ready. You end up building with hardcoded data that doesn't reflect real API shapes.
Mock Service Worker is powerful but adds configuration, service worker files, and handler boilerplate before you can start building UI.
Local mocks don't work when you share a preview URL. Stakeholders see broken requests instead of the feature you built.
Replace your API URL with your Rest Faker endpoint. That's it.
With fetch (useEffect)
import { useState, useEffect } from "react";
const BASE = "https://api.restfaker.dev/api/schema";
const TOKEN = "YOUR_API_TOKEN";
export function UserList() {
const [users, setUsers] = useState([]);
useEffect(() => {
fetch(`${BASE}/users?perPage=10`, {
headers: { apiToken: TOKEN },
})
.then(r => r.json())
.then(({ data }) => setUsers(data));
}, []);
return (
<ul>
{users.map(u => (
<li key={u.id}>{u.name} — {u.email}</li>
))}
</ul>
);
}With TanStack Query
import { useQuery, useMutation } from "@tanstack/react-query";
const BASE = "https://api.restfaker.dev/api/schema";
const TOKEN = "YOUR_API_TOKEN";
// Fetch users
export function useUsers() {
return useQuery({
queryKey: ["users"],
queryFn: () =>
fetch(`${BASE}/users`, {
headers: { apiToken: TOKEN },
}).then(r => r.json()),
});
}
// Create a user
export function useCreateUser() {
return useMutation({
mutationFn: (data) =>
fetch(`${BASE}/users`, {
method: "POST",
headers: {
apiToken: TOKEN,
"Content-Type": "application/json",
},
body: JSON.stringify(data),
}).then(r => r.json()),
});
}With Axios
import axios from "axios";
const api = axios.create({
baseURL: "https://api.restfaker.dev/api/schema",
headers: { apiToken: "YOUR_API_TOKEN" },
});
// GET with pagination and sorting
const { data } = await api.get("/products", {
params: { page: 1, perPage: 20, sort: "price", order: "asc" },
});
// PATCH an existing record
await api.patch(`/products/${id}`, { price: 29.99 });Rest Faker endpoints include the right CORS headers so your React dev server can call them directly.
POST, PATCH, and DELETE actually mutate the data. Your mock API behaves like a real backend.
Hit regenerate in the dashboard to get fresh records whenever you need a clean state.
Login and token endpoints for testing authentication flows in your React app.
Download TypeScript interfaces that match your schema for type-safe API calls.
The same endpoint works for every team member — no local setup, just a URL.
No service worker setup — just a URL, works from day one
CORS headers included — call the API from any React dev server
Realistic data — real names, emails, addresses — not lorem ipsum
Mutations persist — POST and PATCH actually change the data
Works in Vercel previews — the endpoint is live, not localhost
Exportable types — download TypeScript interfaces for your schema
Live endpoint in 30 seconds. No backend, no credit card, no service worker.
Related use cases