Mock API Builder (Endpoints & Mock Server)
Design mock endpoints with rules and fake data, try them here, then export a mock server.
Try before you buy.
- Free preview: your first 3 routes built and tried in the page, with every check, and the first lines (up to 20) of each export file.
- Locked until you unlock it: download and copy.
- Unlock: Premium pass, ₹799 for 30 days or ₹249 for 1 week, a one-time payment that never renews. Unlock: Premium pass, $19.99 for 30 days or $7.99 for 1 week, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Routes
Import (OpenAPI, Swagger, HAR, Postman, Mockoon)
Importing replaces the routes and collections below. The file is read in your browser.
No routes yet: add one, press Example, or import a file.
Collections (create, read, update, delete)
Each collection answers GET and POST on /name and GET, PUT, PATCH and DELETE on /name/:id, keeping its records in memory.
Template help
{{params.id}}a path parameter,{{params.*}}the rest of a path matched by *{{query.page}}a query parameter,{{headers.user-agent}}a header{{body.user.email}}a field of a JSON body,{{body}}the whole body{{method}},{{path}},{{now}}(ISO 8601 time)
Faker values (open-source fake data):
{{faker.person.firstName}}{{faker.person.lastName}}{{faker.person.fullName}}{{faker.person.jobTitle}}{{faker.person.sex}}{{faker.internet.email}}{{faker.internet.username}}{{faker.internet.url}}{{faker.internet.domainName}}{{faker.internet.ipv4}}{{faker.internet.ipv6}}{{faker.internet.userAgent}}{{faker.internet.password}}{{faker.location.city}}{{faker.location.country}}{{faker.location.countryCode}}{{faker.location.state}}{{faker.location.streetAddress}}{{faker.location.zipCode}}{{faker.location.latitude}}{{faker.location.longitude}}{{faker.location.timeZone}}{{faker.phone.number}}{{faker.company.name}}{{faker.company.catchPhrase}}{{faker.commerce.productName}}{{faker.commerce.price}}{{faker.commerce.department}}{{faker.commerce.productDescription}}{{faker.lorem.word}}{{faker.lorem.words}}{{faker.lorem.sentence}}{{faker.lorem.paragraph}}{{faker.lorem.slug}}{{faker.string.uuid}}{{faker.string.nanoid}}{{faker.number.int}}{{faker.number.float}}{{faker.datatype.boolean}}{{faker.date.past}}{{faker.date.future}}{{faker.date.recent}}{{faker.date.soon}}{{faker.date.birthdate}}{{faker.date.month}}{{faker.date.weekday}}{{faker.finance.amount}}{{faker.finance.currencyCode}}{{faker.finance.currencyName}}{{faker.finance.iban}}{{faker.finance.accountNumber}}{{faker.color.human}}{{faker.color.rgb}}{{faker.word.noun}}{{faker.word.adjective}}{{faker.word.verb}}{{faker.animal.dog}}{{faker.animal.cat}}{{faker.music.genre}}{{faker.vehicle.vehicle}}{{faker.system.fileName}}{{faker.system.mimeType}}{{faker.system.semver}}{{faker.git.commitSha}}{{faker.hacker.phrase}}{{faker.book.title}}
Tester
Headers
| Header | Value |
|---|
Checks
Export
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Mock API Builder (Endpoints & Mock Server)
Design a mock API without writing a server or a specification. Each route has a method and a path with parameters (/users/:id), and one or more responses with a status, headers, a delay and a body. Pick a response by rules on the query string, a header, a path parameter or a field of the JSON body, in sequence (first call, second call …) or at random by weight. Bodies are templates: {{params.id}}, {{query.page}}, {{headers.user-agent}}, {{body.email}} and fake values such as {{faker.person.fullName}} or {{faker.string.uuid}} are filled in for every request — by a logic-less template language, so nothing in a template is ever run as code. Collections add create, read, update and delete endpoints that keep their records in memory.
Try every route in the page with the built-in tester: it shows the reply, its headers and delay, and which route and rule answered. Requests in the tester never leave the page, and nothing is hosted anywhere. Bring routes in from an OpenAPI or Swagger file, a HAR capture from your browser, a Postman collection or a Mockoon environment; with a Premium pass, export a runnable mock: a Mockoon environment, MSW handlers for tests and front ends, a json-server db.json, a Node/Express server, a FastAPI app or WireMock mappings.
Without a pass the result is a free preview: your first 3 routes are built and tried in full and every check shows; the exports show their first lines, and more routes and copying or downloading the files unlock with a Premium pass.
How to use it
- Press Example for a small shop API, Add route for your own, or open an OpenAPI or Swagger file, a HAR capture, a Postman collection or a Mockoon environment under Import.
- For each route set the method and path (
/orders/:id, or*at the end for the rest of a path), then its responses: status, headers, body and delay. - With several responses, choose how one is picked: by rules (the first response whose rules hold answers, so put the one without rules last), in sequence, or at random by weight.
- Write the body as a template:
{{params.id}},{{query.page}},{{headers.authorization}},{{body.user.name}},{{method}},{{now}}or a Faker value such as{{faker.internet.email}}. - Try it in Tester: pick a route or type a method and URL, add headers or a body, and press Send. The reply shows which route and rule answered and what the request lacked.
- Under Export choose Mockoon, MSW, json-server, Express, FastAPI or WireMock and read the file; copying or downloading it, and more than 3 routes, unlock with a Premium pass (without one the page shows the free preview).
Examples
GET /users/:id · response 1: rule “:id is 0” → 404 · response 2 (no rules) → 200 {"id": {{params.id}}, "name": "{{faker.person.fullName}}"}GET /users/7 → 200 {"id": "7", "name": "Ana Lee"} · GET /users/0 → 404A placeholder outside quotes in a JSON body is written as a JSON value, so "7" stays valid JSON; inside quotes it is escaped.
GET /status in sequence: 200 {"status": "ok"}, then 503 after a 500 ms delayFirst call 200, second call 503 (after 500 ms), third call 200 …
Collection todos (id) with two starting records
GET /todos, GET /todos/2, POST /todos (gets id 3), PATCH /todos/3, DELETE /todos/1 — the records change in memory until you reset them
Common uses
- Building a front end before the back end exists, against endpoints that answer like the real ones.
- Giving tests stable, offline responses with MSW handlers, WireMock stubs or a json-server file.
- Reproducing an error, a slow response or a flaky endpoint to test retries and loading states.
- Turning a HAR capture or a Postman collection into a mock you can run on your own machine.
- Demonstrating an API design to a team before anyone writes the server.
How a request is answered
Routes are tried from the top: the first whose method (or ANY) and path match answers, then the collections. A path such as /users/:id matches one part for each parameter; * at the end matches the rest of the path, which {{params.*}} fills in. Within a route, rules pick the first response whose conditions hold (all of them, or any of them); a response without rules always holds, so it belongs last. Sequence answers with the responses in turn, and random by their weights. A request that matches no route gets a 404, and with CORS on, a browser’s preflight is answered and every reply allows any origin.
Templates
{{params.name}},{{query.name}}(the first value),{{headers.name}}(any case) and{{body.path.to.field}}(positions too:{{body.items.0.sku}};{{body}}is the whole body) read the request.{{method}},{{path}}and{{now}}(an ISO 8601 time) describe it.{{faker.namespace.method}}fills in a value from Faker, the open-source fake-data library: names, e-mail addresses, UUIDs, addresses, prices and more; the list is under Template help.
When the response’s Content-Type is JSON, a placeholder inside quotes is escaped and one outside quotes is written as a JSON value, so the reply stays valid JSON. Anything else between double braces is left as written, with a warning.
What each export carries
- Mockoon: an environment file to open in Mockoon or run with its command-line interface, with the routes, rules, sequences, collections (as data buckets) and templates in Mockoon’s own helpers (Mockoon templating); random picks there are even, not weighted.
- MSW: request handlers for MSW 3 (from
msw/http) or 2, in TypeScript or JavaScript, with a small copy of this page’s engine so they answer as the tester does. - json-server: a
db.jsonof the collections for json-server, which has no custom routes. - Node / Express: a one-file Express 5 server.
- FastAPI: a one-file Python app; Faker values come from Python’s Faker where it has the same kind of value.
- WireMock: stub mappings for the WireMock import endpoint, with response templating, priorities for rules and scenarios for sequences; collections become read-only stubs and Faker values fixed samples.
Importing
OpenAPI 3 and Swagger 2 (JSON or YAML) give one route per operation, with the example or a body made from the schema; the other documented responses answer when the request sends X-Mock-Status: 404 (or that response’s code). A HAR capture from a browser’s network panel gives one route per method and path — numbers and IDs in paths can become parameters — replaying different captured answers in sequence. A Postman collection (v2.1) gives its requests with their saved example responses, and a Mockoon environment its routes, rules, collections and the helpers this page fills in.
Limitations
- The mock runs in this page and in the files you export; the page itself hosts nothing, so other devices and apps reach your mock only through an export you run.
- Templates have no conditions or loops: for logic, pick responses with rules, or edit the exported code.
- Collections answer only simple filters (
?done=true); paging and sorting are not mocked. - Imports read what each format describes plainly: OpenAPI callbacks and links, HAR WebSocket frames and Postman scripts are left out.
- The free preview builds and tries the first 3 routes; collections count after them.
Privacy
On this device; its files download once
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot. Fake values ({{faker.…}}) need Faker, which loads from MySmartCoPilot the first time a template uses one; your routes and requests stay in this browser.
Frequently asked questions
What do I get without a pass?
Without a pass, Mock API Builder (Endpoints & Mock Server) shows your first 3 routes built and tried in the page, with every check, and the first lines (up to 20) of each export file. Until you unlock it, the result can’t be downloaded or copied. A Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
Is my mock API online somewhere?
No. The tester answers inside this page and nothing is hosted. To use the mock from your app or tests, export it — MSW runs inside your app or test runner, and Mockoon, json-server, Express, FastAPI and WireMock run on your own machine or server.
Can a template run code?
No. The template language only fills in named values from the request and from Faker; there are no expressions, so a template — yours or one in an imported file — cannot run anything.
Why does a response never answer?
With rules, the first response whose rules hold answers, and a response without rules always holds. If it sits above others, they are never used — the checks say so. Move the responses with rules above it.
How do I get an OpenAPI error response?
Imported operations answer with their success response by default. Send the header X-Mock-Status with the code you want, such as 404, to get that documented response — in the tester or from your app.
Do the exported servers keep data between restarts?
No. Collections live in memory, as in the tester: they start from the records you set every time the server starts.