Back to home

Introduction

MockLab is a hosted fake REST API. You describe a resource — its fields and their types — and you get a real, working REST endpoint back: full CRUD, pagination, sorting, filtering, and search, backed by realistic generated data. No server to write, no database to seed, no fixture files to keep in sync with a schema that keeps changing.

The core idea: generate, don't store

Most fake-API tools work by inserting rows into a real database up front, which means the amount of data you can request is capped by how many rows someone was willing to insert — a few hundred, maybe a few thousand. MockLab works differently. Every record is computed deterministically from your resource's seed and the record's index, at the moment you request it. Ask for record #41 and the server runs a small, fast pseudo-random generator seeded from (seed, 41) and produces the same fields every time — on any server, in any process, without ever touching a database. Ask for 1,000,000 records and the response streams out the same way; the only thing that scales with count is how much you ask for in one page, never how much the server has to store.

The one thing that is stored is your own edits. When you POST, PUT, PATCH, or DELETE a record, that change is saved as a small override layered on top of the generated baseline. A read request merges your overrides into the generated stream, filters and sorts the result, and returns a page. Reset a resource and the overrides disappear — you're back to the pure generated data, byte for byte identical to before you touched it.

What you get per resource

  • A live REST endpoint at https://mocklab.dev/m/{project-key}/{resource-name}
  • GET (list, with pagination/sort/filter/search) and GET (single record)
  • POST, PUT, PATCH, DELETE — a real write path, not a read-only mock
  • CORS enabled by default, so you can call it straight from a browser
  • A fake-data locale independent of your own UI language, so en, ru, and others generate realistic names, cities, and addresses in that language

Who this is for

Frontend developers who need a backend before the real one exists, students learning to consume a REST API without standing up their own server, and anyone prototyping a UI who doesn't want a database migration to be step one. If you've used a record-limited fake-API service before and hit its ceiling, the rest of these docs will feel familiar — same conventions, no ceiling.

Continue to Quick start to have a live endpoint running in about five minutes, or jump to Schema and field types for the full field reference.

const response = await fetch("https://mocklab.dev/m/demo7k2m9x/products");
const products = await response.json();
import { useQuery } from "@tanstack/react-query";

function ProductList() {
  const { data: products, isPending } = useQuery({
    queryKey: ["products"],
    queryFn: () => fetch("https://mocklab.dev/m/demo7k2m9x/products").then((res) => res.json()),
  });

  if (isPending) return <p>Loading…</p>;
  return (
    <ul>
      {products.map((product) => (
        <li key={product.id}>{product.title}</li>
      ))}
    </ul>
  );
}