How much does it cost to build an API

Gerard Lutterop
yourapi
Published in
6 min readApr 24, 2018

Introduction
To indicate the cost of an API, the first question to answer is the type of API. We discern an incoming API, which connects an external API to your platform, and an outgoing API, where other parties can use your API. The outgoing API can for instance be used by an end user -by a mobile app or a website- or another API, building an API ecosystem.

Photo by Artem Bali on Unsplash

Incoming API
An incoming API, which is provided by some external party, is intended to be as easy to use as possible. However, also based on our own experience connecting a large number of external API’s, the sky isn’t as blue as you’d like it to be. First there is the connectivity and authorization, then there is the mapping of entities and fields to your internal structure, you have to provide for error handling etc etc. All in all it unfortunately isn’t just a matter of calling the external API and simply passing the result. As one of our clients says: ‘connecting s*cks’.

Making some assumptions about average efforts etc, (see cloud-elements.com), going through a number of standard phases like research, prototype, build an MVP, transaction management, deployment, monitoring and documentation, for an average incoming API the number of days for building the integration is between 20–30 days. When the integration is performed by an external party, the cost can easily go north of $15.000.

That excludes the operational costs of hosting and maintaining this integration service. The cost for a single integration is between $200 and $500 a month, depending on external or internal operations.

From our own experience, we can unfortunately confirm these numbers. In a previous service we made a number of connections to incoming API’s for a large corporate, using SOAP calls over a VPN. This kind of connection can easily surpass the mentioned costs.
More modern API’s (REST based, with token authentication) are technically a lot easier to set up, but a number of problems remain, like the entity and field mapping, error handling, transaction handling, temporary outage and recovery of data etc. So even a more modern REST interface still costs quite a lot to integrate.

Outgoing API, additional cost
An outgoing API is a totally different beast. Here the responsibility for providing the API, the storage backend, security, scalability etc is for the provider of the API. We’ll compare the activities for a ‘traditional’ solution -assuming a website directly connected to a database- with the same solution where direct database access is replaced with an API connection. This can for instance be used to enable a single page website, where the structure and layout stay the same and only the content is replaced when a user navigates somewhere in the site. Many modern web pages use such a setup.

Simply comparing the setup of these two solutions reveals one of the drawbacks of building an outgoing API:

Traditional and API-style data access

In the short term, using an API adds extra cost to the solution. An API only seems to make sense when an extra consumer is involved, like an app or an external consumer:

API essential for multiple consumers

But on to the cost. Let’s try to breakdown the extra activities for providing an API, compared to the ‘traditional’ setup where the website is directly connected to the database. We assume here that a ‘medium’ complex functionality is used, like a CMS-like setup with users, articles, discussions, authorization etc:

Cost for additional API solution, when website is in place.

We think these numbers are pretty conservative, in our experience setting up, building and maintaining an API takes longer.
The exact costs are dependent on whether you do it in-house or have it done externally of course, but for the sake of argument let’s assume it is all done in-house with developers costing $40/hr. The total initial cost is in the range of $7,500 — $12,000 and the monthly cost is in the range of $130 — $350, excluding functional maintenance.
Of course the initial cost will rise if the work is done externally.
Even with these quite optimistic assumptions about the amount of work, the minimum initial coasts will be somewhere in the $10k range and the extra operational costs are somewhere in the $2k-4k/year range. Because of these extra costs and because of the limited value when the only user is the website, which already exists, many companies hesitate in proceeding from the standard approach (one website, one database) to an API-approach. The costs do not justify the extra functionality, because in a single web site situation, there is simply not an advantage.

Outgoing API, total cost
The cost we calculated for addition of an API are the additional costs, compared to an existing solution. This does not take the complete costs into account, because the cost of the database (setup, deployment, exploitation) is not taken into account. Suppose you want to provide an API not just to the web site, but also to external users. Then you start out with the API, without an existing solution to build upon. We assume the same functionality again (a CMS like API):

We would certainly advise hosting your database by an expert, to avoid the hassle of setting up failover, backups etc. The cost of $250 is based on a meager 20GB of storage, amounting to roughly 5 million records in the database.
So the total initial cost would be $15,000 — $25,000 and the monthly cost would be $650 — $1,350.

Are API’s too expensive then?
With traditional technology, API’s in many cases cost too much to justify developing and exploiting an API, just because they are the latest rage. This is one of the reasons why API’s take off so slowly, using an incoming API or providing an outgoing API is simply quite costly.
When you look at the API landscape, you see bigger companies offering all kinds of API’s, which are all limited to a specific field. Some can be simple, like a weather API, and some can be quite complex, like a CMS API.
In many cases, the cost of providing an API simply outweigh the benefits, hindering a greater adoption of API’s.

Any alternatives?
When you develop your own API’s using the technologies you are comfortable with, the cost in most cases don’t justify providing an API. But suppose you could use a new technology, where you simply specify the API and custom behavior, and let a specialist provider have your design and custom code converted to a secure, scalable API you can use immediately?
A service just offering this is yourapi. Instead of the separate steps of defining a database, writing custom code to connect the database to an API you can just focus on the API interface and have all the plumbing done automatically.
To make a comparison of rolling your homegrown API and using yourapi, we take the cost breakdown again and stack it against a similar solution in yourapi:

The costs for yourapi assume 5M records, 100M requests each month and 1 developer. Let’s compare the costs for a traditional solution and a yourapi solution for a number of scenario’s:

With a service like yourapi, which focuses exclusively on design, programmability, deployment, security, stability and scalability of an API, you can not only focus on what you do best, but the costs and time to deploy will be dramatically lower.

--

--