What is API?
API stands for application program interface. It is a piece of code that allows another piece of code to interact with your Drupal site. in simple words, it allows a third-party application to interact with our Drupal site without human interaction.
Can we create our own API?
Yes, using "Services" module in Drupal you can create your own API. In basically handles the incoming request from the external client and sends the desired response.
Some examples of Drupal 8 APIs
It is used to authenticate user credentials and to limit the mode of authentication such as basic auth, cookie etc.
It is used to add blocks.
- Cache API
The Cache is used to store data that takes a long time to compute. The cache data is stored for a perticular time limit. Cache API is used to retrieve, delete etc. the cache data.
- CKEditor API
CKEditor is a rich text editor, It is default text editor in Drupal 8. CKEditor API is used to install CKEditor skin, load CSS in CKEditor iframe and to manage buttons in editor's toolbar.
- Configuration API
Sometimes modules need to store some data. Configuration API allows them to store the data such as the module's configuration setting chosen by the site administrator.
- Database API
It allows us to run queries on Drupal's database.
- Entity API
All the data in our Drupal site such as field, node etc. all are Entity. Entity API is used to manage entities.
- Form API
It is used to build and validate Form in Drupal
- Layout API
The layout is an arrangement of content in a page. Layout API is used to register and render a layout.
- Menu API
It is used to manage module specific menu links and tabs inside that menu link.
- Middleware API
Middleware is a set of statement or condition that run just after a request from the client and just before processing of the request. Middleware API helps us to add middleware.
- Migrate API
The Migrate API provides services for migrating data from different sources to Drupal 8.
- Response API
If you found that response is the same for multiple or repetitive requests, then using Response API you can cache it to speed up the response.
- Routing API
Routes are the link between a URL pattern and the set of statements (generally function). Routing API allows us to edit an existing route and to add new routes.
Know more about Drupal 8 API at https://www.drupal.org/docs/8/api