Browser Web APIs Reference

Essential browser APIs: Fetch, WebSocket, Service Workers, Web Storage, Geolocation, Canvas, WebGL, Notifications, Clipboard.

  • JSON9,732 B
  • YAML6,826 B · −30%
  • TOON6,267 B · −36%

Browser Web APIs by category with their purpose, basic usage, support and related APIs: Fetch, WebSocket, service workers, Web Storage, IndexedDB, geolocation, Canvas, WebGL, notifications, clipboard, history and Intersection Observer.

Use it when

  • You need the right browser API for a capability and a basic usage example.
  • You are checking what a page can do without a library.

Watch out for

  • Support and permission models vary by browser, and many APIs require a secure context and user consent.
  • APIs change; confirm current status on MDN or a compatibility table.

The data

Apis

NameCategoryPurposeBasic usageBrowser supportRelated apis
Fetch APInetworkingModern promise-based interface for making HTTP requests, replacing XMLHttpRequest.fetch(url).then(res => res.json()).then(data => console.log(data));All modern browsers (IE not supported)
  • XMLHttpRequest
  • Request
  • Response
  • Headers
WebSocketnetworkingFull-duplex, persistent TCP connection for real-time bidirectional communication.const ws = new WebSocket('wss://example.com'); ws.onmessage = e => console.log(e.data);All modern browsers
  • WebSocketServer (Node.js)
  • Server-Sent Events
Service WorkersofflineBackground scripts that act as network proxies, enabling offline support, caching, and push notifications.navigator.serviceWorker.register('/sw.js').then(reg => console.log('Registered'));All modern browsers (IE no)
  • Cache API
  • Push API
  • Background Sync
  • Notification
Web Storage (localStorage/sessionStorage)storageSimple key-value storage for small amounts of data, persisted across sessions (localStorage) or tab lifetime (sessionStorage).localStorage.setItem('key', 'value'); const v = localStorage.getItem('key');All browsers including IE8+
  • IndexedDB
  • Cache API
  • Cookies
IndexedDBstorageLow-level transactional database for storing large amounts of structured data (including files/blobs).const db = await indexedDB.open('mydb', 1); db.onsuccess = e => { const store = e.target.result... }All modern browsers
  • Web Storage
  • Cache API
  • File API
Geolocation APIhardwareRetrieve device's geographic location (latitude, longitude) with user permission.navigator.geolocation.getCurrentPosition(pos => console.log(pos.coords.latitude, pos.coords.longitude));All modern browsers (HTTPS required)
  • Geolocation API (W3C)
  • DeviceOrientation API
Canvas APIgraphics2D drawing surface for rendering shapes, text, images, and animations via JavaScript.const ctx = canvas.getContext('2d'); ctx.fillRect(10, 10, 100, 100);All modern browsers (IE9+)
  • WebGL
  • CanvasRenderingContext2D
  • OffscreenCanvas
WebGLgraphicsJavaScript API for rendering 3D and 2D graphics using the GPU via OpenGL ES.const gl = canvas.getContext('webgl2'); gl.clearColor(0, 0, 0, 1); gl.clear(gl.COLOR_BUFFER_BIT);All modern browsers (IE11 has WebGL 1)
  • WebGL2
  • WebGPU (next-gen)
  • Three.js (library)
Notifications APInotificationsDisplay system notifications to the user, even when the browser is not in focus.Notification.requestPermission().then(p => { if (p === 'granted') new Notification('Hello!'); });All modern browsers (requires permission)
  • Push API
  • Service Workers
Clipboard APIutilitiesRead from and write to the system clipboard (text, images, rich content) with user permission.await navigator.clipboard.writeText('Copied!'); const text = await navigator.clipboard.readText();All modern browsers (HTTPS required)
  • ExecCommand (legacy)
  • ClipboardEvent
History APInavigationManipulate browser session history (pushState, replaceState) for single-page app navigation without reloads.history.pushState({page: 2}, 'Title 2', '/page2'); window.onpopstate = e => console.log(e.state);All modern browsers (IE10+)
  • Location
  • Window.location
Intersection ObserverobserverAsynchronously observe changes in intersection of target element with ancestor or viewport.const observer = new IntersectionObserver(entries => { entries.forEach(e => console.log(e.isIntersecting)); }); observer.observe(el);All modern browsers (IE not)
  • ResizeObserver
  • MutationObserver

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
apisnamestringFetch API
apiscategorystringnetworking
apispurposestringModern promise-based interface for making HTTP …
apisbasic_usagestringfetch(url).then(res => res.json()).then(data =>…
apisbrowser_supportstringAll modern browsers (IE not supported)
apisrelated_apisarray[4 items]

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/browser-web-apis-reference?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/browser-web-apis-reference.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • javascript
  • browser
  • api
  • websocket
  • fetch
  • service-worker
  • webgl

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets