api.live / Mock API server
A mock API server that runs on your machine
When your code calls a payment provider, an email service or another team's API, you need a stand-in for testing. api.live includes a mock server that behaves like a real service.
Free. No account. macOS app, plus a CLI for macOS, Linux and Windows.
What it does
- Each mock is a real local service on its own port. Point your app at it like the real thing.
- Generated for you. Create mock routes from an OpenAPI file or from recorded traffic. Fields get realistic values by name and type: an email looks like an email, a price like a price.
- Stateful. Create an order with POST, read it back with GET.
- Failure on demand. Dial in an error rate, timeouts, dropped connections and delays to see how your code copes.
- Templated responses. Echo values from the request, generate IDs, or return responses in sequence.
Start it
api mock # every mock service in the workspace
api mock payments -p 4010
Use the mock inside a test
This is where it differs from a standalone mock tool. A test can start the mock, run your flow, and then ask the mock what it received. For example: send the same order 20 times at once, then check that the payment mock got exactly one charge. That catches double-charge bugs that are hard to test any other way.
Receive webhooks
A test can wait for a callback to arrive at the mock, such as a payment webhook, and continue once it lands.
What to know before you switch
- api.live is v0.1, built by one person. Expect rough edges.
- It is free to use and closed source.
- The desktop app is macOS only for now. The CLI runs on macOS, Linux and Windows.
- Load tests run from one machine. gRPC support is unary only.
Try it
brew install --cask apilivehq/tap/api-live # Mac app
npm i -g @apilivehq/cli # CLI: macOS, Linux, Windows
Or download it from GitHub Releases. Found a bug? Open an issue.