They are just a set of functions you can call. They have their documentation on what they do, how they behave, what input(s) they need to perform as intended.
For example, using Win32 API you can interact with Windows, using Twitter API you can interact with Twitter… etc. They could be Interacting with Windows as well as Web both.
Its a doorway into the programming model that a company exposes so you can enhance or extend some capability they provide. For example, Facebook wants to help programmers develop applications that work with their platform. So they offer a library that you include with your application to access data in the Facebook system.
Basically you start using an API by downloading it’s library or development kit (SDK), reading it’s Manual (Documentation). Let’s take Facebook for an example. Go to developers.facebook.com. Search for “SDK”. Download the version for your platform. Look at the samples. Try them. Change them to do something slightly different.