What's an API?
There are many ways to interact with software.
Everyone is acquainted with the concept of graphical user interface (GUI) to browse the web or type a document. You click, scroll, or hover somewhere and an action is triggered.
OSX and Linux users might also be familiar with command line interfaces (CLI), which are simply text-based user interfaces to perform the same things you would with a mouse.
Sometimes, however, you need two distinct software systems (applications, services, operating services, etc.) to work together seamlessly.
You might, for example, want to create a web service to deal with emails and a website. Dividing those two systems improves the modularity of your software architecture: it’s clearer for developers to maintain and more performant to use.
That’s when you resort to application programming interfaces (aka API) to make those two pieces communicate.
An API is simply a programmatic interface you can use to access software services. Unlike GUI and CLI, APIs are meant for machines, and thus hardly readable for humans.
In a web context, APIs define web services or resources in the form of detailed specifications: message formats, usage rate, and application protocols (mainly HTTP, but can also be SMTP for example), among others. REST (representational state transfer) is the most common way for web developers to design an API, but it’s not the only way: SOAP (semantic web access protocol) and the latest GraphQL technology, to quote only two.