- This repository contains my Chrome extension that shows random facts anytime you want. It uses the API Ninjas Facts API to fetch interesting, fun, and surprising facts inside a clean popup interface. The extension is lightweight, fast, and perfect for quick knowledge bites throughout the day.
- Fetches a new random fact each time the popup opens
- Clean, minimal UI
- Uses API Ninjas (free tier supported)
- Works offline after first load (basic fallback)
- Simple, readable code structure
/Facts
│── manifest.json
│── popup.html
│── script.js
│── styles.css
└── logo.png
git clone https://github.com/Vasu10134/random-facts-extension.gitThen open the folder:
cd random-facts-extension- Open the GitHub repo
- Click Code → Download ZIP
- Extract the ZIP
- Open the extracted folder
Follow these steps:
Go to:
chrome://extensions/
- Toggle it ON in the top-right corner.
- A file picker will open.
- Choose the folder containing:
manifest.json
popup.html
script.js
styles.css
- Chrome will instantly load your extension.
- Click the 🔗 extension icon and pin it for quick access.
- Click the extension icon from your Chrome toolbar
- The popup opens immediately
- A random fact will load automatically
- Close & open again = new fact each time
- This extension uses API Ninjas Facts API.
Get your key:
- Go to: https://api-ninjas.com
- Log in / sign up
- Visit your profile page
- Copy your API key
- Paste it inside
script.js:
const API_KEY = "YOUR_API_KEY_HERE";- Add refresh button
- Add multiple category support
- Add dark mode
- Add offline fact caching