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. Its requests stay in this tab.
Sheet01 / 04
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. Its requests never reach a server.

The project has stateful mode on, which needs the Developer plan or above: the first read seeds 25 records, and writes last until the project's data TTL runs out, 1 day by default. 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 Fig 5.1
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 up to 24 of the endpoints it defines 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, or use the arrow keys on its lines, to see which import rule chose each type.
Sheet02 / 04
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

Rehearse the 429 before production does

Pick a per-minute limit and send faster than it allows. The window, the counter and the 4 headers follow the same rules as api.mockapi.com.

25 requests, 8 per second

Limit per minute
this minute 0 / 20 remaining 20 resets in -- second -- of 60
Response --
GET /users #--

--- Not sent

X-RateLimit-Limit
--
X-RateLimit-Remaining
--
X-RateLimit-Reset
--
Retry-After
--
Access-Control-Expose-Headers
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset,Retry-After
Body
Send 1 to see the response.

Shell loop
for i in $(seq 1 25); do curl -s -o /dev/null -w "%{http_code}\n" -H "x-api-key: $MOCKAPI_KEY" https://api.mockapi.com/users; sleep 0.125; done

  1. Note 1 Send 25 sends at 8 per second. The curl loop spaces its requests the same way: it sleeps 0.125 s after each one.
  2. Note 2 With Respect Retry-After on, a 429 pauses the loop until the window resets. The curl loop you copy does not read that header.
  3. Note 3 Hover or tap a stamp to read its request number, second and status, or focus the dial and use the arrow keys. Ink stamps passed; amber stamps got a 429.
  4. Note 4 A · Fixed windows allow a burst across the boundary: 20 at :59 and 20 at :00 all pass. Test your client for it.
Sheet03 / 04
DrawingLimit 20 per minute
StatusRuns in this tabNeeds JavaScript to run
Requests0
RevNone
Window0 / 20 · resets in --
How this runs

Rate limiting applies when a project turns it on. Without a value the limit is 60 per minute. The counter is per project per clock minute, so it is not a token bucket. Past the limit api.mockapi.com answers 429 before any latency.

X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and Retry-After are sent on 2xx responses too, not only on a 429, and CORS exposes them to fetch().

This figure's project has its own settings: the limit you pick (5 · 20 · 60 per minute) and no latency. Nothing here changes Fig 0.1, which keeps rate limiting on at 60 per minute. A request that passes returns rows from a fixed sample of real generator output. This figure's requests stay in this tab.

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 the API key.

  • 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 property type assignment in the dashboard
  • Roles & permissions
  • 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
  • 3 custom domains
  • Priority support

Enterprise

Unlimited requests, projects and endpoints, 10,000 stored records per model and SSO with OIDC. Custom terms through sales.

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. Stored records expire after the project's data TTL, 1 day by default and up to 30. 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.

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.

The response you build appears here

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.
Sheet04 / 04
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.