API stands for Application Programming Interface. In short, API is the protocol for communication between different applications.
For example: A software developer might use a weather API like darksky to fetch weather information for his/her weather reporting app.
In order to call an API, the “caller” has to send unique identifying information as an identifier to the API service provider. This identifier is called an API key.
There are two main functions of an API key:
Recognition: To allow the service provider to identify the calling user/application. This information allows the service provider to track calls by individual caller, monitor trends, and ensure the caller doesn’t “abuse” the resource.
Access control: To allow the service provider to grant access to the calling user/application.