Tools / Mock API Runner

Mock API Runner

Define routes - method, path, status, JSON body - and dry-run requests against them in the browser.

Define routes as blocks, then fire test requests.

Routes

Start each route with METHOD /path STATUS. Add a delay like 300ms at the end of that line. Header lines (Name: value) come next, then the body. Use :id in a path, and {{id}}, {{query.page}}, {{body.name}}, {{$uuid}}, {{$now}}, {{$int}} in a body.

Route check

Take it with you

The server file runs with Node on your own machine: node mock-server.js

Request tester

No requests yet.

Try a route

Request log

Nothing sent yet.

What it does

What it does.

Block route definitions

Method, path, status and JSON body per block; path params with :id syntax.

Real request matching

Method + path matching with params extracted and shown.

Latency simulation

A configurable delay makes loading states testable.

Fetch snippets

Each route generates the exact fetch() call for your front end.

How it works

How to use it.

Step 1

Define routes as blocks: METHOD /path STATUS, then the JSON body.

Step 2

Send a request with the tester; check status, body and params.

Step 3

Copy the fetch snippet into your front end.

FAQ

Path params?

Use :name in the route path; the tester extracts actual values.

Persistent?

Definitions live in the page; copy them out to keep them.

CORS or real HTTP?

Requests run in-page against your definitions; no network is involved.

Worked example

Real output, from the tool itself.

This is what Mock API Runner returned for its built-in example input, captured from the tool itself.

You enter

Input

GET /users 200
{"users":[{"id":1,"name":"Priya"},{"id":2,"name":"Dan"}]}

GET /users/:id 200
{"id":1,"name":"Priya","plan":"pro"}

POST /users 201
{"id":3,"created":true}

GET /health 200
{"ok":true}

Simulated latency (ms)

120

Input

GET

Input

/users/2

The tool returns

fetch('/users', {method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({/* request body */})})
  .then(r => r.text().then(t => t ? JSON.parse(t) : null));

Mock API Runner

See it at work

Define routes - method, path, status, JSON body - and dry-run requests against them in the page, with latency and per-route fetch snippets.

Mock API Runner
Fields
API
CLI
routes
request
hiringsai tool mock-api-runner
routes array
request object
2 fields, 2 required
curl -X POST https://hiringsai.com/api/v1/tools/mock-api-runner/run
-d '{"input": {"routes": "<text>", "request": "<text>"}}'
JSON result
hiringsai run mock-api-runner --input '{"routes": "<text>", "request": "<text>"}'
also callable over MCP
JSON result printed
Free toolAPI and MCPNo account
Fields
routesarray
requestobject
Ways to use it
pagethis app
APIPOST .../run
CLIhiringsai run
MCPtools/call
API call
POST /api/v1/tools/mock-api-runner/run
input: {"routes": "<text>", "request": "<text>"}
JSON result back
Command line
hiringsai run mock-api-runner
--input <json>
JSON result printed
The Mock API Runner page as it opens
Mock API Runner2 fields
The page as it opens, captured from the live site.
The Mock API Runner app at phone width
Mock API Runnerphone layout
The same app at phone width.
A desktop computer on a white desk with a lamp
Mock API RunnerFree tool
Define routes - method, path, status, JSON body - and dry-run requests against them in the page, with latency and per-route fetch snippets.
A woman working at a desktop monitor
Mock API RunnerAPI and MCP
Call it from a script over the API or MCP.