What Is an API? (+ How Do They Work?)

Written by Coursera Staff • Updated on

Learn about different types of APIs and how to use them.

[Featured Image] A back-end developer in a gray sweatshirt uses their laptop to work on an API with nearby coworkers.

What is an API?

API stands for application programming interface. An API is a set of protocols and instructions written in programming languages such as C++ or JavaScript that determine how two software components will communicate with each other. APIs work behind the scenes to allow users to locate and retrieve the requested information. Think of APIs like contracts that determine how two software systems will interact.

API examples

As an internet user, you’ve most likely experienced the convenience API technology enables when browsing a website or using a mobile app. APIs are a crucial behind-the-scenes aspect of user experience (UX). Consider a few familiar examples of APIs and how a website owner or administrator might use them:

  • The YouTube API allows you to add videos to your website or app, as well as manage your playlists and subscriptions. 

  • The Facebook API for conversions allows you to track page visits and conversions, as well as provide data for ad targeting and reporting.

  • The Google Maps API allows you to embed static and dynamic maps, as well as street view imagery, on your website. 

Any time you land on a site and watch a video, see an ad on Facebook related to a website you recently visited, or use the map on a business’s website to find its physical location, chances are an API has been at work to make this experience possible.

Types of API

Now that you have an API definition, the next step is to become familiar with the different types of APIs.

  • Open APIs - also known as external or public APIs, are available for anyone to use and integrate with their sites or apps. 

  • Partner APIs - are also considered external, but you can use them only if you have a business relationship with the companies providing them.  

  • Internal APIs - also called private APIs, are used by people within a company and help to transfer data between teams or connect different systems and apps. Third parties do not access internal APIs like they do with open or partner APIs. 

  • Composite APIs - combine multiple APIs from different servers or data sources to create a unified connection to a single system. 

  • Web Service API (or Web API) - an application interface between a web browser and a web server

Did you know?

APIs were created before the world wide web, hence the special terms used to define APIs that work with the internet.

Placeholder

API architectural styles

  • REST APIs. REST stands for representational state transfer. It’s a set of guidelines for scalable APIs that are easy to use when transferring data securely. One of the most notable characteristics of REST architecture is statelessness. REST APIs are also known as RESTful APIs.

  • SOAP. SOAP stands for simple object access protocol. This protocol determines how to transmit data across networks, how messages should be sent, and what the messages should include. SOAP is a more complex alternative to REST.

  • RPC. RPC stands for remote procedural call. RPC APIs execute code on remote networks.   

To learn more about different types of APIs, watch this video from the Meta Back-End Developer Professional Certificate

How do APIs work?

First, familiarize yourself with key terms in the brief FAQ below. Then, use the steps that follow to learn how APIs work. 

What is an API key?

An API key is used to authenticate the application calling the API. In other words, it verifies the identity of the application it's interacting with to protect sensitive information.

What is an API call?

Also known as an API request, an API call is a message sent to a server asking the API to perform an action or provide information. It initiates the action that the user requests on a software application or website. 

What is an API gateway?

An API gateway is software that takes user requests, processes them, routes them to the appropriate backend services, and delivers the relevant data back to the user in a simplified package. You can think of them like a front desk receptionist who communicates with customers and helps coordinate the appropriate actions behind the scenes.

How APIs work in 3 steps

Most web APIs follow the workflow below:

  1. The user performs a task on a website, app, or software program, such as clicking a video to watch it.

  2. This action tells the site or app to initiate an API call, which means to submit a request to the API for information from the external server or program. 

  3. The API then retrieves the requested data and delivers it back to the app so the user has the expected experience.

Cloud APIs enable cloud applications to communicate with one another. As organizations deploy more programs and services on the cloud, cloud APIs will become more vital to how we use the internet.

Benefits of using APIs 

APIs benefit businesses, users, and developers in the following ways: 

  • Businesses can access and share content from other software systems.

  • A company’s employees can work faster on tasks and collaborate more easily with coworkers.

  • Internet searchers can find information and interact with sites easily. 

  • External users of apps and digital products can enjoy seamless customer experiences.

  • Developers can often build upon or modify existing APIs, rather than having to create entirely new ones, to deliver value to customers more efficiently. 

  • APIs provide security, so data from one device or server is never fully exposed to another. 

Keep learning about APIs with Coursera

Interested in learning more about APIs from an industry leader while earning credentials for your resume? Consider enrolling in a beginner-friendly, self-paced online course like Meta's Back End Developer Professional Certificate. You'll acquire and apply your skills to build a portfolio not only using APIs, but also programming systems like Python syntax, Linux commands, Git, SQL, Cloud Hosting, Version Control, JSON, and XML.

More Frequently Asked Questions (FAQ) about APIs

Keep reading

Updated on
Written by:

Editorial Team

Coursera’s editorial team is comprised of highly experienced professional editors, writers, and fact...

This content has been made available for informational purposes only. Learners are advised to conduct additional research to ensure that courses and other credentials pursued meet their personal, professional, and financial goals.