Tuned In is now on the Chrome Web Store
Tuned In is a music recommendation Chrome extension that uses AI and Spotify to analyze webpage content and recommend songs that match the emotionality and energy of the page.
I think Spotify has a great music recommendation algorithm and appreciated the opportunity to take advantage of that through the text based content medium. This local, on-device model provides the chance to develop an application that achieves this goal with no online overhead or data collection issues.
The extension uses Chrome's experimental Summarization API (powered by Gemini Nano) to analyze webpage content locally on your device. The AI model extracts musical characteristics (genres and tempo) from the content, which are then used to search Spotify's API for matching tracks.
The Process:
- Extract readable content from the current webpage using Mozilla's Readability library
- Summarize the content using Chrome's on-device Summarization API
- Analyze the summary to extract musical genres and tempo (BPM)
- Search Spotify for tracks matching those characteristics
- Filter results by popularity threshold (with smart fallback)
- Display the recommended track with album art and links
- Fandom.com character bios
- Obscure codices
- Wikipedia articles
- Blog posts and articles
- Any text-heavy webpage
- Analyzes webpage content to extract musical genres and tempo
- Searches Spotify for matching tracks
- Filters by popularity threshold with intelligent fallback (decrements by 10 if no matches found)
- Displays album art, track info, and direct Spotify links
Full Text vs. Chunk Mode
- Chunk Mode (default): Analyzes the first portion of the page for faster results
- Full Text Mode: Processes the entire page in chunks for comprehensive analysis
- Adjustable chunk size (1,000-10,000 characters) for optimal performance
Smart Warnings The extension shows helpful warnings when:
- Text is very long and will be truncated in chunk mode
- Full text mode will require multiple processing chunks
- View all past recommendations with embedded Spotify players
- Each entry includes:
- Spotify track embed
- Source page link
- Track details (name, artist, genres, BPM)
- Expandable "More Info" section
- Links back to original webpages
- Customizable history limit
- Scrolling Text: Track names and artist names scroll smoothly on hover
- Direct Spotify Links: Click track names or artist names to open in Spotify Web Player
- Quick Actions: "Open in Spotify" button for instant access
- Live Updates: History count updates dynamically as recommendations are added
Located at the top of the side panel:
- Full Text Checkbox: Toggle between chunk mode and full web page text processing
- Chunk Slider: Adjust the character limit for each processing chunk (1,000-10,000)
Access via the βοΈ Settings button in the footer:
- Theme: Choose from 19 color themes
- History Limit: Number of recommendations to save (1-100)
- Popularity Threshold: Minimum Spotify popularity score (0-100)
- If no tracks meet the threshold, the extension automatically tries lower thresholds in increments of 10
- Export History: Download your recommendation history as a JSON file
- Clear History: Remove all saved recommendations (with confirmation)
All settings are automatically saved and persist across sessions.
The extension can analyze webpage content and recommend fitting music. For example, analyzing the Wikipedia page for rock music might recommend prominent rock tracks.
[
{
"trackName": "Scared",
"trackArtist": "The Tragically Hip",
"artistIds": [
"0YMeriqrS3zgsX24nfY0F0"
],
"genres": [
"rock",
"indie",
"blues"
],
"bpm": 120,
"trackId": "7jTns7NXrRxED1h1zObE04",
"pageUrl": "https://en.wikipedia.org/wiki/Rock_music",
"pageTitle": "Rock music - Wikipedia"
}
]When analyzing technical documentation, the extension might recommend calm, focused music suitable for coding or studying.
- Track Links: Click any track name or artist name to open in Spotify Web Player
- Source Links: Each history entry includes a link back to the original webpage
- Spotify Embeds: Interactive Spotify players embedded in history items
Tuned In uses Chrome's experimental Summarization API, which runs Gemini Nano locally on your device. This means:
- β No data sent to external servers
- β Complete privacy
- β Works offline (after initial setup)
- β Fast, local processing
The extension requires a Spotify API endpoint to search for tracks. If you want to recreate a similar extension you'll need to:
- Set up a Spotify Developer account
- Deploy the provided API endpoint
- Configure the API URL in the extension
When searching for tracks:
- First attempts to find tracks matching the set popularity threshold
- If no matches, automatically decreases threshold by 10
- Continues until tracks are found or threshold reaches 0
- Falls back to all tracks (sorted by popularity) if needed
This ensures you always get a recommendation, even with strict popularity settings.
- Chrome browser (>= Stable 138)
- Node.js and npm
- Spotify Developer account
- Origin trial token for Summarization API
-
Clone the repository
git clone https://github.com/ClaytonWas/tuned-in.git cd tuned-in -
Install dependencies
npm install
-
Build the extension
npm run build
-
Load in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the
distdirectory
- Open Chrome and navigate to
-
Set up Spotify API
- Deploy the Spotify API endpoint
- Configure the API URL in the extension code
-
Configure Origin Trial Token
- Get your origin trial token for the Writer API
- Update the
trial_tokensfield inmanifest.json - Remove the
keyfield if using your own token
-
Start using
- Click the extension icon to open the side panel
- Navigate to any webpage
- Click "Generate Recommendation" to analyze the page
- 100% Local Processing: All AI analysis happens on your device
- No Data Collection: No user data is sent to external servers
- No Tracking: The extension doesn't track your browsing
- Open Source: Full source code available for review
Contributions are welcome! Please feel free to submit a Pull Request.
Note: The Summarization API is currently experimental and requires an origin trial token. Check Chrome's documentation for the latest information on availability and setup.