Web Application Programming Interfaces (Web APIs) 101

SENG 42273 — Semantic Web and Ontological Engineering

APIs are everywhere. You are making use of them even if you don’t know what an API is. Have you ever wondered how you are able to shop online, order an Uber, or even check the weather on your phone? They are all powered by APIs.

What is an API?

What is a Web API?

Web APIs use a request-response messaging system and standards like JSON, XML to describe the content in the message body. Web APIs come in forms like SOAP, REST, and GraphQL. An API endpoint is the point of entry in a communication channel where the client and the server interacts. A single API can multiple endpoints.

Why do we use web APIs?

Web APIs also facilitate the distributed deployment of applications. Instead of developing a monolithic application, the developers can create a set of loosely coupled microservices and use API calls to facilitate communication among them. Each microservice can be deployed, maintained, and scaled independently from others, which makes it a cost-effective, reliable, and flexible approach for developing applications.

Mobile computing is another area that heavily utilizes the use of web APIs. Since mobile devices have limited resources (CPU, RAM, storage, and power), mobile applications can use cloud servers to perform resource-intensive operations and only retrieve the outcome. APIs are what powers the communication between the application and the cloud.

From a business perspective, organizations can expose their APIs to the public in order to integrate their services to other applications. This provides a competitive advantage for the organization by expanding its reach and it can generate revenue by charging fees for API calls. For example, Google Maps APIs are used by applications like Uber to integrate the maps and navigation functionalities.

Examples for web APIs

  • YouTube API: integrate YouTube features to a client application, including the ability to upload videos, create and manage playlists, and more.
  • Spotify API: provides access to user-related data, like playlists and music that the user’s music library.
  • Weatherstack API: provide weather-related services like forecasts, real-time weather, etc.
  • Facebook APIs: allow applications to use social connections and profile information to make applications more involving, etc.

Limitations of web APIs

  • Latency in API calls due to network issues.
  • Exposing APIs adds additional attack surfaces to a web server.
  • Network errors may cause request failures and reduce stability.

These limitations can be sometimes circumvented using techniques like caching, proper error handling, and following security practices.

That concludes a simple introduction to the concept of web APIs. See you in the next one! 🙂