Black Badger now builds custom software, CRMs and project management systems your company owns outright. See what we build.
If you’ve ever used a mobile app or accessed a website, you’ve likely interacted with an API, or application programming interface, even if you didn’t know it. In simple terms, an API is a tool that allows different software applications to communicate with one another, essentially acting as a messenger between two or more systems. APIs enable developers to create new applications and services by leveraging the functionality of existing software and data.
A common real world example is connecting a custom system to accounting software. This guide on QuickBooks Online integration shows what syncs through the API and how the connection works.
What is an API?
At its core, an API is a set of protocols, routines, and tools that provide a standard way of interacting with a web-based software application. The API acts as a bridge between the user and the application, providing a simplified interface that can be used to access complex functionality behind the scenes. This makes it easier for developers to integrate different software components, as well as share data and services across platforms.
Understand API basics, the application programming interface explained
API stands for application programming interface. AWS describes an interface as a contract of service between two applications, which defines how requests and responses are structured. To understand API basics, picture two software components that need to share data. The app that sends the request is the API client, and the app that answers is the server.
AWS uses a weather example. A weather app on your phone does not hold the forecast itself. It sends API requests to a weather service, and the server returns data that the app shows on screen. The same pattern sits behind maps in delivery apps, card payments in online stores and sign in buttons that use another account.
Each API defines what you can ask for and what comes back. The address you send a request to is the API endpoint, usually a server URL. Good APIs return only the data you asked for, which keeps mobile and web applications fast.
How do APIs work?
When a user interacts with an application that leverages an API, the API sends a request to the application’s server. This request includes specific parameters, such as what data the user is requesting or what action they want the application to perform. The server then processes this request and sends back a response, which is typically in the form of data or an action the application should take. This communication is typically done using a standard data format such as JSON or XML.
What are some common use cases for APIs? APIs are used in a wide range of industries, including e-commerce, social media, and finance. Here are a few examples of how APIs are used in different contexts:
Social media APIs:
Platforms such as Facebook and Twitter use APIs to allow developers to access their platforms and build applications that integrate with their services. This allows users to share content across different platforms and access data from multiple sources.
E-commerce APIs:
Online retailers use APIs to allow third-party developers to create applications that integrate with their sales platforms. This allows developers to create new applications that can leverage data such as inventory levels, pricing, and customer information.
Financial APIs:
Banks and other financial institutions use APIs to allow developers to access data such as account balances, transaction history, and loan information. This allows developers to create new applications that can help users manage their finances more effectively.
Types of APIs, public, private and partner APIs
APIs can be sorted by who is allowed to use them. AWS lists four types of APIs by audience.
- Public APIs. Public APIs are open to anyone, although the provider may still require authorization or charge for use. Paid APIs usually fall in this group.
- Private APIs. Private APIs are internal APIs that connect systems and data inside one business.
- Partner APIs. Partner APIs are open only to authorized external developers and support business-to-business partnerships.
- Composite APIs. Composite APIs combine two or more APIs to meet complex system requirements, so one call can do the work of multiple requests.
REST APIs, SOAP APIs and other API architectures
APIs also differ in their API architectures, the rules for how the client and the server talk.
- REST APIs. REST stands for representational state transfer. REST APIs exchange data over HTTP, and the server does not keep client data between requests. AWS calls REST APIs the most popular and flexible APIs found on the web today. Most modern web APIs, often called RESTful APIs, follow this style and send JSON.
- SOAP APIs. SOAP stands for Simple Object Access Protocol, an XML based messaging protocol. AWS describes Simple Object Access Protocol APIs as less flexible and more popular in the past.
- RPC APIs. With a remote procedure call, the client runs a function on the server and gets the output back. XML RPC and JSON RPC are two common forms. gRPC, a newer remote procedure call framework, uses protocol buffers and supports bidirectional streaming.
- WebSocket APIs. WebSocket APIs use JSON objects and support two-way communication, so the server can push messages to connected clients.
- GraphQL APIs. GraphQL is an open source query language for APIs. The client asks for exactly the fields it needs in one request, which avoids multiple round trips.
Web APIs and web services are the broad names for APIs reached over the internet, between a web server and a browser or another program.
What an HTTP request to an API looks like
Most API calls are an HTTP request with four parts.
- The endpoint. The URL of the API endpoint, such as a weather API address for one city.
- The method. HTTP methods say what you want. GET reads data, POST creates data, PUT or PATCH updates it, and DELETE is for deleting data.
- Headers. Headers carry details such as the data format and the API keys or authentication tokens that prove who is calling.
- The request body. For POST and PUT calls, the request body holds the data to save, usually as JSON.
The server processes the call and sends back a status code with the requested data. A 200 status code means success, 401 means the caller is not authorized, 404 means the resource was not found, and 500 means the server failed. Real world API examples follow this pattern, from a weather app that needs to retrieve data for your location to a store that sends an order to its shipping company.
API security, API keys and API gateways
Every API endpoint is a door into a system, so API security matters from day one. AWS describes two common ways to secure REST APIs.
- Authentication tokens. Authentication tokens confirm who the user is and what that user may do in a specific API call.
- API keys. API keys identify the application making the call. They are less secure than tokens, but they let the provider monitor usage.
Many APIs also use OAuth with OpenID Connect for user sign in, and every API should apply input validation so bad data never reaches the database. In enterprise environments, an API gateway sits in front of the APIs. AWS calls an API gateway an API management tool for enterprise clients that handles authentication, statistics and rate management. API gateways and API management give one place to control many APIs.
API design and how to write API documentation
Good API design starts with the people who will call the API. Name endpoints clearly, keep responses consistent, and release a new API version instead of breaking the old one. Then write API documentation that a beginner can follow. AWS lists simple language, code samples, current content and a clear account of the problems the API solves as best practices for API documentation. API documentation can be generated from the code or written by hand, and the best teams do both.
How APIs work, step by step
Every API call follows the same short loop, whether it is one of the public weather APIs or an internal API inside your own company.
- The API client builds the request. The app decides which API endpoint to call, which HTTP method to use and which data to send.
- The request travels to the server. API calls usually go over HTTPS, so the data is encrypted on the way.
- The server checks who is calling. It reads the API key or the authentication token and rejects calls that are not allowed.
- The server processes the request. It reads or changes data in its own software systems, such as a database.
- The server returns data. It sends a status code and the relevant data back, usually as JSON.
- The client uses the response. Weather apps draw the forecast, a store shows the shipping cost, and a dashboard refreshes its numbers.
Many apps call multiple APIs for one screen. A travel site might call one API for flights, one for hotels and one for payments, then combine the answers before you see the page.
Public APIs, private APIs and internal APIs in practice
The types of APIs are easier to understand with everyday business examples.
- Public APIs. Public APIs, such as weather APIs or map APIs, let any developer add data to their own web applications, often with a free tier and paid plans above it.
- Private APIs. Private APIs connect your own systems, such as a CRM that sends new customers to your billing system. These internal APIs are never offered outside the company.
- Partner APIs. A supplier may give your business a partner API so your system can check stock or place orders directly.
Most of these web APIs are REST APIs today, because REST APIs are simple to call from any language and any device.
REST representational state transfer vs SOAP, which one to use
For a new API, REST is the usual choice. Representational state transfer works with plain HTTP, JSON is easy to read, and almost every tool and language supports it. SOAP still appears in older enterprise web services, in banking and in some government systems, where its strict XML contracts are already in place. If you need to connect to one of those systems, you use the API it offers. If you are building a new API, REST APIs or a GraphQL query language API are the common options.
API requests and API calls, common beginner questions
Is an API the same as a web service? A web service is an API that is reached over a network. Every web service is an API, but not every API is a web service, since an API can also connect parts of one program on one computer.
Do I need to write code to use an API? To call an API directly, yes, or a tool that writes the API requests for you. Many no-code automation tools work by making API calls behind the scenes.
What is an API key? An API key is a long string that identifies the application making API calls. Treat it like a password and never put it in public code.
What happens when an API changes? Good providers release a new API version and keep the old one running for a while, so existing apps do not break overnight.
Conclusion
Overall, APIs are an essential component of modern software development, allowing developers to build new applications and services more efficiently by leveraging the functionality of existing systems. As more industries continue to embrace the benefits of cloud-based software and digital transformation, the use of APIs is only set to grow in importance in the years to come.
You might be interested in
Getting your systems to agree on the same numbers
APIs, AI and the Model Context Protocol
APIs now connect AI as well as apps. The Model Context Protocol, an open standard introduced by Anthropic, gives AI assistants a common way to call tools and reach data. Under the hood it still depends on well designed APIs, clear documentation and sound API security.
When the software systems your business relies on do not talk to each other, Black Badger builds custom software that connects them through their APIs, so different computer programs share the same data instead of people copying it by hand.


