What are APIs and how do APIs work?

API mobile phone

What is an API?

API stands for Application Programming Interface. An API is a software intermediary that allows two applications to talk to each other.  In other words, an API is the messenger that delivers your request to the provider that you’re requesting it from and then delivers the response back to you.

APIs allow for data to be sent between devices between

An API defines functionalities that are independent of their respective implementations, which allows those implementations and definitions to vary without compromising each other. Therefore, a good API makes it easier to develop a program by providing the building blocks.

When developers create code, they don’t often start from scratch. APIs enable developers can make repetitive yet complex processes highly reusable with a little bit of code. The speed that APIs enable developers to build out apps is crucial to the current pace of application development.

Developers are now much more productive than they were before when they had to write a lot of code from scratch. With an API they don’t have to reinvent the wheel every time they write a new program. Instead, they can focus on the unique proposition of their applications while outsourcing all of the commodity functionality to APIs.

The principle of API abstraction enables speed and agility

One of the chief advantages of APIs is that they allow the abstraction of functionality between one system and another. An API endpoint decouples the consuming application from the infrastructure that provides a service. As long as the specification for what the service provider is delivering to the endpoint remains unchanged, the alterations to the infrastructure behind the endpoint should not be noticed by the applications that rely on that API.

Therefore, the service provider is given a great deal of flexibility when it comes to how its services are offered. For example, if the infrastructure behind the API involves physical servers at a data center, the service provider can easily switch to virtual servers that run in the cloud.

If the software running on those servers (such as credit card processing software) is written in, say, Java running on an Oracle-based Java application server, the service provider can migrate that to Node.js (server-side Javascript) running on Windows Azure.

The ability of API-led connectivity to allow systems to change as easily as plugging in a plug to a socket is key to the modern vision of enterprise IT. Gone are the days of messy point-to-point integrations for connecting enterprise solutions which take time and resources to maintain.

How do APIs work?

Imagine a waiter in a restaurant.  You, the customer, are sitting at the table with a menu of choices to order from, and the kitchen is the provider who will fulfill your order.

You need a link to communicate your order to the kitchen and then to deliver your food back to your table. It can’t be the chef because she’s cooking in the kitchen. You need something to connect the customer who’s ordering food and the chef who prepares it.  That’s where the waiter — or the API —  enters the picture.

The waiter takes your order, delivers it to the kitchen, telling the kitchen what to do. It then delivers the response, in this case, the food, back to you. Moreover, if the API is designed correctly, hopefully, your order won’t crash!

A real example of an API

How are APIs used in the real world? Here’s a very common scenario of the API economy at work: booking a flight.

When you search for flights online, you have a menu of options to choose from. You choose a departure city and date, a return city and date, cabin class, and other variables like your meal, your seat, or baggage requests.

To book your flight, you need to interact with the airline’s website to access the airline’s database to see if any seats are available on those dates, and what the cost might be based on the date, flight time, route popularity, etc.

You need access to that information from the airline’s database, whether you’re interacting with it from the website or an online travel service that aggregates information from multiple airlines. Alternatively, you might be accessing the information from a mobile phone. In any case, you need to get the information, and so the application must interact with the airline’s API, giving it access to the airline’s data.

The API is the interface that, like your helpful waiter, runs and delivers the data from the application you’re using to the airline’s systems over the Internet. It also then takes the airline’s response to your request and delivers right back to the travel application you’re using. Moreover, through each step of the process, it facilitates the interaction between the application and the airline’s systems – from seat selection to payment and booking.

APIs do the same for all interactions between applications, data, and devices. They allow the transmission of data from system to system, creating connectivity. APIs provide a standard way of accessing any application data, or device, whether it’s accessing cloud applications like Salesforce, or shopping from your mobile phone.

Types of APIs

There are numerous types of APIs. For example, you may have heard of Java APIs, or interfaces within classes that let objects talk to each other in the Java programming language. Along with program-centric APIs, there are also Web APIs such as the Simple Object Access Protocol (SOAP), Remote Procedure Call (RPC), and perhaps the most popular—at least in name— Representational State Transfer (REST). There are 15,000 publicly available APIs, according to Programmable Web, and many thousands of more private APIs that companies use to expand their internal and external capabilities.

More API resources

If you’re interested in learning more, take a look at our API resources on definitions, design, and management. We also have more resources about how APIs are changing the enterprise and becoming valuable business assets themselves. If you’d like to take the next step, take a look at our solutions for APIs in the enterprise.

We'd love to hear your opinion on this post

30 Responses to “What are APIs and how do APIs work?”

  1. This post has explained API’s overall detailed information.Its provided useful information (abstracted).For beginners ,it is worthful and given pointful manner.

  2. Good Info on APIs

  3. Fantastic article! Short but detailed. I would have liked to see more articles regarding types of APIs like SOAP & REST in Related Posts area

  4. I am new to API’s, and the information provided on this page has given me a detailed information of how API works. It’s a very good post.

  5. This is the first time I have seen a clear example(s) of How APIs work. Thank you!!!! I needed to try and explain this to a non-tech person and not being a tech person myself, I needed to understand this process first. Thank you so much

  6. Really, this helps me a lot to understand the API’s functionality and what it works.

  7. Awesome post

  8. This was EXTREMELY useful in understanding how API’s work. It makes complete sense to me now, your examples were so helpful! Thanks so much for providing this information.


  9. Thank you for the article. It really helped me understand API. I really appreciate you explaining it all in simple words.

  10. Very Useful. Very lucid and very simply explained. Knowledge shows!!

  11. This post is really helpful.

  12. I am getting pop ups from Malwarebytes and I have tried to delete without success. I see I have many api’s and how can I identify if this is my problem. As far as I know I don’t use api’s for any purpose. How can I safely delete the cause, if this is it, without damaging my limited normal use of Wind 10?


  13. Thanks for all the info. Was really needed in making of my project. Would be putting the site reference.

    Secondly, if more could be added to showing how practically API works.

  14. waiter in a restaurant i liked it.

  15. Wow, awesome article. I really love it. It’s give a clear picture of what an API is

  16. This post is really helpful for me. Thanks.

  17. This explains clearly in layman’s terms what API is. I am grateful, as I was struggling to understand the other definitions I came across.

  18. I wanted to know what an API was and you explained it beautifully. I especially like the waiter analogy, it really fleshed out what an API does.

  19. I have no technical background and this article made it so easy for me to understand about APIs. Very well written. Thanks.

  20. Excellent article that explains APIs in simple terms without dumbing things down. Good balance that provides a broad comprehensible picture.

  21. Hi Team,
    I am beginner .
    This post gave a practical knowledge regard API.

    Thank you

  22. A great blog for beginners to get familiarised with the basic api concepts.

  23. Great Article! It’s really helpful to better understand APIs. Thank you!

  24. This is very useful Information. I was very confused about API’s. but now I am very clear. By giving that simple restaurant example u make me clear ma’am.
    Thank u so much!

  25. Wonderful article, gives great insights about APIs. Well written.

  26. Nice article i must say. It would be a great help if you could write about API documentation in easy words.

    Thanks in advance.