A library is a set of elements (functions, classes, predefined types, constants, global variables, macros, etc.) that can be used in a program to facilitate the implementation of that program.
API comes from the English "Application programming interface" which means "Interface for application programming". It is the part of a library accessed by a program that uses the library; thus making use of the library independent of the implementation details. An API can be implemented by different libraries.
A framework is an integrated set of tools that facilitate software development. It can include APIs and libraries. But it can also include other elements such as debugging tools, graphic design, prototyping, editing, etc.
The terms API and library are often used interchangeably. But keep in mind that an API is always unique (leaving aside different versions) and that an API does not include implementation details. While a library does not have to be unique and must contain a full implementation. The fact that an API is unique is very important, it is what allows writing a program in C ++ for Linux and that this program, unmodified, works for Mac if the libraries it uses are available for both systems.
An example of a library is Oracle's JavaMail. It is possible to make a program that sends emails by programming sockets directly. But it is much faster to use JavaMail or any other library for emails because these libraries already implement the functionality you need. Besides being faster it is also less prone to errors, especially in a widely used library; because the code is tested by millions of users and the development community will generally do a better job than the team of an individual program can do.
CORBA is an API. But there may be an implementation for Linux, another for Mac, etc.
An example of a framework would be Unity3D, which offers a set of tools that facilitate the development of video games.