Skip to content

Mock APIs you can call before the backend exists.

Hosted REST and GraphQL mocks with realistic data, stateful CRUD, latency, rate limits and failure scenarios. Import an OpenAPI spec, or let your AI agent build the mock over MCP.

The Free plan includes 3 projects and 500 requests a month per project.

MCP server https://mcp.mockapi.com/api/mcp Connect Cursor, Claude or ChatGPT

Elevation · Team screen · scale 1:1

Store
Not seeded

The first GET /users seeds 25 users. Writes persist in this tab.

Revisions
RevRequestStatusChange
AGET /usersnot sentSeeds 25 users on the first read
  1. Note 1 Click the screen or press Send GET /users. Move across the table to cut a section.
  2. Note 2 Keyboard: Tab to the table, arrows move the cut, Enter sends and then pins a row, Esc clears.
  3. Note 3 Demo project: stateful mode on (Developer plan and above), rate limit 60 per minute, latency Random 38-140 ms. Nothing leaves this tab.
Sheet01 / 03
DrawingTeam screen · GET /users
StatusRuns in this tabNeeds JavaScript to run
Requests0
RevNone
LastGET /users · not sent
How this runs

This screen is served by a copy of the api.mockapi.com runtime rules running in your browser. Nothing is sent to a server.

The project has stateful mode on, which needs the Developer plan or above: the first read seeds 25 records, and writes persist. On the Free plan every GET returns freshly generated data.

The rows are a fixed sample of real generator output, so every visitor starts from the same page; hosted projects generate new values each time a store is seeded.

Do this on your project

Every figure on this page runs the rules your mock runs.

Project spec

Stateful
on · 25 records seeded on first read · Developer plan and above Fig 0.1
Rate limit
60 per minute · fixed clock-minute window Simulation docs
Latency
Random 38-140 ms · 4 modes up to 10 s Simulation docs
Scenarios
6 examples, chosen per request with X-MockAPI-Scenario Simulation docs
Locale
en · 62 locales available Data generation docs
Data types
140+ types · linked models Model builder demo
Imports
OpenAPI 3 · Swagger 2 · Postman · JSON sample · GraphQL SDL Fig 1.1
Hosts
api.mockapi.com · graphql.mockapi.com · mcp.mockapi.com Docs
Also
Contract drift · request logs · teams (Developer and above) Docs
Price
Free plan · Developer $4.99 per month Pricing

Works with any client that speaks HTTP

  • React
  • Next.js
  • Vue
  • Angular
  • Svelte
  • React Native
  • Flutter
  • Swift
  • Kotlin
  • Cypress
  • Playwright
  • Jest
  • Postman
  • Cursor
  • Claude Code
  • Storybook

Bring your own API

Drop an OpenAPI 3, Swagger 2 or Postman file, or a JSON sample. It is parsed in this tab and never uploaded. Call the endpoints before you create an account.

Operations

Models

  • Order
    • id → id (name rule, sequential)
    • customerEmail → email (name rule)
    • items → Book[] (linked model)
    • quantity → number (integer)
    • shippingAddress → address (name rule)
    • createdAt → date (name rule)
  • Author
    • id → id (name rule, sequential)
    • name → fullName (name rule)
    • email → email (name rule)
    • country → country (name rule)
    • website → url (name rule)
    • books → Book[] (linked model)
  • Book
    • id → id (name rule, sequential)
    • isbn → string (fallback)
    • title → sentence (name rule)
    • author → object (object)
    • price → price (name rule)
    • publishedOn → date (format date)
    • inStock → boolean (boolean)

  1. Note 1 Drop a file anywhere on this page.
  2. Note 2 Click an endpoint to call it.
  3. Note 3 Move across the response to see which import rule chose each type.
Sheet02 / 03
Drawingbookshop.yaml
StatusRuns in this tabNeeds JavaScript to run
Requests0
RevA
Fileopenapi 3.0.3 · 3 models · 8 operations · sample, committed fixture
Coverage8 of 8 operations have a response model
Plan fitFits the Free plan: 5 endpoints, 3 models
How this runs

Parsed in this tab with the dashboard import's own parser and type rules. Nothing is uploaded.

On the Developer plan and above, the import can also suggest AI type changes for you to review; the drawing shows the types before that review.

An operation without a response model, such as one whose response schema is inline, is imported without one and returns {"data":{}} until you attach a model.

A reference to a model the import creates later cannot be linked, so the type rules type it: in the sample, Book.author is {}.

Values are a fixed sample of real generator output per type; a new project generates new ones on every request. Emails show at example.com; the email type uses common mail domains.

The endpoints answer as a new Free project does: generated data, no rate limit, no simulated latency.

Do this on your project

For AI agents

Give your AI agents a safe API sandbox

Connect Cursor, Claude Code, Claude Desktop or ChatGPT over the Model Context Protocol. Agents create projects, models and endpoints from a prompt, import OpenAPI specs and Postman collections, and turn on stateful mode, all against an isolated mock instead of production.

  • Create projects, models and REST or GraphQL endpoints from a prompt
  • Import OpenAPI specs and Postman collections automatically
  • Seed stored records for every model with stateful mode (Developer plan and above)
  • No risk to production data. Every call goes to an isolated mock
Set up MCP in 2 minutes

Cursor · Claude · ChatGPT

{
  "mcpServers": {
    "mockapi": {
      "url": "https://mcp.mockapi.com/api/mcp",
      "headers": {
        "Authorization": "Bearer mockapi_mcp_…"
      }
    }
  }
}

Prompt

Create a mock API for a todo app with users and tasks. Tasks belong to a user and have a due date.

Agent

  • create_project → todo-app
  • create_model → User, Task (task.userId → User)
  • create_rest_endpoint → 8 endpoints
  • Live at https://api.mockapi.com/tasks

Use cases

One mock layer for every team that builds on your API

Build the UI before the backend exists

Agree on the contract, mock it in minutes and build screens in parallel. When the real API ships, change the base URL and nothing else.

  • Realistic data shows layout problems early: long names, empty states, edge cases
  • Stateful CRUD means forms, lists and detail pages actually work
  • CORS is on by default, so you can call it from localhost

Compare

Why teams move to MockAPI

Local mock scripts and recorded stubs break the moment your API changes. MockAPI is hosted, shared by your whole team and generated from your API contract.

MockAPIjson-server / local scriptsPostman mock serversWireMock / Prism (self-hosted)
Hosted URL your whole team shares
Generate from OpenAPI / Postman
Realistic generated data
Stateful CRUD
Scenarios, latency & rate limits
GraphQL mocking
MCP server for AI agents
No infrastructure to maintain
SupportedPartial / manualNot supportedSee detailed comparisons →

Pricing

Start free and upgrade when you need more

Every plan includes REST and GraphQL mocking, realistic data and scenarios. Paid plans add higher limits, stateful CRUD and team features.

Save 20%

Free

For trying things out and side projects

$0/mo

Free forever

Start free
  • 500 requests/mo per project
  • 3 projects
  • 25 endpoints / project
  • 1 team member
  • 3-day request logs
  • REST & GraphQL mocking
  • Scenarios, latency & rate limits
  • OpenAPI & Postman import
  • Stateless responses
  • Community support

Developer

For individual developers shipping real apps

$3.99/mo

$47.88 billed annually

Start with Developer

Everything in Free, plus:

  • 50,000 requests/mo per project
  • 25 projects
  • 100 endpoints / project
  • 5 team members
  • 7-day request logs
  • Stateful CRUD · 100 records/model
  • AI-assisted data generation
  • Email support

Business

For organizations running mocks at scale

$39.99/mo

$479.88 billed annually

Start with Business

Everything in Team, plus:

  • 1,000,000 requests/mo per project
  • 500 projects
  • Unlimited endpoints & models
  • Unlimited team members
  • 90-day request logs
  • Stateful CRUD · 5,000 records/model
  • Management API for CI/CD
  • Priority support

Enterprise

SSO/SAML, audit logs, custom SLAs, dedicated support and private deployment options.

Talk to sales

Cancel anytime. Prices in USD.

Compare all plan features →

FAQ

Questions, answered

What is MockAPI?

MockAPI is a hosted platform for creating mock REST and GraphQL APIs. You define or import your API, and MockAPI serves realistic, generated responses at a stable URL, with optional stateful CRUD, latency, rate limiting and failure scenarios. Frontend, mobile, QA and AI agents can build against it before the real backend exists.

Is MockAPI free?

Yes. The Free plan is free forever and needs no credit card. It includes 500 mock requests per month per project, 3 projects and 25 endpoints per project, with REST, GraphQL, realistic data and scenarios. Paid plans start at $4.99/month and add stateful CRUD, higher limits and team features.

Can I import my OpenAPI (Swagger) spec or Postman collection?

Yes. Import OpenAPI 3.x, Swagger 2.0 or a Postman collection and MockAPI creates the models and endpoints for you. You can also import a JSON sample, and re-check your mocks against a newer spec later with contract drift detection.

What is stateful mode?

In stateful mode your mock keeps data across requests: POST creates a record, GET returns it, PATCH and PUT update it and DELETE removes it, with pagination, filtering and sorting. It's available on the Developer plan and above.

Does MockAPI support CORS?

Yes. CORS is enabled on every mock endpoint by default, so you can call your mock directly from a browser app running on localhost or any domain.

How do I simulate errors, latency and rate limits?

Create named scenarios (for example payment-declined or rate-limited) and select one per request with the X-MockAPI-Scenario header, or set a default. Projects can also add latency profiles and per-minute rate limits that return real 429 responses and X-RateLimit headers.

Can AI agents like Cursor and Claude use MockAPI?

Yes. MockAPI ships a Model Context Protocol (MCP) server. Connect it to Cursor, Claude Code, Claude Desktop or any MCP client by signing in or with an API key, and agents can create projects, models and endpoints, import specs and turn on stateful mode.

Can I use MockAPI in CI/CD?

Yes. Mock URLs are stable and authenticated with an API key, so they work in Cypress, Playwright, Jest, Postman/Newman or any test runner. The Business plan adds a Management API to manage mocks programmatically.

Is the demo on this page a real mock?

Every figure on this page runs the rules your mock runs. A small copy of the MockAPI runtime rules runs in your browser, with the same status codes, error bodies, pagination, latency modes and rate limit headers as api.mockapi.com. The requests you send from the figures are answered in your browser and never reach a server. Your own projects run on api.mockapi.com and graphql.mockapi.com.

This is the response you built

The last request you send from Fig 0.1 appears here, with its response, curl and fetch.

not sent GET /users?limit=8&sortBy=createdAt&sortOrder=desc

Nothing sent yet. Send a request from Fig 0.1 and its response appears here.

Session log, newest first
FigureRequestStatusTimeCopy
No requests yet. Send one from Fig 0.1.
  1. Note 1 Each row is a request sent from Fig 0.1.
  2. Note 2 Copy any row as curl.
Sheet03 / 03
DrawingGET /users
StatusRuns in this tabNeeds JavaScript to run
Requests0
RevNone
How this runs

Requests sent from the figures on this page run through one copy of the api.mockapi.com runtime rules in your browser. They are answered there and never reach a server.

A request the project's rate limit refused counts as rate limited. An error response from a scenario picked with X-MockAPI-Scenario counts as failed on purpose.

In place of a key, curl prints $MOCKAPI_KEY and fetch prints MOCKAPI_KEY. Set that variable to your own project's key and give the project an endpoint for the path, and the request runs against api.mockapi.com.

Record ids in PATCH and DELETE paths come from this tab's store, not from your project. With stateful mode on (Developer plan and above), use one of its own record ids. Without it, an endpoint with {id} in its path answers any id.

Do this on your project

A click saves this project in this browser if it allows storage. Your dashboard then offers to create its User model, /users endpoints, scenarios, rate limit and latency. Replace $MOCKAPI_KEY with its key.

On the Free plan, GET returns fresh data each time; stored writes need the Developer plan or above.

The Free plan includes 3 projects and 500 requests a month per project.