Apidog provides an efficient mock engine that automatically generates realistic API responses based on your API specifications. This powerful feature eliminates the need for manual configuration, accelerating development and testing workflows.Use Cases#
Mock APIs are valuable in various development and testing scenarios:| Scenario | Description | Benefit |
|---|
| Parallel Development | Frontend development when APIs are designed but not yet implemented | Frontend teams can proceed without waiting for backend completion |
| Data Security | Avoiding production data exposure during development | Maintains data privacy and security compliance |
| Testing | Creating test datasets for external dependencies | Ensures consistent and controlled test data |
Getting Started#
1
Create an endpoint or import an API spec. The endpoint must have a specified response.
2
Navigate to the
Mock tab and click the mock URL to copy it.
3
Paste the URL in your browser to retrieve mock data. Refresh the page to generate new data.
Mock Capabilities#
Apidog's mock functionality supports various response types:Mock Server Types#
Apidog offers three mock server options to suit different development needs:Local Mock#
Local mock runs on your computer alongside the Apidog client. It operates only when the client is open.Installed automatically with Apidog client
Starts when Apidog client launches
Accessible only while client is running
Cannot be disabled or removed from environments
Best for: Local frontend debugging and individual developmentAvailability: Apidog Client only (not available in Apidog Web)Find the Local mock server URL in the environment management popup under "Local mock environment."
Cloud Mock#
Cloud mock provides the same functionality as local mock but runs on Apidog's servers. It remains accessible regardless of whether your local machine is running.Available 24/7 from any location
Supports encrypted access
Can be toggled on/off as needed
Best for: Sandbox environments for public APIs and team collaborationLearn more about configuring and using Cloud mock. Runner Mock#
Runner mock operates on your team's self-hosted runner infrastructure. After deploying a runner on your server, all team members can access mock data through it.Self-hosted on your infrastructure
Available independently of local machines
Shared across all team members
Best for: Large-scale automated testing and sandbox environments for internal/private APIsAccessing Mock Servers#
You can access mock data through two primary methods:URL Access#
Every HTTP endpoint in Apidog includes a Mock module:In DESIGN mode: Found in the API tab
In DEBUG mode: Found in the Mock tab
From this module, you can copy the mock URL and use it in any application or tool to request mock data.If an endpoint defines multiple responses or mock expectations, each will have its own unique mock URL.
You can click Request to test the mock URL directly within Apidog.The Click to copy button copies only the URL. You must manually add the HTTP method and request body when using the URL elsewhere.
Accessing Mock Within Apidog#
Each Apidog project includes Local mock and Cloud mock environments in the environment switcher (top right corner).When you select a mock environment, all requests in Apidog are automatically routed to that mock server.Only endpoints with paths starting with / will be sent to the mock environment. Endpoints with complete URLs (not starting with /) will not use the mock environment.