A Minecraft API allows you to customize the gameplay to your liking. Either as a developer or as a normal player. If you are a developer, an API is a great way to add new features. However, this requires some programming knowledge and is nothing for beginners. That's why we recommend that you only use them to install mods, because it's easy as pie. You can use a application programming interface to make Minecraft compatible with third-party modpacks.
Nowadays, there is not just one Minecraft API, as there used to be. Even Mojang has released one. This once again confirms that the developer studio from Sweden is happy to support modders.