How to Use Bruno API Client: A Beginner's Guide

Community Article
Published March 26, 2025

In today's interconnected digital landscape, APIs (Application Programming Interfaces) have become the backbone of software development. Whether you're building web applications, mobile apps, or integrating third-party services, understanding how to effectively interact with APIs is essential. Bruno API client has emerged as a popular tool among developers for testing and managing API requests. This guide will walk you through everything you need to know to get started with Bruno, and later introduce you to Apidog as an even more powerful alternative.

Burno API how to use

What is Bruno API Client?

Bruno is a Git-friendly, open-source API client designed to simplify API interactions for developers. Unlike cloud-based alternatives, Bruno operates entirely offline, making it a secure choice for handling sensitive API requests. Its minimalist design focuses on essential features that developers need most, without the bloat that often accompanies other API tools.

Key features that make Bruno stand out include:

  • Git integration: Store your API collections directly in your project repositories
  • Fully offline operation: No account required, works without an internet connection
  • Open-source: Free to use with an active community of contributors
  • Developer-focused: Clean interface with minimal distractions

Installing Bruno API Client

Getting started with Bruno is straightforward. The application is available for Windows, macOS, and Linux:

Windows Installation

  • Using Chocolatey: choco install bruno
  • Using Winget: winget install bruno.bruno
  • Alternatively, download the installer from the official website

macOS Installation

  • Using Homebrew: brew install bruno
  • Alternatively, download the DMG file from the official website

Linux Installation

  • Download the appropriate package (.deb for Debian/Ubuntu or .rpm for Fedora/CentOS)
  • Install using your package manager

Understanding the Bruno Interface

After launching Bruno, you'll be presented with a clean, intuitive interface designed to help you manage your API requests efficiently:

  1. Collections Panel: Located on the left side, this is where you organize your API requests into collections and folders
  2. Request Builder: The central area where you create and configure API requests
  3. Response Viewer: Displays the results of your API requests
  4. Environment Selector: Located in the top right, allows you to switch between different environments

Building Your First API Request in Bruno

Let's walk through creating a simple API request to understand the basics:

Step 1: Create a Collection

Collections help you organize related API requests. To create one:

  1. Click on "New Collection" in the left panel
  2. Give your collection a descriptive name (e.g., "Weather API Requests")
  3. Optionally, add a description to provide context

Step 2: Add a New Request

Now, let's add a request to your collection:

  1. Right-click on your collection and select "New Request"
  2. Name your request (e.g., "Get Current Weather")
  3. Choose the HTTP method from the dropdown (GET, POST, PUT, DELETE, etc.)
  4. Enter the endpoint URL (e.g., https://api.example.com/weather)

Step 3: Configure Request Parameters

Depending on the API, you might need to add:

Headers

  1. Click on the "Headers" tab
  2. Add key-value pairs for required headers (e.g., Content-Type: application/json)

Query Parameters

  1. Click on the "Query" tab
  2. Add parameters that will be appended to your URL (e.g., city=London)

Request Body (for POST/PUT requests)

  1. Click on the "Body" tab
  2. Select the format (JSON, form data, etc.)
  3. Enter your request payload

Step 4: Send Your Request

Click the "Send" button or press Ctrl+Enter to execute your request. The response will appear in the panel below, showing:

  • Status code (200 OK, 404 Not Found, etc.)
  • Response time
  • Response headers
  • Response body (formatted for readability)

Working with Environments in Bruno

Environments allow you to use the same requests with different configurations (development, staging, production). This is particularly useful when you need to switch between different API endpoints or credentials.

Creating an Environment

  1. Click on the environment dropdown in the top-right corner
  2. Select "Configure Environments"
  3. Click "Add Environment" and give it a name (e.g., "Development")
  4. Add variables as key-value pairs:
    • baseUrl: https://dev-api.example.com
    • apiKey: your-dev-api-key

Using Environment Variables

Once you've set up your environment, you can use variables in your requests:

  1. In the URL field, use double curly braces: {{baseUrl}}/weather
  2. In headers: Authorization: Bearer {{apiKey}}

This approach makes it easy to switch between environments without modifying your requests.

Advanced Features in Bruno

As you become more comfortable with Bruno, you can explore its advanced capabilities:

Pre-request Scripts

Pre-request scripts allow you to execute JavaScript code before your request is sent. This is useful for:

  • Generating dynamic values (timestamps, UUIDs)
  • Calculating authentication signatures
  • Setting up environment variables

To add a pre-request script:

  1. Click on the "Script" tab
  2. Write your JavaScript code
  3. Use the req object to modify your request

For example, to add a basic authentication header:

const btoa = require("btoa");
const auth = btoa(bru.getEnvVar("username") + ":" + bru.getEnvVar("password"));
req.setHeader("Authorization", "Basic " + auth);

Post-request Scripts

Post-request scripts run after receiving a response, allowing you to:

  • Extract data from responses for use in other requests
  • Validate response data
  • Perform automated testing

To save a value from a response:

// Save the access token from the response
bru.setEnvVar("accessToken", res.body.access_token);

Collection Variables

Bruno also supports collection-level variables that can be shared across requests within the same collection. These are particularly useful for values that change during a session but are used by multiple requests.

Organizing API Workflows

For complex API interactions, organizing your requests into logical workflows can save time and reduce errors:

Folders and Subfolders

Group related requests into folders:

  1. Right-click on your collection
  2. Select "New Folder"
  3. Organize requests into these folders (e.g., "Authentication", "User Management", "Reports")

Request Sequence

If your API workflow requires a specific sequence of requests (like authentication before data retrieval), you can:

  1. Number your requests to indicate order
  2. Use post-request scripts to extract data needed for subsequent requests
  3. Document dependencies in request descriptions

Collaborative Work with Bruno

As Bruno is Git-friendly, sharing and collaborating on API collections is straightforward:

  1. Store your Bruno collections directly in your project repository
  2. Collections are saved as plain text files, making them easy to version control
  3. Team members can pull the latest changes and work with the same collections

Apidog: A Better Alternative to Bruno

While Bruno offers a solid foundation for API testing and development, Apidog provides a more comprehensive solution with advanced features that address the needs of modern development teams.

Why Consider Apidog Over Bruno

All-in-One Platform

Apidog combines multiple tools into a single platform:

  • API Design: Visual OpenAPI specification editor
  • API Testing: Powerful request builder with automated testing
  • API Documentation: Auto-generated, customizable documentation
  • API Mocking: Smart mock servers without writing code
  • Team Collaboration: Real-time collaboration features

Superior Testing Capabilities

Apidog excels in testing with features that Bruno lacks:

  • Visual Test Builder: Create complex test scenarios without code
  • Automated Testing: Generate tests directly from API specifications
  • Performance Testing: Run load tests with a single click
  • CI/CD Integration: Seamlessly integrate with your deployment pipeline

Enhanced Collaboration Features

For teams working on APIs together, Apidog offers:

  • Team Workspaces: Dedicated spaces for team collaboration
  • Role-Based Access Control: Granular permissions management
  • Real-Time Updates: See changes as they happen
  • Comment & Feedback System: Discuss API design within the tool

Streamlined API Development Workflow

Apidog implements a true API design-first approach:

  • Design APIs visually
  • Generate requests and examples automatically
  • Create documentation as you build
  • Test against specifications

Smart Mocking

While Bruno requires manual setup for mock servers, Apidog offers:

  • Intelligent Mock Data: Generates realistic data based on field names
  • Cloud-Based Mocking: Share mock endpoints with your team
  • Custom Response Rules: Configure specific responses for different scenarios

Versatile Documentation

Documentation in Apidog is:

  • Automatically Generated: Based on your API design
  • Customizable: Mix markdown with API specifications
  • Shareable: Publish to custom domains or share securely
  • Interactive: Allows users to try APIs directly from the docs

Making the Transition from Bruno to Apidog

If you're currently using Bruno and want to upgrade to Apidog, the transition is straightforward:

  1. Import Collections: Apidog can import API definitions from various formats
  2. Set Up Environments: Configure your development, staging, and production environments
  3. Enhance Your Tests: Leverage Apidog's advanced testing features
  4. Collaborate: Invite team members to your workspace

Conclusion

Bruno API client offers a solid, minimalist approach to API testing and development, particularly appealing to developers who prefer offline tools with Git integration. Its straightforward interface and focus on essential features make it a good starting point for those new to API clients.

However, as your API development needs grow more complex, Apidog presents a more comprehensive solution with its all-in-one platform approach. The additional features for testing, documentation, mocking, and team collaboration make it a superior choice for teams working on sophisticated API projects.

Whether you choose Bruno for its simplicity or Apidog for its comprehensive feature set, having a dedicated API client will significantly improve your development workflow and help you build better, more reliable APIs. As APIs continue to be central to modern software development, investing time in mastering these tools will pay dividends in your development journey.

Community

Sign up or log in to comment