An Application Programming Interface (API) specifies how a client should interact with software components. This interface is designed for developers. An Interface can be written for yourself, for engineers within your company or for a large community.
The API could contain either small single function or hundreds of classes, methods, data types, enumerations and constants. Nowadays, software is built in top of many APIs, where they can depend on further APIs.
The following created picture shows an API structure as an example for a dependency.
In this example, the Application Code depends directly on the API for Library 1, Library 3 and Library 5.
Furthermore, two APIs depend on further API for Library 2 and Library 4. In detail, if you want to build an application for editing photos, you probably use an API for loading GIF images. This API is may itself be built upon an API for compressing and decrompressing data.
The development of an API is ubiquitous in development of software. Its purpose is to offer an interface to the functionality of a component while also hiding any implementation details.
An API contains one or more static or dynamic library files. These provide an implementation for the API. Software developers or clients can import these library files in order to add the functionalities to their applications.
In our example, if you want to open a GIF image, you can easily use the simple method LoadImage(), which is implemented in the API for loading a GIF. This method accepts a filename and returns a 2D array of pixels. The complex compressing and decompressing operations are hidden behind that simple interface. The Client only access an API by using its public interface, the dark box in the pictures. 1).