Get All Notes
Fetch a list of notes with optional sorting and limiting
// Get notes sorted by views const response = await openNotesAPI.getNotes({ sort: 'views', limit: 5 }); // Display results response.items.forEach(note => { console.log(note.title, '-', note.v, 'views'); });
Click "Run" to see results
Search Notes
Search for notes by keyword with filtering options
// Search for physics notes const results = await openNotesAPI.searchNotes('physics', { format: 'pdf', limit: 10 }); console.log('Found', results.items.length, 'notes'); results.items.forEach(note => { console.log(`- ${note.title} by ${note.auth}`); });
Click "Run" to see results
Get Statistics
Retrieve comprehensive statistics about the notes collection
// Get comprehensive statistics const stats = await openNotesAPI.getStatistics(); console.log('Total Notes:', stats.totalNotes); console.log('Total Views:', stats.totalViews); console.log('Total Downloads:', stats.totalDownloads); console.log('\nFormat Distribution:'); Object.entries(stats.formats).forEach(([fmt, count]) => { console.log(` ${fmt}: ${count} notes`); });
Click "Run" to see results
Get Notes by Author
Filter notes by a specific author
// Get all notes by Chenyu Li const authorNotes = await openNotesAPI.getNotesByAuthor( 'Chenyu Li' ); console.log('Notes by Chenyu Li:'); authorNotes.items.forEach(note => { console.log(` - ${note.title}`); console.log(` Views: ${note.v}, Downloads: ${note.d}`); });
Click "Run" to see results
Trending Notes
Get the most viewed notes
// Get top 5 trending notes const trending = await openNotesAPI.getTrendingNotes(5); console.log('๐ฅ Trending Notes:\n'); trending.items.forEach((note, i) => { console.log(`${i + 1}. ${note.title}`); console.log(` ๐ ${note.v} views | ๐ฅ ${note.d} downloads`); console.log(` Author: ${note.auth}\n`); });
Click "Run" to see results
Full Integration Example
Complete example showing multiple API features together
async function displayDashboard() { // Check API health const healthy = await openNotesAPI.healthCheck(); console.log('API Status:', healthy ? 'โ Online' : 'โ Offline'); if (!healthy) return; // Get stats const stats = await openNotesAPI.getStatistics(); console.log('\n๐ Dashboard\n'); console.log(`Total Notes: ${stats.totalNotes}`); console.log(`Total Views: ${stats.totalViews}`); // Show top note if (stats.topViewedNotes[0]) { const top = stats.topViewedNotes[0]; console.log(`\n๐ Top Note: "${top.title}"`); console.log(` ${top.v} views, ${top.d} downloads`); } } displayDashboard();
Click "Run" to see results
widgets
Live Demo: Notes Browser Component
Interactive notes browser with full functionality
search
Live Demo: Search Component
Try the search with autocomplete suggestions