What is an API and what can it be used for??

Hi. I am interested in what the API is and what it can be used for and does it facilitate trading on stock exchanges in any way??