<aside> 💡 The objective of this lesson is to give a brief overview of APIs before Project 3!

</aside>

APIs, or Application Programming Interface, are the link between the user/client who wants to make a request and get something done and the server who can fulfill that request. They are an important part of making programming applications work for user!

The following video has a great introduction to APIs, accompanied by some smooth-transitioning graphics:

https://www.youtube.com/watch?v=s7wmiS2mSXY&ab_channel=MuleSoftVideos

How APIs are used in applications

The developer is the one who often makes the request for their users to the appropriate server. In order to make the request, we are essentially sending the request over some sort of connection. Often times, in order for the request to be properly received, it needs to be sent in a specific format (otherwise known as a protocol) which the day-to-day user might not understand!

It's here that the analogy above falls apart slightly. If we think of the user as the person ordering, they often times can read the menu, and tell the waiter their order in English. But what if the menu looked like lines of code? And they also have to order in code? That's why the developer creates products that present understandable interfaces to the user, and handle creating those actual requests themselves. Then, when they get the 'food' back from the server, they can parse and reformat it in a way that the user can understand.

So, in general, applications are what use APIs to connect a user-understandable interface (such as a website) to the actual information and services that they need!

Examples

Here are some fun APIs to play around with! Notice how the information that we send of (ie. our order) often goes directly into the URL! The response we get back (ie. our food) often comes in a 'JSON object' which looks a lot like a Python dictionary!

Here are a few from actual companies! These need accounts and are more in depth, but can actually be used for projects!