I'm writing some pedagogic material and when I started explaining what an API is I realized I didn't know why we say "application programming interface" instead of just "programming interface". Does anyone know the history?
The reason why is because an API more often than not isn't a general machine-code type interface, but is an interface to a software module that performs a particular function, i.e. a particular application.
Libraries to perform image processing, to compress files, to schedule dentist appointments, to auto-tune signers, are all modules that provide an application of software to solve a particular problem. Much of the API choices going into auto-tune are different than for scheduling dentist appointments, and the data structures and manipulation processes are different.
If you just said "programming interface", myself and I suspect many others would think of a very low-level function of e.g. loading executable code from disk into memory, loading code onto a flash chip, etc.
A "programming interface" would be something compiler writers and chip designers would be concerned about, whereas an "application programming interface" is a higher up level of abstraction.
Sometimes a distinction between application software and systems software is drawn. Application software is software to address specific problems or to interact with users. In contrast, system software provides services to other software. Operating systems and software libraries are examples of systems software.
The application programming interface is the interface exposed by systems software through which it provides services for application software.
Nowadays, distinction between applications and systems software is almost entirely useless and unclear. Many programs are both application-like and platform-like (e.g. a web browser not only offers a user interface for the web, but also a runtime environment for web applications). Additionally, multiple layers of system-like software are often layered on top of each other, which must also communicate through some interface
Therefore, the term “application programming interface” effectively refers to any software–software interface.
The "application" refers to software programming; as opposed to programming for a hardware interface (such as a device driver) or a human interface (such as a mouse).
APIs allow one program, or part of a program, to interface with another.
Similarly, from Wikipedia:
In general terms, it is a set of clearly defined methods of communication between various software components.
API Evangelist defines an API as:
The principal of a well documented set of publicly addressable "entry points" that allow an application to interact with another system....
- api (application programming interface) is for applications that want to use a lib
- spi (service provider interface) is a kind of "os-device driver" or plugin or protocol or callback-function that you must implement to allow the (operating-) system to use your code.
the program flow is like this
yourApp -> api -> os -> spi -> device driver
- your app uses the file-api to read/write a config file. there are different spi implementations for filesystems cdrom, vfat, ntfs, .....
- firefox-webbrowser -> spi -> firefox-plugin ( -> api -> ... )
- in java/c/c++/c# the function
main()is the spi that you have to implement when you want to write a console applicatoin.