API's are not the opposite of microservices. If anything, microservices rely heavily on APIs to be able to function.
APIs are a contract to obtain a service, whilst microservices is an architectural design to implement those APIs.
Could you clarify your question please?Thanks,
One of the big Microservices Architecture question is faced by architects is how to define the right service granularity: http://www.opengroup.org/soa/source-book/msawp/p6.htm . And that's where the two concepts , Open APIs and Microservices, might meet : one might decide to use the definition of the standardized TM Forum Open API operations as a basis for a definition of the Microservices granularity .
And last but by no means least…
In contrast, the monolithic architecture is based on a default or standard model approach to application development. It has demonstrated its limitations by posing many challenges related to handling a very large code base, scaling, integrating new changes, using new cutting-edge technology, and deployment.
What is the difference between APIs and microservices?
The difference between the two concepts is how they work. Microservices are a style of architecture dedicated to applications and where functionalities are fragmented into web services. APIs, on the other hand, represent frameworks through which developers can interact with an application. It is important to note that there is a certain overlap between APIs and microservices, due to the fact that many microservices use APIs to communicate with each other.
To go further, I strongly invite you to read this article API vs microservices