An API is an
Interface which is used for accessing an application or a service from a program. An API makes it possible to use programs from within programs, therefore it is the foundation for modular systems with clearly defined
Interfaces between separate components. In a way, an API can be regarded as the local equivalent of a
Protocol, because it is used for the same purposes and defines the same things (the possible interactions between components, and the data that is exchanged while interacting). However, traditionally APIs are used for
Interfaces on one computer, while
Protocols are used for distributed scenarios.