How APIs Work

Mobile app development 101: APIs

For the general public, the term “API” may not ring the slightest bell. But did you know that without this tech component, the world as we know it today would not be the same?

For instance, without APIs, we wouldn’t be able to use social media apps on our smart phones. The mere act of using an app to post something on Facebook, Twitter, Instagram, or LinkedIn accounts have APIs involved in the background. The same goes for online streaming services such as YouTube, Netflix, and Spotify. They won’t work on our mobile devices without APIs. 

In short, APIs form part of most tech projects and have made their way into many aspects of our daily life, even without us realising it.

So what are APIs, and what do they do? This article gives you the breakdown into this app development component that continues to reshape today’s digital landscape.

Beyond the acronym

API stands for application programming interface. APIs are a set of software components, tools, and rules (protocols).[1] Their role is to enable two (or more) independently designed systems to communicate. So in short, APIs help two software systems, and most commonly, applications to communicate with each other.[2]

API (Application Programming Interface) text with drawing of device on notebook and glowing light bulbs

An API is like the post service of the digital world. Let’s imagine you are trying to send a letter to your friend. You write the letter, put down the address, and drop the letter into the post box. The postman then picks up your letter, and delivers it to your friend, who then reads and responds with a letter of their own.

An API does the same in the digital world: It takes digital messages (data) and transports them from one destination to another. For example, if you are a developer trying to add weather forecasting into your app, your app would send a weather data request (a digital letter) to Google (your friend) via their API (the post service). Google would send a response (their letter) back to your app via their API also. Your app can then use the response to show what the weather is for the day. 

Implementing APIs

How are APIs used in the real world? Let’s look at a few examples!

Social logins

Most developers these days streamline the sign-up process by connecting their apps to social login APIs.
Most developers these days streamline the sign-up process by connecting their apps to social login APIs.

Ever notice how easy it is these days to join multiple digital services even without signing up? Say you come across a newly launched music streaming app. You want to try it out, but hate going through the laborious sign-up process. However, you are suddenly presented with a “Continue with Facebook” or “Continue with Google” option. A click and viola! You’ve logged in without the manual hassle of filling out your profile information and are using the app within seconds.

So how did the music streaming app do that?

Developers are able to streamline the sign-up process by connecting their apps to Facebook and Google’s login APIs. So in our example, the music app sends a request to Facebook or Google’s APIs. The API returns the relevant authority to allow the user to access the music app.

In-app purchases

In-app purchase APIs enable ease of purchases for app add-ons, premium features, or other paid content
Developers connect their apps to in-app purchase APIs to enable ease of purchases for app add-ons, premium features, or other paid content.

In-app purchase APIs are another good case in point. Many apps offer premium services or add-ons on top of basic features for a fee.

The mobile game app Pokémon Go, for example, allows ease of levelling up to players if they spend money in the game. Users are able to do so because of the payment APIs implemented in the game app. 

Most developers connect their apps to the App Store or Google Play’s in-app purchase APIs to allow ease of purchases for app add-ons, premium features, or other paid content. In-app purchases also eliminate the burden of entering payment details for every transaction. By connecting their apps to Apple or Google’s in-app purchase APIs, the developers enable Google or Apple to maintain their app’s payment systems.

On the other hand, because the developers do not have to build an in-app purchase mechanism from scratch, they are able to focus more on other functionalities of their apps.

Travel industry

Developers can also connect websites or apps to business partners’ APIs.
In the travel industry, aggregators connect their websites or apps to their partners’ APIs, and they’ll be able to use data from their partner websites accordingly.

Travel fare aggregators, such as Expedia and Booking.com also use APIs. Let’s say you are planning to go on a vacation. Naturally, you want to get the best available deals. Instead of visiting individual websites of multiple airlines and hotels to compare prices, you can go to a travel fare aggregator site.

The aggregator site, which partners with hundreds of airlines and accommodations, will do the search for you and show you which airlines and hotels have the cheapest ticket price and room rate. Travel fare aggregators just need to connect their websites or apps to their partners’ APIs, and they’ll be able to use data from their partner websites accordingly.

Why have APIs become such a big thing?

Dominate the App Store.

Get the latest industry news first.

For people in the development universe, such as the app developers at Appetiser App Development, a world without APIs is unimaginable.  But why?

Efficiency

These days, developers don’t need to build every application solution from the ground up, thanks to APIs.
These days, developers don’t need to build every application solution from the ground up, thanks to APIs.

APIs have become an enabler for building creative, purposeful, and innovative applications quicker than ever before.

Let’s say I want to build an app. During the app development process, my team decides to add a chat mechanism to our app in addition to our unique selling points. However, we still wants to bring our app idea to market as soon as possible. Is there a way for me to complete the project within a reasonable time without compromising on quality?

Thanks to APIs, the answer is a resounding yes. These days, us developers can leverage existing solutions via third-party APIs. That way, I don’t need to build every feature from the ground up.

In this particular example, the practical route would be connecting my app to the API of a cloud communication platform (the third-party service). In short, we’re connecting to someone who enables our chat mechanism.

By implementing an existing solution via a third-party API, I will be able to focus my energy on polishing my unique selling points to standout in the market. My app can also be launched much quicker than if I built the chat mechanism from scratch. 

Stability

Third-party service providers often release APIs in their stable versions.
Most third-party services take the necessary steps of testing their APIs thoroughly to ensure stability.

An additional benefit of implementing solutions via third-party services’ APIs is that they have usually already been “battle tested.” This means that the API provider has already taken the necessary steps of testing the APIs to make sure they are market-ready. Third-party service providers often make it a point to make their APIs as future proof as possible when releasing them as stable versions.

Of course, the solutions may still encounter bugs every now and then. But those instances would certainly be less than if I built the services myself. Existing solutions have often matured security wise. If the solution has been implemented by many apps already, security holes that surfaced especially during the infancy stage  — should have already been addressed. 

Many APIs are easy to use, and some are even free.

But of course they have limitations!

Like any other technology, APIs are not perfect. Here are several points to consider implementing third party APIs, or developing your own API:

One size does not fit all

A developer who has specific needs for an app may have to discuss for customisation of solutions.
A developer who has specific needs for an app may have to discuss for customisation of solutions.

Third-party APIs are generally designed for mass consumption and are limited only to the purpose they serve. Hence, a developer who has custom needs for an app may have to reach out to the third-party provider and discuss solutions for customisation. Of course, this is dependent on whether the third-party provider is willing to work on the developer’s request. If not, the developer will be forced to look for alternative solutions, or he has to forgoe the feature altogether.

Frequent changes

Developers should always be to update their apps.
Developers should always be ready to update their apps.

App developers need to keep up with API updates. To easily facilitate API integrations, third-party services typically provide developers with software developer kits (SDKs). An SDK contains a set of software tools, documentation, and code examples developers can use when integrating the service. This ensures successful API integration. However, SDKs are updated regularly, so developers need to keep up with the changes resulting from any updates. This may increase maintenance requirements to cover their bug fixes, bug patches, and security improvements. Additionally, third-party services may implement policy changes that may have an impact on their SDKs or APIs. Developers should therefore be ready to modify their apps accordingly upon the release of any new versions or updates.

Trouble with incompatibilities

Developers also consider an API’s compatibility with the platforms and devices targeted by their apps.

The API or service being considered may not be compatible with the platforms and devices targeted. Let’s say you want to connect your app to a niche service. However, you also discover that the niche service only supports an outdated iOS or Android version. If it only makes sense for you to target the latest iOS or Android versions, you may just have to forgo the niche service.

Lifespan unpredictability

The development industry is not an exception to businesses scaling down or even ceasing operations.
The development industry is not an exception to businesses scaling down or even ceasing operations.

In today’s volatile market, businesses scaling down or even ceasing operations have become almost commonplace. The development industry is not an exception to this situation. If say, a third-party service shuts down, apps heavily reliant on that service would have to find an alternative solution similar to the existing one. But if there is none, the risk posed here is that the app itself may also end up closing down. Therefore, businesses should look for third-party services that are most likely able to support their apps for a long period of time. Fortunately, many services nowadays would indicate in their agreement the length of commitment. Hence, the availing party is somehow assured that the third party wouldn’t suddenly shut down the service.

However, every API integration comes with a risk that the API may be shut down no matter how large and successful a business is. A famous example is Facebook’s Account Kit that developers could use to easily authenticate users. Facebook shut this service down in March 2020 leaving many developers looking for expensive alternatives.

Final words

The growing adoption of APIs has been among the dominant web and mobile app development trends of recent years — and it doesn’t show signs of slowing down any time soon. It’s not surprising, considering the huge impact and advantages discussed above.

As someone trying to build technology it may be hard to decide which APIs and third party services to use, but without the use of APIs you will end up rebuilding a large amount of functionality. Building APIs for your own service may also increase adoption rate of your own product. So pick the right partners and services carefully, and you will be well positioned for the future.

References:

[1] Columbus, L. (2017). 2017 is Quickly Becoming the Year of the API Economy. Retrieved from https://www.forbes.com/sites/louiscolumbus/2017/01/29/2017-is-quickly-becoming-the-year-of-the-api-economy/#40d37c276a41.

[2] Asthana, A. (2019). We’re Living In An API-First World — Let’s Start Developing Like It. Retrieved from https://www.forbes.com/sites/forbestechcouncil/2019/01/30/were-living-in-an-api-first-world-lets-start-developing-like-it/#2a369d33651b.

Dominate the App Store.

Get the latest industry news first.

Roamni Case Study
How Jason & Greg Built an App Worth Over $5 Million
  • How to Get $100,000s in Funding for Your App
  • What Makes a Profitable and Successful App
  • 7 Critical Entrepreneurial Lessons From Jason and Greg
  • How to Create Apps that Get People Hooked
Mark Valles

Mark Valles is the Lead iOS Developer for Appetiser. Mark previously worked on an iOS project called Piclyf, mostly with the development of Lifebit iOS. Mark also developed and maintained apps for F45 Training and for smart lock system companies (ImGATE and VIZPin). When not working, Mark enjoys sketching and spending time with his kids.
[if lte IE 8]
[if lte IE 8]
[name="utm_session_id"]
[name="utm_session_id"]