APIs are one of the foundational technologies underpinning our interconnected world. They enable programs to talk to each other when they're written in different languages, browsers to get the data they need to show websites to users, and so developers can make Chrome extensions or other tools without direct access to the code of the program they're asking for data from.

But it's not only sources hosted by other companies that we can use APIs to query. Most self-hosted services, like Home Assistant, provide APIs so that you can build your own automations and control planes without modifying your HA instance's code.

The only way to know that those API calls are being handled properly is to test them, and that's where API clients come in. Postman is probably the best-known, but its restrictive cloud-based structure and proprietary versioning system are the antithesis of self-hosting. What if I told you that you could test your APIs from your computer without needing the cloud and all your tested examples could live in the Git repository for that code? Bruno lets you do just that, and the service's logo is a happy doggy, and I can't argue with that.

If you self-host services with API calls, you need Bruno

Unrestricted API calls to test and verify your APIs

Whether you're poking at smart devices to find out how to import them into Home Assistant when they don't already have integrationor building out a monitoring system with Grafana and InfluxDB, APIs are everywhere. You can use them to pull information from websites, get the weather, sports results, or any necessary information,set up dashboards for monitoring, or chain a post-API call script to use that data for other uses.

But to know whether your API calls are working, you need a way of testing that shows the returned function and how secure it is. API testing tools like Bruno let you set up the APIs you call, then write test scripts in JavaScript to simulate user behavior. It can also link with GitHub Actions and other platforms, so you can automate your testing, perfect for sprawling codebases.

While Bruno does have subscription tiers for advanced functionality, I've been able to get along just fine with the free tier. For that, you get:

  • API Clients: HTTP, Rest, GraphQL, Testing, Documentation, Scripting, Auth, Secret Management, Code Generation
  • Git Integration
  • OAS Import

Of course, you can import your Postman environments to access them from your cloud and onto your computer. Exporting from Postman gives you a JSON file, which you import into Bruno in one step. Paid subscriptions can import a data dump from Postman, which will be handy for bigger teams. Still, it's not necessary, and I'd wager many self-hosting devs are going to have smaller API collections to unseal from Postman's proprietary structure.

Plus it runs on your computer, not in the cloud

The biggest draw for Bruno isn't the simplicity of the IDE and how that simplicity can build into something compelling. It's that you're in charge of your data, whether it's saved on your local computer or in the Git repository of the associated codebase. Keeping it in the same repo gives any new developers of that code an instantly viewable record of how the API should work, with expected endpoints, results, and more, so they do not have to deconstruct the code when onboard.

Bruno makes debugging much easier

My Home Assistant has a new assistant

I've been using Bruno to figure out how to interact with my Home Assistant instance. Those APIs all use a secret API key for my HA, so I'm not using screenshots for those. But I put together a test collection and some simple GET and POST calls to httpbin to illustrate how easy it is to use Bruno to set up the API library you use for your services and test them for the desired response.

Honestly, I don't know why I was doing this the hard way before: hard-coding requests. With Bruno, I see the full response, the headers sent, the timeline of the request and response, and the results of any tests done on that API return (if I were running any, I'm not quite at that stage of learning yet). I can add parameters in a few clicks, rerun the API call, and see the instant results of my changes without having to code something to show me the response.

I've never really been interested in the 'behind the curtain' view. I mean, I know how APIs are used, and I did some basic web development at university all those decades ago, but after using Home Assistant, I want to expand my smart home with custom sensors and other devices using ESPHome. And really, the best way to do that is to know how the API works, and which parts of it I need to pipe into my HA dashboard so I can easily control the things that I don't need or want to automate.

Postman who? Bruno barked and he ran away

I don't like relying on cloud services to test or manage my self-hosted services, or the APIs I can access through them. For me, that defeats the point of self-hosting, and I don't understand why the most well-known API client keeps my API call results in the cloud. Bruno might not be perfect, judging by the GitHub issues list, but it does what I need, while staying on my hardware, and that's what matters. Maybe one day I'll get to the level of knowledge that hits the limits of Bruno, but until then, it's perfect for learning how APIs work and how I can leverage them for tasks.