Mock API for Development and Testing
Using Mocki you can create, run and deploy mock APIs. Use your mocks to design your API, serve static responses, simulate error scenarios and remove dependencies to external services. Sign up today for a free 7-day trial.
Sign UpFree API Editor
If you want to create a simple API for testing purposes, simply enter a response body below and press Create API to get your custom API URL.
Use Mocki to create a fully fledged mock API. Sign up for a 7-day free trial and get:
- Multiple API endpoints
- Monitoring dashboard
- Simulated errors and delays
- Generated test data
Isolated Testing
Create mock services to use in your integration tests for 100% isolated testing of your service and independence of external dependencies.Generate Test Data
Using Mockis test data generator you can generate realistic test data for your client.Simulate Failures
Simulate random failures and delays in your services to easily cover negative test cases.Configuration as Code
Sync your service with your code repository to keep your mock service up to date with the latest changes without manual steps.Managed Hosting
Using our managed hosting solution your mock service is always available for any consumer. Access a dashboard to gather insights on how your mock service is used.Run Locally
Using our Open Source CLI you can run your services locally. This enables you to run your service without requiring an internet connection to reach external services.Sample mock APIs
Below are a couple of dummy APIs that you can use while developing or learning about APIs.
Mock API for backend development
A mock API can also be useful when testing backend apps. A common case is that your API or service needs to call external services over HTTP that it integrates to. If you want to get rid of these dependencies when developing you can use mock APIs to your advantage.
By mocking the external dependencies you do not need to put unnecessary load on the external systems and can be free of having to make sure they are constantly up and running. You can also simulate errors and delays to make sure your backend application handles them gracefully.
For frontend development
Sometimes you might want to start working on a frontend feature before there is a backend service available to support it. Using a mock API you can start developing towards the API during the time that the real service is not available. This enables you to work quicker and also help you give feedback to the backend developers on the data that you need in the frontend. Once the real backend is finished you can switch over to that and your frontend should work just as before.
Another use case for mock APIs for frontend development is when you want specific data to be able to work on different scenarios in your app. This data can be complicated and time consuming to get right using a real backend service. If you use a mock instead, you can simply update the configuration to make the API reply with the data you need. For more complicated use cases, you can set up dynamic responses in Mocki that reply according to a set of conditions that you define.
You can use Mocki with your favorite frontend frameworks such as Angular and React.
Test data
Test data is always a challenge for testers. Sometimes you need to bug reluctant backend developers to set things up the way you want them and sometimes you need to configure things in external systems.
To avoid this, you can configure a mock API instead. This lets you take control of the API responses yourself and you can replicate the exact scenarios that you want to test.
Error simulation and delays
How does my app behave when everything goes wrong? If you want to create user friendly apps, you need to make sure they handle error scenarios well. Replicating them might be tricky though.
To simulate errors you can use a mock API instead of your regular backend. That way you can easily configure your API to produce a certain error code or reply with an extended delay. If you test your app with the possible error scenarios in mind, you will make sure your app does not break if things go wrong.
Define your mock API
YAML
Define your service in a yaml-file and either run it locally with our command line tool or deploy it to our managed hosting in a single command. Integrate with GitHub to keep your mock up to date with the latest changes in your repository.
Web Interface
If you just want to set your API up quickly you can also use our web interface to define your mock service.
config.yml
endpoints:
- path: hello
method: post
responses:
- type: json
body:
message: Hello World!
mocki run --config ./config.yml
[mocki] Mock API running at port 3000
Integrate with GitHub
Define your service in a yaml-file and either run it locally with our command line tool or deploy it to our managed hosting in a single command. Integrate with GitHub to keep your mock up to date with the latest changes in your repository.
After setting up your project, all members of yout GitHub organization will have access to it seamlessly.
Become independent of external dependencies
To avoid having to depend on external services and APIs during testing and development of your application, Mocki can help you simulate them. Using the editor you can easily set up mock responses for any API.
Easily collaborate and share your mock projects with team members in your GitHub organization by simply logging in to Mocki using GitHub.
Get started with Mocki »Manage your mock APIs from one interface
In the dashboard view, you get an overview of your mock APIs and the latest changes made to them.
Mockis features for randomized responses, delays and simulated errors makes testing corner cases and error handling in your application easier.
Start creating »Go offline
Today, it is very hard to develop anything without an internet connection. There is always an API or a service that your app vill need access to.
Using Mocki CLI you can simulate those APIs and services with a simple configuration file and a single command. You get all features that you get when using our cloud solution but running offline on your workstation. This enables you to go fully offline and no longer be dependent on an internet connection to get the job done.
Read more about to use Mocki to simulate external services »Take control of test data
Have you ever been in a scenario where you need specific test data to be able to run all test cases? We have, too. To get rid of this problem Mocki has support for generating realistic test data for use in your application. Instead of having to request someone to manually create the data in the correct environment, you can take control of the test data and set it up any way you want.
Learn how to set up test data »Built for microservices
Mocki is a perfect fit for microservice testing and development. Instead of having to deploy your entire fleet of microservices to be able to carry out testing and development of a new service, use Mocki to simulate the external services. This will enable you to improve costs, productivity and developer experience.
Read more about how we used Mocki to improve the testing workflow for one of our clients »