MockAPI
Configure the response.
Test your application.
MockAPI is an open-source, self-hosted mock API server designed for efficient request handling and a small
memory footprint. Configure status codes, headers, and response bodies through the dashboard or a JSON file.
Use it to test successful requests, rate limits, server errors, and connection failures. Endpoint changes take
effect without a restart.
Dashboard overview.
Example endpoints, request statistics, and recent outcomes in the side-by-side workspace. Select the image
to open it at full size.
Example endpoints.
This capture expands inventory and shipping while keeping the AI assistant group collapsed. Inventory,
reservations, shipping, tracking, rate limiting, server errors, and connection aborts, with controls to
test and edit each definition.
Request log.
Recent entries from a 43-request sample, with UTC timestamps by default, methods, paths, HTTP outcomes,
transport attempts, and response byte counts. Choose local time in Settings if preferred.
Screenshot 1 of 3: Dashboard overview
Getting started
Run your mock API locally or in a container
Local development
Run locally
Install the stable .NET 11 SDK, then clone and run. No Node.js tooling is needed just to use MockAPI.
git clone https://github.com/simonkurtz-MSFT/MockAPI.git
cd MockAPI
PowerShell 7
.\start.ps1 -Action run-tutorial
Bash
./start.sh --action run-tutorial
The dashboard opens automatically when MockAPI is ready. If your browser does not open, visit
localhost:5080/__mockapi/
.
Isolated runtime
Use a container
Run a published stable image without an SDK or source checkout. The same tag supports Linux AMD64 and
ARM64.
docker run --rm -p 127.0.0.1:8080:8080 -v mockapi-data:/data simonkurtzmsft/mockapi:1.11.0
Open
localhost:8080/__mockapi/
. The named volume preserves configuration across restarts. Use an explicit published version; there is no
latest
image alias.
Press the play button for
/inventory/items
(Trailhead Supply inventory).
Changes are saved automatically to your configured writable file, volume, or Azure Blob Storage.
Keep administration private and APIs protected.
Before sharing a deployment, configure administrative authentication, HTTPS, and API key protection.
Common uses
Mock API examples for development and testing
Develop against an unavailable API
Configure responses for an upstream API that is not yet available. Requests match an exact HTTP method and
path, so your application can call the same routes during development.
Return HTTP 429 with Retry-After, configure server errors, or abort a connection. Check how your client
handles these failures without changing the upstream service.
Easily connect APIM Samples to your custom mock APIs. Import live OpenAPI definitions into Azure API
Management and use MockAPI as the backend for your scenarios.