Application Program Interface (API) is an interface (set of protocols, subroutines, and tools). Programs interact (read, write and fetch information) with different applications (websites, mobile apps, operating systems, and databases) using API.
It is a tool kit through which programmers build applications using building blocks available in the program interface. These building blocks can easily communicate with each other and support connectivity of various software components on different devices.
For example, a Google Maps API lets web developers integrate Google Maps on a web page. End-users can fetch navigational information to your company office from the “Contact Us” page on your website.
Another example is flight aggregator apps like Expedia. Thinking of API as a messenger – when you search for a flight (filling in details like travelling from, destination, cabin class), the program interface fetches information from all the flight operator servers and produces pricing results for your query.