A Web API is a set of tools the browser gives you so JavaScript can interact with the web environment.
JavaScript by itself is small, but Web APIs add extra powers like making network requests, animations, timers, storage, etc.
They act like a bridge between your JS code and browser features.
Many Web APIs work asynchronously (like
fetch(), geolocation, etc.).They are essential for building modern, interactive web apps.
🚩Examples of Web APIs in the Browser
API | Purpose |
|---|---|
DOM API | Manipulate HTML and CSS dynamically ( |
BOM API | Work with browser objects like |
Fetch API | Make HTTP requests to servers |
Geolocation API | Get user’s location |
Canvas API | Draw graphics and animations |
Web Storage API | Store data in |
Audio/Video API | Control multimedia on the page |
Notifications API | Show desktop notifications |