Beeceptor

Mock REST APIs for HTTP request/response scenarios.
Beeceptor

Introduction

Beeceptor is an innovative tool designed to simplify the process of API Service Virtualization and API mocking, enabling developers to create and manage mock APIs for testing purposes.

 Beeceptor provides a user-friendly interface that allows developers and QA engineers to quickly set up mock endpoints, define expected responses, and test their applications in a controlled environment. By streamlining the API mocking and service virtualization process, Beeceptor helps teams improve their productivity, reduce development time, and enhance collaboration between frontend and backend teams.

Features

Beeceptor offers a range of features designed to facilitate the creation and management of virtual services and mock APIs. Some of its most notable features include:

  • Easy Setup: Beeceptor allows users to create mock APIs quickly and easily with minimal configuration. Users can define endpoints in just a few clicks, making it accessible for both technical and non-technical team members.
  • Multi-Protocol Support: Beeceptor now supports mock server creation for REST (via OpenAPI), SOAP (via WSDL), and GraphQL, extending its utility beyond traditional REST mocking. (A gRPC mock server is currently under development.)
  • Stateful Mocking & CRUD Capable: Beyond static responses, Beeceptor offers Stateful Mocking for simulating complex workflows (using Step Counter, Lists, and Data Store) and the ability to instantly generate fully functional, data-backed CRUD APIs.
  • Rules-Based Engine: Mocking is driven by a Rules-Based Engine that matches requests based on body, headers, and query parameters, ensuring accurate simulation of real-world API behavior.
  • Intelligent, Dynamic Data: Beeceptor features AI-Powered Intelligent Mocks and dynamic responses for realistic, contextual test data.
  • Chaos Engineering Capabilities: Users can now perform Chaos Simulations by easily configuring artificial delays (Latencies/Timeouts), Rate Limits, and custom failure codes to test application resilience.
  • Local Tunneling: Offers a powerful feature to securely expose local development services to a public HTTPS endpoint, which is essential for developing and testing webhooks.
  • Real-Time Monitoring: Beeceptor provides real-time monitoring of incoming requests to mock endpoints. This feature allows users to view and analyze request data, helping them understand how their applications interact with the mock APIs.
  • Path Parameter Support: The tool supports path parameters, enabling users to define dynamic endpoints that can respond differently based on the parameters provided in the request URL.
  • Webhooks and Callbacks: Beeceptor supports webhooks, allowing users to simulate external API integrations. This feature is particularly useful for testing how applications handle incoming webhooks from third-party services.
  • Collaboration Tools: Beeceptor provides features that enable team collaboration, allowing multiple users to work on the same project and share mock APIs with ease.
  • Integration with Other Tools: Beeceptor can be integrated with various development and testing tools, enhancing its functionality and allowing users to incorporate it into their existing workflows seamlessly.

Pros

  • User-Friendly Interface: Beeceptor's intuitive interface makes it easy for users of all skill levels to create and manage mock APIs. The straightforward design reduces the learning curve, allowing teams to get started quickly.
  • Fast Mock API Creation: The ability to set up mock APIs in minutes accelerates the development process. This acceleration is particularly beneficial in Agile environments where time is of the essence.
  • Advanced Simulation: The introduction of Stateful Mocking, Multi-Protocol Support, and the Rules-Based Engine provides powerful capabilities for simulating complex, real-world service environments.
  • Customizable Responses: The flexibility to define custom responses allows teams to simulate a wide range of scenarios, making it easier to test application behavior under various conditions.
  • Real-Time Request Monitoring: The real-time monitoring feature provides valuable insights into how applications interact with mock APIs, helping teams identify potential issues and optimize their implementations.
  • Cost-Effective: Beeceptor offers a free plan that provides essential features for small teams or individual developers. This accessibility makes it an attractive option for startups and projects with budget constraints.

Cons

  • Limited Request Counts in Free Plan: While the free plan is pretty much feature rich, it only allows 50 requests per day.
  • Dependency on Internet Connection: As a cloud-based tool, Beeceptor requires a stable internet connection to access and manage mock APIs. However, they offer on-premise plans which offer air-gapped deployments.
  • Pricing for Advanced Features: Software Teams requiring advanced capabilities like Multi-Protocol support, Stateful Mocking, or high-volume traffic handling will need to subscribe to a paid plan.

Usage & Instructions

Using Beeceptor for API mocking is straightforward, thanks to its intuitive design, but advanced dynamic mocking requires specific configuration. Below is an example demonstrating how to set up and use Beeceptor to mock a dynamic API endpoint like /api/users/{id}.

Example: Mocking a Dynamic User Profile API (using Path Parameters)

To simulate an endpoint that responds based on the value in its path (e.g., extracting the ID from /api/users/123), you must use a request condition that matches the Request path using a Regular Expression.

  1. Create an Account & MockServer: Start by signing up for a Beeceptor account and creating a new Mock Server.
  2. Define a  Mock Rule: On the Mock Server dashboard:
    • Click on "Mocking Rules".
    • Click on "+ New Mock Rule."
    • Match Method: Choose GET.
    • Match Request Condition: Select Request path matches a regular expression.
    • Match Value: Define a regex that includes a named capture group for the path parameter.
      • For the path /api/users/{id}, use: /api/users/(?<userID>\d+)
    • Explanation: The (?<userID>\d+) part captures one or more digits (\d+) and assigns the captured value to the group name userID.
  3. Configure the Response Body & Enable Dynamic Response:
    • Use the {{pathParam 'group-name'}} helper to insert the captured path value into the response.
    • Define the response body (JSON) as follows:

```json{

  "id": "{{pathParam 'userID' 'default'}}",

  "name": "John Doe",

  "email": "john.doe@example.com"

}```

  • In the response configuration settings, you must Enable dynamic mock responses. This activates the Handlebars templating engine needed to inject the captured value.
  1. Test the Endpoint: Once configured, you can test it by making a GET request to the defined URL with a specific ID, such as: https://your-subdomain.beeceptor.com/api/users/456. You should receive a mock response where the ID field reflects the 456 you provided in the URL.
  2. Monitor Requests: As requests are made to the endpoint, you can monitor incoming requests in real-time on the Beeceptor dashboard, allowing you to analyze how your application interacts with the mock API.

Sample Code

Below is a sample cURL command to test the dynamic mock API created in Beeceptor:

curl -X GET https://your-subdomain.beeceptor.com/api/users/456

{
  "id": "{{pathParam 'userID' 'default'}}",
  "name": "John Doe",
  "email": "john.doe@example.com"
}

Pricing

Beeceptor offers a flexible pricing structure to cater to different user needs:

  • Free Plan: The free plan includes 50 requests/day and 3 rules per endpoint. This plan is ideal for small projects or individual developers who need basic, public mocking capabilities and local tunneling with ephemeral sessions.
  • Individual Plan: Starts at $10 per month and significantly increases request limits to 15,000 requests/month and 50 rules per endpoint. This plan introduces private endpoints and is suitable for solo developers working on personal or small-scale commercial projects.
  • Team Plan: Starts at $25 per month and further increases capacity to 100,000 requests/month and 250 rules per endpoint. This popular plan is suitable for small to medium-sized teams, as it unlocks crucial features like Request History (up to 10 days), OpenAPI Mock Server, and persistent local tunnels.
  • Scale Plan: Starts at $99 per month and is designed for high-volume traffic handling with 1M requests/month and 500 rules per endpoint. This plan unlocks Beeceptor APIs for programmatic management, custom domains, and audit logs.
  • Enterprise Plan: For organizations with extensive virtualization and mocking needs, Beeceptor offers customized enterprise plans. Pricing is usage-based and includes advanced security (SSO, IP whitelisting), compliance (SOC 2 Type II), and dedicated support.

Beeceptor is recommended for various types of users and organizations involved in software development and testing:

  • Developers: Software developers can benefit from Beeceptor's ability to create virtual services quickly, allowing them to work independently from backend development and test their frontend applications effectively. The Local Tunneling feature is also critical for webhook development.
  • QA Engineers: Quality assurance professionals can use Beeceptor to simulate different API responses, enabling them to test edge cases and ensure application robustness, including performing Chaos Simulations.
  • Agile Teams: Teams adopting Agile methodologies will find Beeceptor beneficial for facilitating collaboration between frontend and backend developers, ensuring that testing can proceed smoothly even when the backend is not fully available.
  • Startups and Small Teams: The availability of a free plan makes Beeceptor an attractive option for startups and small teams that may have budget constraints but still need a powerful API mocking and virtualization solution.
  • Product Managers and Designers: Non-technical stakeholders can leverage Beeceptor to create and manage mock APIs, allowing them to validate application concepts and designs without relying on developers for backend implementation.

In conclusion, Beeceptor is a powerful and user-friendly tool for API Service Virtualization and API mocking that simplifies the process of testing and development. Its expanded range of features, including multi-protocol support and stateful capabilities, ease of use, and flexible pricing make it an excellent choice for teams looking to enhance their testing capabilities. While it may have some limitations in its free version and require an internet connection for access, the overall advantages of using Beeceptor far outweigh these drawbacks for most users and organizations.

About the author
Irfan Ahmad

Irfan Ahmad

Software Quality Leader | Helping software teams to deliver with speed, security and scale.

stay updated with testing tools and tech.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to The CheckOps Engineer | #1 directory of testing tech. and tools.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.