What is an API? (2024)

Published June 2, 2022

Overview

API stands for application programming interface, whichis a set of definitions and protocols for building and integrating application software.

API release policies

Private

The API is only for use internally. This gives companies the most control over their API.

Partner

The API is shared with specific business partners. This can provide additional revenue streams without compromising quality.

Public

The API is available to everyone. This allows third parties to develop apps that interact with your API and can be a source for innovation.

Innovating with APIs

Exposing your APIs to partners or the public can:

  • Create new revenue channels or extend existing ones.
  • Expand the reach of your brand.
  • Facilitate open innovation or improved efficiency through external development and collaboration.

Sounds great, right? But how can APIs do all that?

Let’s return to the example of the book distributing company.

Suppose one of the company's partners develops an app that helps people find books on bookstore shelves. This improved experience brings more shoppers to the bookstore—the distributor's customer—and extends an existing revenue channel.

Maybe a third party uses a public API to develop an app that lets people buy books directly from the distributor, instead of from a store. This opens a new revenue channel for the book distributor.

Sharing APIs―with select partners or the whole world―can have positive effects. Each partnership extends your brand recognition beyond your company’s marketing efforts. Opening technology to everyone, as with a public API, encourages developers to build an ecosystem of apps around your API. More people using your technology means more people are likely to do business with you.

Making technology public can lead to novel and unexpected outcomes. These outcomes sometimes disrupt entire industries. For our book distributing company, new firms―a book borrowing service, for example―could fundamentally change the way they do business. Partner and public APIs help you use the creative efforts of a community larger than your team of internal developers. New ideas can come from anywhere, and companies need to be aware of changes in their market and ready to act on them. APIs can help.

An extraordinarily brief history of APIs

APIs emerged in the early days of computing, well before the personal computer. At the time, an API was typically used as a library for operating systems. The API was almost always local to the systems on which it operated, although it sometimes passed messages between mainframes. After nearly 30 years, APIs broke out of their local environments. By the early 2000s, they were becoming an important technology for the remote integration of data.

Remote APIs

Remote APIs are designed to interact through a communications network. By remote,we mean that the resources being manipulated by the API are somewhere outside the computer making the request. Because the most widely used communications network is the internet, most APIs are designed based on web standards. Not all remote APIs are web APIs, but it’s fair to assume that web APIs are remote.

Web APIs typically use HTTP for request messages and provide a definition of the structure of response messages. These response messages usually take the form of an XML or JSON file. Both XML and JSON are preferred formats because they present data in a way that’s easy for other apps to manipulate.

SOAP vs. REST

As web APIs have spread, a protocol specification was developed to help standardize information exchange: Simple Object Access Protocol, more casually known as SOAP. APIs designed with SOAP use XML for their message format and receive requests through HTTP or SMTP. SOAP makes it easier for apps running in different environments or written in different languages to share information.

Another specification is Representational State Transfer (REST). Web APIs that adhere to the REST architectural constraints are called RESTful APIs. REST differs from SOAP in a fundamental way: SOAP is a protocol, whereas REST is an architectural style. This means that there’s no official standard for RESTful web APIs. As defined in Roy Fielding’s dissertation “Architectural Styles and the Design of Network-based Software Architectures,” APIs are RESTful as long as they comply with the 6 guiding constraints of a RESTful system:

  • Client-server architecture: REST architecture is composed of clients, servers, and resources, and it handles requests through HTTP.
  • Statelessness: No client content is stored on the server between requests. Information about the session state is, instead, held with the client.
  • Cacheability: Caching can eliminate the need for some client-server interactions.
  • Layered system: Client-server interactions can be mediated by additional layers. These layers could offer additional features like load balancing, shared caches, or security.
  • Code on demand (optional): Servers can extend the functionality of a client by transferring executable code.
  • Uniform interface: This constraint is core to the design of RESTful APIs and includes 4 facets:
    • Resource identification in requests: Resources are identified in requests and are separate from the representations returned to the client.
    • Resource manipulation through representations: Clients receive files that represent resources. These representations must have enough information to allow modification or deletion.
    • Self-descriptive messages: Each message returned to a client contains enough information to describe how the client should process the information.
    • Hypermedia as the engine of application state: After accessing a resource, the REST client should be able to discover through hyperlinks all other actions that are currently available.

These constraints may seem like a lot but they’re much simpler than a prescribed protocol. For this reason RESTful APIs are becoming more prevalent than SOAP.

In recent years, the OpenAPI specification has emerged as a common standard for defining REST APIs. OpenAPI establishes a language-agnostic way for developers to build REST API interfaces so that users can understand them with minimal guesswork.

Another API standard to emerge is GraphQL, a query language and server-side runtime that’s an alternative to REST. GraphQL prioritizes giving clients exactly the data they request and no more. As an alternative to REST, GraphQL lets developers construct requests that pull data from multiple data sources in a single API call.

SOA vs. microservices architecture

The 2 architectural approaches that use remote APIs most are service-oriented architecture (SOA) and microservices architecture. SOA, the oldest of the 2 approaches, began as an improvement to monolithic apps. Whereas a single monolithic app does everything, some functions can be supplied by different apps that are loosely coupled through an integration pattern, like an enterprise service bus (ESB).

While SOA is, in most respects, simpler than a monolithic architecture, it carries a risk of cascading changes throughout the environment if component interactions are not clearly understood. This additional complexity reintroduces some of the problems SOA sought to remedy.

Microservices architectures are similar to SOA patterns in their use of specialized, loosely coupled services. But they go even further in breaking down traditional architectures. The services within the microservices architecture use a common messaging framework, like RESTful APIs. They use RESTful APIs to communicate with each other without difficult data conversion transactions or additional integration layers. Using RESTful APIs allows, and even encourages, faster delivery of new features and updates. Each service is discrete. One service can be replaced, enhanced, or dropped without affecting any other service in the architecture. This lightweight architecture helps optimize distributed or cloud resources and supports dynamic scalability for individual services.

APIs vs webhooks

A webhook is an HTTP-based callback function that allows lightweight, event-driven communication between 2 APIs. Webhooks are used by a wide variety of web apps to receive small amounts of data from other apps, but webhooks can also be used to trigger automation workflows in GitOps environments.

Webhooks are often referred to as reverse APIs or push APIs, because they put the responsibility of communication on the server, rather than the client. Instead of the client sending HTTP requests—asking for data until the server responds—the server sends the client a single HTTP POST request as soon as the data is available. Despite their nicknames, webhooks are not APIs; they work together. An application must have an API to use a webhook.

Keep reading

Article

What is an API?

API stands for application programming interface—a set of definitions and protocols to build and integrate application software.

Article

What does an API gateway do?

An API gateway is an application programming interface (API) management tool that sits between a client and a collection of backend services.

Article

Why Red Hat for APIs?

Our API solutions focus on reusability, IT agility, and a management interface that helps you measure, monitor, and scale.

More about APIs

Products

An infrastructure platform that lets you share, distribute, control, and monetize your application programming interfaces (APIs).

Related articles

Resources

E-book

Open APIs in Financial Services for Dummies

Podcast

Command Line Heroes Season 2, Episode 6:

"The data explosion"

E-book

The API owner's manual

What is an API? (2024)

FAQs

What is an API with an example? ›

APIs are mechanisms that enable two software components to communicate with each other using a set of definitions and protocols. For example, the weather bureau's software system contains daily weather data. The weather app on your phone “talks” to this system via APIs and shows you daily weather updates on your phone.

What does API mean for dummies? ›

APIs, or application programming interfaces, act as the language that allows different software applications to talk to one another. Imagine you're ordering a coffee at a cafe; the API is like the waiter who takes your order to the barista and then brings your coffee to you.

What are the four types of APIs? ›

What are the different web API types?
  • Open APIs. Public APIs (or Open APIs) function through a set of tools, routines, and protocols for developing software applications. ...
  • Partner APIs. ...
  • Internal APIs. ...
  • Composite APIs.
May 2, 2023

What does an API look like? ›

In practice, an API simply looks like a hefty block of code. But it empowers developers to build user-friendly software. An API is a hefty block of code that empowers developers to build user-friendly software.

What is a real life example of an API? ›

Streaming services like Netflix and Spotify use private APIs to ensure media distribution across various devices. These APIs allow content to be streamed seamlessly on different platforms, from smart TVs to smartphones.

What is an API in layman's terms? ›

API is the acronym for application programming interface — a software intermediary that allows two applications to talk to each other. APIs are an accessible way to extract and share data within and across organizations.

Is API easy to learn? ›

Unfortunately, real software development with APIs is not so simple. In fact, programmers experience significant challenges when using APIs for many categories of functionalities: networking, databases, web applications, web services, graphics, user interfaces, text processing, and so forth.

What is an API beginner? ›

What is an API for a beginner? An API key for beginners is a set of methods and functions that an app or program uses to communicate with another app or program. They are also known as "methods" in computer science. Users can use an API to obtain information from other programs, get data, and more.

How does an API work? ›

How do APIs work?
  1. A client sends a request to the API server, usually over the internet or a local network. ...
  2. The API server receives the request and processes it. ...
  3. The API server sends a response back to the client, which may include data, an error message, or a status code indicating the result of the operation.
Jul 25, 2023

How to create an API? ›

Choosing your API design tools
  1. In the console, open the navigation menu and click Developer Services. Under API Management, click Gateways.
  2. On the APIs page, click Create API Resource and specify its Name. ...
  3. Click Create to create the new API resource.
  4. Write the backend code. ...
  5. Test the backend code. ...
  6. Deploy.

What are APIs mainly used for? ›

Web APIs provide machine-readable data and functionality transfer between web-based systems which represent client-server architecture. These APIs mainly deliver requests from web applications and responses from servers using Hypertext Transfer Protocol (HTTP).

What is the best example of API? ›

The Google Maps API and Twitter API may be among the most widely used API examples, but most software-as-a-service (SaaS) providers offer APIs that let developers write code that posts data to and retrieves data from the provider's site as well.

What the heck is an API? ›

An application programming interface is a computing interface exposed by a particular software program, library, operating system or internet service, to allow third parties to use the functionality of that software application.

How do you know if something is an API? ›

If a website asks you to input your username and password, then it is likely using an API. This is because APIs allow websites to access certain data or features on other websites, and so the website needs to verify your identity before granting you access.

What are the 3 types of APIs and give examples for each? ›

There are also three common types of API architectures:
  • REST, a collection of guidelines for lightweight, scalable web APIs.
  • SOAP, a stricter protocol for more secure APIs.
  • RPC, a protocol for invoking processes that can be written with XML (XML-RPC) or JSON (JSON-RPC).
Jan 16, 2023

What is a real world example of a REST API? ›

RESTful APIs are commonly used in web and mobile applications to retrieve or modify resources and data on remote systems. Some examples include: Social media sites like Twitter, Facebook use REST APIs to integrate with third-party applications and allow posting updates.

Is PayPal an API? ›

PayPal APIs (Application Programming Interfaces) are a set of tools and protocols that enable developers to integrate PayPal's payment functionalities, including processing transactions, managing accounts, and accessing financial data, into their applications, websites, or platforms.

Top Articles
Investor Protection Guide: Micro-cap Stock Fraud ("Pump and Dump")
Refund Policy -
Skycurve Replacement Mat
Mrh Forum
Craigslist Benton Harbor Michigan
Rainbird Wiring Diagram
Red Wing Care Guide | Fat Buddha Store
Garrick Joker'' Hastings Sentenced
Mercy MyPay (Online Pay Stubs) / mercy-mypay-online-pay-stubs.pdf / PDF4PRO
Bme Flowchart Psu
Athens Bucket List: 20 Best Things to Do in Athens, Greece
Slushy Beer Strain
Colts seventh rotation of thin secondary raises concerns on roster evaluation
Animal Eye Clinic Huntersville Nc
The Shoppes At Zion Directory
Accuradio Unblocked
Hoe kom ik bij mijn medische gegevens van de huisarts? - HKN Huisartsen
Otterbrook Goldens
Mikayla Campinos Laek: The Rising Star Of Social Media
Is The Yankees Game Postponed Tonight
Sussyclassroom
Craigslist Apartments Baltimore
Brbl Barber Shop
Shoe Station Store Locator
Keshi with Mac Ayres and Starfall (Rescheduled from 11/1/2024) (POSTPONED) Tickets Thu, Nov 1, 2029 8:00 pm at Pechanga Arena - San Diego in San Diego, CA
UAE 2023 F&B Data Insights: Restaurant Population and Traffic Data
Uno Fall 2023 Calendar
Why comparing against exchange rates from Google is wrong
Warn Notice Va
Http://N14.Ultipro.com
In Branch Chase Atm Near Me
Tenant Vs. Occupant: Is There Really A Difference Between Them?
Reading Craigslist Pa
拿到绿卡后一亩三分地
Winco Money Order Hours
Is The Nun Based On a True Story?
Registrar Lls
Emily Tosta Butt
Miami Vice turns 40: A look back at the iconic series
Cl Bellingham
Wordle Feb 27 Mashable
Martha's Vineyard – Travel guide at Wikivoyage
Nu Carnival Scenes
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
Chubbs Canton Il
Victoria Vesce Playboy
Richard Mccroskey Crime Scene Photos
Mytmoclaim Tracking
How to Do a Photoshoot in BitLife - Playbite
Tamilblasters.wu
Subdomain Finer
Att Corporate Store Location
Latest Posts
Article information

Author: Moshe Kshlerin

Last Updated:

Views: 5980

Rating: 4.7 / 5 (77 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Moshe Kshlerin

Birthday: 1994-01-25

Address: Suite 609 315 Lupita Unions, Ronnieburgh, MI 62697

Phone: +2424755286529

Job: District Education Designer

Hobby: Yoga, Gunsmithing, Singing, 3D printing, Nordic skating, Soapmaking, Juggling

Introduction: My name is Moshe Kshlerin, I am a gleaming, attractive, outstanding, pleasant, delightful, outstanding, famous person who loves writing and wants to share my knowledge and understanding with you.