HTML5 APIs Tutorial
HTML5 APIs Overview
Explore the powerful browser APIs that enable modern web applications with rich features and capabilities.
50+
APIs Available
95%
Browser Support
100%
Native Performance
0
Plugins Required
API Categories
Multimedia
- Canvas API
- WebRTC
- Audio API
- Video API
Storage
- Web Storage
- IndexedDB
- Cache API
- File API
Communication
- WebSocket
- Fetch API
- Server-Sent Events
- WebRTC
Device Access
- Geolocation
- Device Orientation
- Battery Status
- Vibration
š Geolocation API
Access the user's geographical location. Perfect for mapping services, location-based apps, and personalized content.
Code Example
if ('geolocation' in navigator) {
navigator.geolocation.getCurrentPosition(
(position) => {
const { latitude, longitude } = position.coords;
console.log(`Lat: ${latitude}, Lng: ${longitude}`);
},
(error) => {
console.error('Error:', error.message);
}
);
}š
Click the button to detect your location
Device API Status
š
Battery Status
Not Supported
š
Network Status
checking...
š±
User Agent
Node.js/22
Browser Support Overview
| API | Chrome | Firefox | Safari | Edge |
|---|---|---|---|---|
| Geolocation API | ā | ā | ā | ā |
| Canvas API | ā | ā | ā | ā |
| Web Storage | ā | ā | ā | ā |
| Drag & Drop | ā | ā | ā | ā |
| History API | ā | ā | ā | ā |
| WebSocket API | ā | ā | ā | ā |
| WebRTC | ā | ā | ā | ā |
| Service Workers | ā | ā | ā | ā |
Feature Detection
Modern Approach
// Check if API is supported
if ('geolocation' in navigator) {
// Use the API
} else {
// Provide fallback
}Using Modernizr
if (Modernizr.geolocation) {
// API is available
} else {
// Load polyfill or show message
}