We can now have machines that are more intelligent than human beings. And yet, we can't seem to be able to do API integration properly. What is it with APIs that generate so much friction for developers? The Internet is about 55 years old. The Web is 33 years old. JSON turns 18—really! During all this time, we couldn't find an easy way to connect APIs. Why is that, and how can we collectively fix it? Keep reading.
This article is brought to you with the help of our supporter, n8n.
n8n is the fastest way to plug AI into your own data. Build autonomous, multi-step agents, using any model, including self-hosted. Use over 400 integrations to build powerful AI-native workflows.
API integrations aren't something new. In fact, the goal of APIs is precisely to enable connecting different applications together. While building one application, you can choose to use an API to fulfill some of the features. It's easy to think that all application development depends on APIs. Especially Web-based applications where connectivity comes as a guarantee.
So, why aren't APIs easy to integrate with, and what are the factors that contribute to a growing frustration among developers? APIs are supposed to make things easy for developers. But the reality is that building an integration often involves going through poor documentation and understanding inconsistent data formats in an endless loop of trial and error.
The first hurdle developers have to go through is understanding API documentation. Some APIs offer well-written, up-to-date how-to guides and tutorials. However, in most cases, what is available is an auto-generated API reference that simply shows what the API can do. As a developer, you have to go through the whole reference to understand the operations, parameters, and responses. You then have to understand how to fulfill your case with the available operations. Once you find what operations to use, you start experimenting to see how things really work.
The second frustration happens during experimentation. If you can go past the authentication and actually make requests to the API, you end up trying to see if the operations act as they're advertised in the reference. In many situations, you'll find discrepancies. Sometimes, there's a parameter that no longer exists. Or, there are side effects that produce a response that is not even documented. You feel like your attempts to follow the reference aren't getting you anywhere. If there's an SDK, you try using it.
Outdated SDKs are the source of another type of frustration for developers. Imagine finding out, after installing an SDK, that what it provides doesn't work well in all situations. Even worse is seeing that the SDK doesn't adapt to your particular needs. You end up trying to update the SDK so it works with what the API provides. Sometimes, you even try to reverse-engineer the SDK and write your own wrapper to communicate with the API. If you're successful and the code you wrote passes all your tests, you'll deploy your solution. That is the moment when your anxiety begins.
After your code is running in production, you have to make sure it works without issues. If guaranteeing your own code doesn't have problems isn't easy, imagine the same thing for an API someone else is maintaining. The API provider moves at its own speed and sometimes makes changes to the API. Sometimes, those changes break the integration you wrote before, breaking your solution. Even if there are no breaking changes, sometimes the API you integrate with stops working or behaves erratically. Leaving your solution in an undesired state. All these possibilities raise your blood pressure and keep you awake at night.
And all this can happen on one single API. Now, picture a situation where your integration involves several APIs. If what you're building is a workflow involving operations from different API providers, then the degree of anxiety increases. Suddenly, you're talking about incompatibilities between responses from one API and request payloads from another. And all the code you have to write to translate how different operations work into a common language. Whenever something changes, the possibilities of failure are almost certain.
All these frustrations exist because not all APIs follow the same standards and patterns. Since providers are free to implement their APIs as they see fit, there's no guarantee that they'll work easily with each other. Another source of worries is in the management of workflows. All the interactions between operations have to be managed. I'm talking about things like retrying requests in case of failure, handling rate-limiting, securely storing authentication tokens, and temporarily storing state between operations. If any of these things fail, the whole solution might fail.
It doesn't have to be this way, though. There are numerous solutions that let you work with existing APIs without going through all the frustration. Some solutions are targeted at people who don't want to write any code, while others let you manipulate full workflows programmatically. Are those solutions also prone to errors? Yes, certainly. However, the effort to solve an issue with one integration solution is much lower than what it would take to debug multiple API operations. We all pick where we want to focus our time and energy. In my case, I prefer to spend it wisely on things I can add value to, not on debugging requests to API operations.
I really enjoy your blog! Your insights into API integration challenges have been very helpful. I recently started using EchoAPI for API mocking, and it has truly transformed how I approach testing, allowing for greater efficiency and effectiveness.