ApiSimul logo ApiSimul — the switchboard
N°01

Mock any API / from the browser

A Rules
Checking operator status…
No rules on the board.
Create one, or load the sample set.
01 Rule editor
{{random.name}} {{random.email}} {{number.int 1 100}} {{string.uuid}} {{bool}} {{date.iso}} {{image.avatar}} {{param.id}} {{#repeat 5}}
300 ms
B Call log 0 calls
No calls yet. Register the operator, then send a test request.

02 Why a switchboard for your API

Front-end work should not wait for back-end endpoints. ApiSimul plugs a mock operator into your browser: it answers the calls your app already makes, with the data shape you decide.

01 / INTERCEPT

Real interception, zero code changes

One click registers a Service Worker at the browser level. Your fetch() and XMLHttpRequest calls keep their real URLs — the operator answers before the network is ever touched. Uninstall it and everything returns to normal instantly.

02 / ROUTE

Path params like a real router

Define routes such as /api/users/:id or /posts/:slug/comments. Captured segments feed back into the response through {{param.id}}, so the mock behaves like a resource-aware endpoint, not a static file.

03 / FABRICATE

Dynamic fake data, every call

Placeholders render fresh on each request: names, emails, UUIDs, integers in range, timestamps, avatars, and {{#repeat 5}} blocks that build whole JSON arrays. Your UI gets realistic lists and detail pages to lay out against.

04 / THROTTLE

Latency and status you control

Set 0–3000 ms of simulated delay and any status from 100 to 599. Reproduce the slow endpoint that breaks your spinner, the 404 that tests your empty state, or the 500 that exercises your error handling.

05 / OBSERVE

A live call log on the board

Every intercepted call is written to the log with time, method, URL, status, and whether it was mocked or passed through. Watch the switchboard light up as your app runs — debugging the request flow becomes reading a tape.

06 / CARRY

Rules travel with your team

Rules live in your browser's IndexedDB — nothing is uploaded. Export the whole board as JSON, commit it next to your front-end code, and teammates import the exact same mock set in one click.

03 Placeholder cheat sheet

Drop these into any response body. Unknown placeholders pass through untouched, so your templates never break.

PlaceholderReturnsExample output
{{random.name}}Full name from a seeded poolGrace Hopper
{{random.email}}Email built from the name poolalan.turing@test.dev
{{number.int 1 100}}Integer between min and max42
{{number.float 0 1 2}}Float with given decimals0.37
{{number.bool}}Literal true / falsetrue
{{string.uuid}}UUID v43f8a1c…
{{string.lorem 12}}N lorem wordslorem ipsum dolor…
{{string.id}}Short random identifierk3x9qz1a
{{date.iso}}Current time, ISO 86012026-08-23T09:41:07Z
{{date.timestamp}}Current time in milliseconds1755938467000
{{image.avatar}}SVG avatar as data URI (offline)data:image/svg+xml,…
{{image.url 640 480}}Photo URL at the given sizehttps://picsum.photos/…
{{param.id}}Value captured from :id in the route42
{{index}}Iteration index inside a repeat block0, 1, 2…
{{#repeat 5}} … {{/repeat}}Repeats the block N times as a JSON array[{…},{…},…]

04 Questions on the line

How does the interception actually work?
A Service Worker is a script your browser keeps between the page and the network. ApiSimul's worker listens to the fetch event, compares each request against your rule board, and answers matches itself. Non-matching requests pass through untouched, which is why registering the operator never breaks normal browsing of the site.
Which requests can be intercepted?
Service Workers operate per origin, so the interception covers fetch calls issued from pages on apisimul.com. Use the test pad in the Call log panel to fire requests at your mocked routes and watch them being answered. To mock your own development site, run its front-end locally and point its API base URL at the same origin as a registered worker.
How do I make a list endpoint return 20 items?
Wrap one item object in a repeat block: {{#repeat 20}}{"id": {{index}}, "name": "{{random.name}}"}{{/repeat}}. Each iteration gets fresh random data and an {{index}} counter, and the block renders as a valid JSON array you can assign to a key in your response body.
Why does the page ask me to reload after registering?
Browsers activate a Service Worker for pages loaded after registration. A single reload lets the operator take control of the current page — the status lamp turns green when interception is live, and stays amber until you do.
Are my rules and logged requests private?
Yes. Rules and logs are written to IndexedDB in your browser and never leave your machine. There is no account, no sync, and no server-side storage. Clearing the site's browser data removes them; use Export to keep a copy.
Can I stop mocking just one endpoint?
Toggle the switch on that rule card and requests to its route immediately pass through to the real network while the rest of the board keeps answering. Unregister the operator to switch everything off at once.