What is the difference between an API and a microservice? This video explains what these two things are and how they relate to each other. It also presents an example to show how APIs and microservices are typically used in software architecture and engineering.
An Application Programming Interface (API) is the access mechanism to a digital capability, which we can also call a digital building block. As such, the API is not the capability itself (i.e., its implementation), but really only the way how to interact with it.
A microservice is an implementation pattern, meaning that it is a way how a particular capability (or service, hence its name) is being implemented. The most important aspect of this pattern is that the implementation needs to be self-contained and independently deployable. This means that a microservice can oftentimes be implemented and changed more easily and faster, because it is not necessary to align and coordinate the implementation work with many other teams.
In summary: APIs and microservices are different things. API can (but don't have to be) implemented by a microservice, and API consumers don't have to be aware of that. Microservices need to have an API so that they can be accessed: They are self-contained implementations of capabilities, and in order to use them, they are accessed through their APIs.
00:00 Introduction
00:30 What is an API?
01:10 What is a Microservice?
01:45 Comparing APIs and Microservices
02:36 Example for APIs and Microservices
04:00 Implementing an API with a Microservice
04:44 Microservices for Modernization
05:30 Wrapping it up