Skip to content

For frontend teams

Build the frontend before the backend exists

Agree on the contract, get a realistic mock API in minutes and ship screens in parallel. When the real API lands, change one base URL.

Free forever plan · No credit card required

src/api/client.ts
// Point at MockAPI today, your real API tomorrow.
const BASE_URL = import.meta.env.VITE_API_URL
  ?? 'https://api.mockapi.com'

export async function getUsers(page = 1) {
  const res = await fetch(`${BASE_URL}/users?page=${page}&limit=20`, {
    headers: { 'x-api-key': import.meta.env.VITE_MOCKAPI_KEY },
  })
  return res.json()
}

Blocked on the backend

Sprints stall while endpoints are designed, built and deployed.

Hard-coded fixtures

JSON files in the repo drift from the real API and hide edge cases.

Localhost-only mocks

Preview deployments, designers and phones cannot reach your laptop.

What you get

Realistic, varied data

Long names, missing avatars, big numbers and many locales make layouts honest.

Stateful CRUD

Forms, lists and detail pages actually work: what you POST shows up on the next GET.

Pagination, filters, sorting

Stateful endpoints support page, limit, sortBy, sortOrder and field filters, so you can build real tables and infinite scroll.

Empty, error and slow states

Switch scenarios per request to design every state, not only the happy path.

CORS on by default

Call your mock straight from localhost, Vercel previews or Storybook.

REST and GraphQL

Mock both from the same project, with a built-in GraphQL playground.

Get started in three steps

  1. 01

    Model your resources

    Create models in the UI, import an OpenAPI spec or paste a JSON sample.

  2. 02

    Create endpoints

    Pick methods, paths and response models. Turn on stateful mode for CRUD.

  3. 03

    Build against the URL

    Use your project API key and swap the base URL when the backend is ready.

FAQ

Common questions

Will my mock match the real API?

Yes, if you import the same OpenAPI spec your backend implements. Contract drift detection tells you when the spec and your mocks diverge.

Can I use MockAPI with React, Vue, Angular or Svelte?

Yes. Mocks are standard HTTPS endpoints, so any framework, HTTP client (fetch, axios, Apollo, urql) or data library (TanStack Query, SWR) works.

Is there a free plan?

Yes. It is free forever with no credit card. Stateful CRUD starts on the Developer plan.

Build against a mock API that behaves like your real one

Create your first endpoint in under two minutes.

Free forever · No credit card required