There are several kinds of APIs available. The REST API, SOAP API, and GraphQL API help establish communication between a client and a server. The browser API is used to develop browser extensions or any product that needs to control the browser settings. Similarly, there are Web APIs that you use to code websites.
You use Web APIs when you are developing a website, and it provides you with functionalities that you can use to add more features to your website. Web APIs are primarily used with JavaScript though this is not always the case.
You might be using this API without knowing it is an API. DOM or Document Object Model is a Web API that lets you interact with DOM elements. You can use this API to build interactive interfaces and significantly improve the user experience.
This API allows you to fetch resources from the internet. If you want to make an API call to some public REST API, you can use fetch to do that. This API takes at least one argument, i.e., the path to the resource you want it to fetch. The response, when received, is converted to JSON.
This Web API provides you the ability to interact with your system’s clipboard. You can use this API to copy, cut or paste different stuff on the clipboard. The clipboard-write permission is automatically granted when the browser tab becomes active. But for reading data from the clipboard, you need to request permission.
The Canvas API helps you to draw graphics through JavaScript and HTML. You can also use it for building animations, game graphics, data visualization, photo manipulation, and real-time video processing. This Canvas API works with 2D graphics.