An API (Application Programming Interface) is best thought of as a contract provided by one piece of computer software to another. API is a set of routine definitions, protocols, and tools for building software and applications. A good API makes it easier to develop a program by providing all the building blocks, which are then put together by the programmer. APIs often come in the form of a library that includes specifications or routines, data structures, object classes and variables. An API can also be related to a software framework, a framework can be based on several libraries implementing several APIs, but unlike the normal use of an API, the access to the behavior built into the framework is mediated by extending its content with new classes plugged into the framework itself.
With an API , the exact structure of request and response is documented upfront and is likely to remain constant, regardless of whether the website changes its look and feel for human visitors. Without an API , app relies on the website never changing its look. If it does, app may stop working because it can’t parse the webpage anymore. Computers are only as smart as the software you write. Hence , API production allows you to coordinate more efficiency, automation, integration, personalisation, mashup etc.