Skip to content

Create a mock REST API

Create fake JSON endpoints with your own method, path, status, delay and body or generated fake data, served with CORS from our server for prototyping and tests.

Use :name for a parameter, e.g. /users/:id

Response body
Delay0 ms

Strings like "{{fullName}}" or "{{int(1, 100)}}" are replaced on every request.

items

0 returns a single object

Placeholders (36)
{{id}}
1, 2, 3… position in the list
{{index}}
0, 1, 2… zero-based position
{{uuid}}
Random UUID v4
{{firstName}}
Given name
{{lastName}}
Family name
{{fullName}}
Given and family name
{{username}}
Lowercase handle
{{email}}
Address at example.com
{{phone}}
Phone number (+1 555…)
{{company}}
Company name
{{jobTitle}}
Job title
{{street}}
Street address
{{city}}
City
{{country}}
Country
{{countryCode}}
ISO 3166 code
{{zip}}
5-digit postal code
{{domain}}
example domain
{{url}}
https URL
{{ipv4}}
Documentation-range IPv4
{{color}}
HEX color
{{word}}
One lorem word
{{words}}
words(n): n lorem words
{{sentence}}
Lorem sentence
{{paragraph}}
Three to five sentences
{{int}}
int(min, max): whole number
{{float}}
float(min, max, decimals)
{{price}}
price(min, max): two decimals
{{bool}}
true or false
{{date}}
Date in the past year (YYYY-MM-DD)
{{datetime}}
ISO date-time in the past year
{{futureDate}}
Date in the next year
{{status}}
active, pending or inactive
{{pick}}
pick(a, b, c): one of the options
{{param}}
param(name): value from the URL path, e.g. :id
{{query}}
query(name): value from the query string
{{null}}
JSON null
Response headers (optional, X- only)
3 / 10 endpoints · JSON responses with CORS enabled
Processed on our server · endpoint JSON kept until you delete it or 7 days pass without a requestHow it works

How to use Mock REST API

  1. 1

    Describe each endpoint

    Pick a method, type a path such as /users/:id and choose the status code and an optional delay to imitate a slow network.

  2. 2

    Write the response

    Paste fixed JSON, or switch to Fake data and write a template with placeholders like {{fullName}} and a list size.

  3. 3

    Create the mock API

    Click Create mock API to get a base URL; every endpoint answers at that URL plus its path, with CORS enabled.

  4. 4

    Call it and iterate

    Use Try, curl or fetch from your app, then edit and save — changes apply immediately — or delete the mock when you're done.

Limits and Pro

Free: 10 endpoints per mock API, 100 KB per body and 512 KB in total, delays up to 5 seconds, generated lists up to 100 items, 120 requests a minute per visitor, 10 new mock APIs an hour, deleted after 7 days without requests.

Pro raises the limits to 50 endpoints, 1 MB bodies, 30-second delays and lists of 1,000 items. See Pro

About Mock REST API

Mock REST API gives front-end and mobile developers working endpoints before the real back end exists. Each mock API has its own base URL under /api/mock-api/m/, and every endpoint you define answers there with the method, path, status code, delay, headers and JSON body you chose. Paths can contain parameters, so /users/:id matches /users/7, and a template can echo that value back with {{param(id)}} or read the query string with {{query(name)}}.

Fake data mode turns a JSON template into realistic responses using 36 placeholders, from names, emails, companies and cities to UUIDs, dates, prices, numbers in a range and lorem text. Set a list size to return an array of up to 100 items, and decide whether the data stays the same between requests, which suits snapshot tests, or changes every time. Status codes from 200 to 599 let you rehearse error states such as 401, 404, 429 and 503, and a delay of up to five seconds shows how your loading states behave.

Responses are always JSON with CORS headers, so browsers on any origin can call them. A mock API cannot serve HTML, set cookies or redirect, it does not store the requests it receives, and it is not a database: POST and PUT answer with your configured body without saving anything sent to them.

Privacy

To host your endpoints, the definitions you save — methods, paths, status codes, delays, headers and bodies — are sent to and stored on our server, together with a hashed edit token, the creation and last-request times and a request count. Requests to your endpoints are answered without logging their bodies, headers or IP addresses. A mock API is deleted when you delete it or after 7 days without a request or an edit, and the edit token is kept only in this browser. Anyone with the URL can call your endpoints, so don't put secrets or real personal data in them.

Features

Real HTTPS endpoints

Any method, path parameters, status codes from 200 to 599, delays and custom X- headers.

Fake data templates

Over 30 placeholders for people, companies, places, dates, numbers and text, as one object or a list.

Safe by design

JSON only, CORS on, no request logs, edit token hashed, deleted after 7 days without use.

Mock REST API: frequently asked questions

What is stored on your server and for how long?
We store the endpoint definitions you save, a SHA-256 hash of your edit token, when the mock API was created and last called, and how many requests it received. We do not log request bodies, headers or IP addresses. Each mock API is deleted when you press Delete, or automatically once 7 days pass without any request or edit, so an API you keep using stays available.
Can I call the mock API from my front-end app?
Yes. Every response carries Access-Control-Allow-Origin set to *, and preflight OPTIONS requests are answered, so fetch, axios or any browser HTTP client on any domain, including localhost, can call it. Use the base URL plus your endpoint path, for example fetch(base + "/users"). Mobile apps, Postman and curl work too, since the endpoints are ordinary HTTPS URLs.
How do fake data placeholders work?
In Fake data mode, any string in your JSON template that is a placeholder, such as "{{email}}" or "{{int(1, 100)}}", is replaced when a request arrives, and whole-string number and true or false placeholders become real JSON numbers and booleans. Placeholders can also sit inside text, like "Hello {{firstName}}". Set a list size to repeat the template, with {{id}} counting 1, 2, 3 for each item.
Can a mock return errors or slow responses?
Yes. Choose any status from 200 to 599, such as 401 Unauthorized, 404 Not Found, 422 for validation errors, 429 Too Many Requests or 503, and write the error JSON your app expects. The delay slider holds each response for up to 5 seconds on the free plan, which helps test spinners, timeouts and retry logic. Status 204 and 304 answers are sent without a body.
Why can't a mock API return HTML or set cookies?
Free hosted endpoints that return any content are a favourite tool for phishing pages and malware links. To keep these mocks useful only as APIs, every response is application/json with nosniff and a locked-down content security policy, and only custom headers that start with X- are allowed, so mocks cannot set cookies, redirect browsers or pretend to be a web page.
All developer tools