In order to better understand what an API is, it’s easier to first ask: What is not an API? An API can be many things, but these are a few things it cannot be:
- A singular computer program that runs and executes a defined set of functions and nothing else.
- A database full of various bits of information.
- A programming language.
All of those things, by themselves, do not amount to an API, but they can be used to interact with an API.
What Is An API?
API stands for application programming interface. An interface is like a platform, or surface, where many different entities can interact with each other. That is basically what an API is: an interface for computer programs to interact with each other in a system or across remote systems.
A well-documented API can make a programmer’s life easier. Imagine a programmer needs his program to reach out to a database on someone else’s system (or even in his own system) to collect information. He would need to write an interface (or, a set of functions in the program) to facilitate this database connection so similar connections can be made wherever needed in the program.
Basically, the interface needs to have reproducible effects. It takes a lot of effort and coding to produce this interface. The good news is, an API saves the programmer the trouble of having to write an interface from scratch. The most popular programming languages have APIs built-in for this very purpose. This is just one example of how APIs make the world of computer programming much more user-friendly.
API — Documentation Required
Most computer programs are documented, but it’s not a requirement. For example, if you wrote a program that only you use, it wouldn’t be necessary to document it because you know exactly how it works. If you planned on sharing your program, you would likely want to document it so others could learn how to use it.
In the world of APIs, however, documentation is required. The purpose of an API is to provide an interface with which other systems and programs can interact. Without documentation, an API is useless because no one would know how to work with it.
API Calls, Limitations and Restrictions
When you hear someone talk about an “API call,” that basically means connecting to an API or interacting with it in some way. Often, an API call is free. For example, using an API built into a programming language requires only the local resources of your computer to be expended in making that call happen. But some API calls are made to remote systems and require third-party resources. For example, reaching out to the Google Maps API causes Google to expend some resources to take your call and provide your requested data. This might only be a small amount of resources, so it will be free up to a certain point; but if your app starts making thousands of calls every second, you may be surprised when Google sends you a whopping bill for making all those calls.
Don’t let yourself get caught in that situation. If you’re a programmer, review your app carefully to make sure it’s not making more calls than absolutely necessary. If you have different people running your program in different locations, consider asking that they create their own API key. An API key limits resources to that one user or app.
Examples of Popular APIs
To better understand APIs and how they work, it can be helpful to review some popular examples.
Python Database API
The popular Python programming language has its own database API. This interface allows Python programmers to connect their applications to database software like MySQL and maintain a level of similarity. The database API provides a standard set of functions that all programs can share. This way, for example, a developer working on one project with a database can be assigned to another project with another database and catch up right away because the coding will be virtually identical with only slight differences in parameters.
Google Developer APIs
Who has more data than Google? Maybe Facebook? The odds are you’re using a variety of Google products every day. Like it or not, Google has the valuable data on virtually everything happening on the web. And, of course, they offer a wide variety of APIs so third-party programs can interact with all that data. There’s an API for Google Maps, Analytics, Calendar, YouTube and virtually everything Google. And they can all be plugged into your own custom app via a Google API.
Twitter and Facebook
Have you noticed Twitter, Facebook, and other popular social media tools seem to pop up everywhere? If you’re an Apple user, you may have noticed how you can now tweet right from an app within your computer; no need to log in through your web browser anymore. How’s that possible?
It’s likely because that app in your computer plugs into Twitter’s API. This means you can view other tweets and send your own without even opening your web browser. Similarly, Facebook lets you post status updates from a variety of different apps, not all of them made by Facebook. API connections across various platforms makes this possible.
Getting Acquainted With an API
Now you may be thinking, all right I’m ready to start playing with APIs. The only problem is you need an API to start working with and a good place to view available services. For that, we recommend taking a look at the RapidAPI Marketplace. There, you can browse among many open source and paid APIs to integrate into your programs.
One thought on “What is an API?”