The two main categories of API that are available to use when interacting with the Alfresco Repository is the remote and the embedded APIs.
Remote APIs
The main remote Application Programmaing Interface (API) is the Alfresco ReST API, which should be the first place you go to when you want to interact with the Alfresco Repository remotely. If portability is very important, than have a look at the CMIS ReST API, which is a standard implemented by many ECM vendors.
Embedded APIs
The embedded APIs have traditionally been used a lot to build customizations that run inside the same JVM as the Alfresco Repository. There are both a Public Java API and a Repository JavaScript API. Before using the embedded APIs a thorough investigation should be done to rule out the possibility of building the extension with a remote a remote API. It is not recommended to build embedded extensions unless it is absoutely necessary. They make it difficult during upgrades and can quite easily have unintended side effects on core repository functionality, such as file upload.
For an overview of all APIs navigate to this page.