Skip to main content
Bruno provides a powerful visualization feature that allows you to display API response data in a more readable and interactive format using the bru.visualize function. This feature supports multiple providers and formats to help you analyze and present your API data effectively.
  1. type: The type of visualization to render (e.g., ‘table’, ‘html’).
  2. config: A configuration object that includes:
    • name: The name of the visualization instance.
    • provider: The rendering library or provider used to display the visualization (e.g., ‘ag-grid’, ‘react-table’).
    • props: Additional properties required by the provider to configure the visualization.

Supported Visualization Types and Providers

Table Visualization (‘table’)

You can render tables using different providers like ag-grid and react-table.

Using ag-grid

Example: ag-grid
copy
This will render a table using the ag-grid provider with filters enabled on all columns.

Using react-table

Example: react-table
copy
The header property only accepts string values. Use strings like header: "Column Name".
This example renders a large table using the react-table provider, with custom headers and filter variants.

HTML Visualization (‘html’)

You can also render custom HTML content using the html type. This allows for advanced templating and formatting, such as generating a data table or a report.

Using HTML String

Example: html
copy
This example will render an HTML table with predefined data using the html type.

Using API Response Data

One of the most powerful features of bru.visualize is the ability to transform API responses into visual tables. Here are practical examples of working with real API data: In Bruno, the parsed API response is stored in res.body

Example 1: Simple User List API

For an API that returns a list of users:
copy

Example 2: Nested API Response Data

For APIs returning nested objects, you can flatten the data before visualization:
copy

Example 3: Transforming Complex Data

For complex responses that need transformation before visualization:
copy

Example 4: Error Handling with API Data

Always include error handling when working with API responses:
copy
When working with API responses:
  • Always verify the response structure before accessing nested properties
  • Use optional chaining (?.) to safely access nested data
  • Transform data to match your visualization needs
  • Add meaningful column headers using the field property
  • Enable filters for better data exploration

Using API Response Data with HTML

You can dynamically generate HTML from API responses:
copy

Custom Dashboard with Statistics

Create rich dashboards with API data:
copy

Viewing Your Visualization

  1. Add the visualization code to your request’s script section
  2. Execute the request
  3. Your visualization will be displayed in the panel
Visualization Output

Parameters

Config Properties