why application programming interface is interface and it contains data code example

Example: API

An application program interface (API) is a set of routines, protocols, and
tools for building software applications.

Basically, an API specifies how software components should interact.
Additionally, APIs are used when programming graphical user interface (GUI)
components.

A good API makes it easier to develop a program by providing all the
building blocks. A programmer then puts the blocks together.

Tags:

Misc Example