A secure and educational search engine designed for children, using Google Custom Search Engine with filtered results and knowledge panels powered by Vikidia.
It's an ideal solution for a family, an association, or a school that wants to offer a controlled and safe search environment for kids. You can even set it as the default search engine in the browser for a fully integrated experience. For example, I run it at home on my Synology NAS to provide a secure search experience for my children.
When combined with Google Family Link (or another whitelist system) on Chrome, you can restrict Internet access to child-friendly websites of your choice (and block direct access to google.com, for example).
- Filtered results: Only approved educational websites appear
- Custom autocomplete: 200+ educational suggestions with keyboard navigation
- Recommended sites: Curated selection of quality educational resources
- Image search: Image search mode with preview functionality
- Voice Search: Search using your voice with the microphone icon.
- Hybrid Search: Combines Google CSE with other sources like Vikidia, Wikipedia, Wikimedia Commons, and even your own MeiliSearch instance.
- Knowledge panels: Contextual information from Vikidia, Wikipedia, and Wikimedia Commons to enrich results
- Smart caching: Intelligent caching system to optimize performance and save API quota
- Quota management: Automatic monitoring of Google API usage
- Language prioritization: Automatic detection of French or English queries for better results
- Sort options: Sort by relevance or date (for web results)
- Responsive design: Works on desktop, tablet and mobile
- Child-friendly interface: Colorful and user-friendly design with expressive icons
- No-results suggestions: Suggests alternative queries when no results are found
- Optimized pagination: Efficiently renders pagination for a smoother experience
-
Clone the repository:
git clone [your-repo] cd search-for-kids -
Configuration:
cp config.example.js config.js
-
Edit
config.jswith your Google Custom Search Engine ID, Google API key and knowledge panels configuration:const CONFIG = { GOOGLE_CSE_ID: 'your_cse_id_here', GOOGLE_API_KEY: 'YOUR_API_KEY_HERE', VOICE_SEARCH_ENABLED: true, // Set to false to disable voice search KNOWLEDGE_PANEL_CONFIG: { ENABLED: true, API_URL: 'https://fr.vikidia.org/w/api.php', BASE_URL: 'https://fr.vikidia.org/wiki/', SOURCE_NAME: 'Vikidia (Encyclopedia for 8-13 year olds)', EXTRACT_LENGTH: 300, THUMBNAIL_SIZE: 150, DISABLE_THUMBNAILS: false }, // Optional: Add your own MeiliSearch instance for custom results MEILISEARCH_CONFIG: { ENABLED: false, // Set to true to enable API_URL: 'https://your-meili-instance.com', API_KEY: 'your_meili_search_api_key', INDEX_NAME: 'your_index_name', SOURCE_NAME: 'My Custom Source', WEIGHT: 0.6, // Adjust to prioritize results BASE_URLS: ['https://your-website.com'] // Base URLs of indexed sites (to exclude from Google) }, // ... other configs for Wikipedia, Vikidia, etc. };
-
Host the files on a web server: This project consists of static files and can be hosted on any web server.
For local development: You can use a simple local server.
# With Python 3 python -m http.server 8000 # Or use the "Live Server" extension in VS Code
Then, open
http://localhost:8000in your browser.For production: Deploy the files on any static web host (e.g., Synology Web Station, Caddy, Apache, Nginx, AWS, GitHub Pages, etc.).
- Go to Google Custom Search Engine
- Create a new search engine
- Add your approved sites in "Sites to search"
- Enable image search in settings
- Get your CSE ID (format:
xxx:yyyyy) - Get a Google API key from Google Cloud Console
- Paste credentials in
config.js
๐ Security Tip: Restrict your Google API key to prevent unauthorized use. In your Google Cloud Console, under "Credentials", edit your API key and set "Application restrictions" to "HTTP referrers (web sites)". Add the URL where you host the project (e.g., your-domain.com/*).
๐ก Pro Tip: For a much richer image search experience, add commons.wikimedia.org to your list of "Sites to search". Wikimedia Commons is the media library for Wikipedia and contains millions of high-quality educational images that are well-indexed by Google.
search-for-kids/
โโโ index.html # Homepage with recommended sites
โโโ results.html # Results page with web/images tabs
โโโ style.css # Main stylesheet
โโโ search.js # Main search engine with cache and quota
โโโ loader.js # Dynamically loads config.js
โโโ i18n.js # Internationalization script
โโโ knowledge-panels.js # Vikidia knowledge panels
โโโ suggestions.json # Autocomplete suggestions database
โโโ config.js # Configuration (not committed)
โโโ config.example.js # Configuration example
โโโ logo.png # Search engine logo
โโโ favicon.png # Site icon
โโโ README.md # This file
โโโ README-fr.md # French README
โโโ LICENSE # MIT License
- Persistent cache: Results are cached in localStorage for 7 days
- Smart limits: Maximum 300 cached queries for optimal performance
- Auto-cleanup: Automatic removal of expired entries
- Daily monitoring: Track API usage with 90 requests/day limit
- Visual indicator: Real-time display of remaining quota and cache status
- Protection: Prevents accidental exceeding of Google limits
- Educational source: Integration with Vikidia, Wikipedia, and Wikimedia Commons for child-appropriate information
- Smart search: Tries multiple variants of a query
- Relevant filtering: Only displays for appropriate educational queries
- French prioritization: Automatic detection of French queries
- Better results: Apply
lang_frfilter for more relevant results
- You can add your own Meilisearch instance to include custom results in your search engine.
- To populate your instance, you can use the companion project MeilisearchCrawler, a web crawler designed to index content for Meilisearch.
Edit suggestions.json to add your own search terms:
{
"suggestions": [
"new term",
"another suggestion",
"dinosaurs",
"solar system"
]
}In index.html, .recommended-sites section, add your own educational sites with icons.
Customize knowledge panels in config.js:
ENABLED: Enable/disable the featureEXTRACT_LENGTH: Extract length (default: 300 characters)DISABLE_THUMBNAILS: Disable images if needed
- Frontend: HTML5, CSS3, JavaScript (ES6+)
- APIs: Google Custom Search Engine API, MediaWiki API (Vikidia, Wikipedia)
- Storage: localStorage for cache and quota management
- Design: CSS Grid/Flexbox, responsive design
- Features: Autocomplete, image modal, pagination, sorting
- All results are filtered by Google CSE
- Only pre-approved sites appear
- No personal data collection
- Local cache only (no third-party servers)
- XSS Protection: Result content is sanitized with DOMPurify to block malicious code.
- Child-dedicated interface
- Verified educational sources (Vikidia, Wikipedia)
- Type your search in the search bar
- Use autocomplete with โโ arrows and Enter
- Click ๐ or press Enter
- Perform a search
- Click on the "Images" tab
- Click on an image to enlarge it
- Click "Tools" under the search bar
- Choose "Sort by date" for recent results
- Or keep "Relevance" for best results
For a seamless experience, you can set KidSearch as the default search engine in Chrome, Edge, or any Chromium-based browser.
-
Go to your browser's Settings.
-
Find the Search engine section.
-
Click on Manage search engines and site search.
-
Next to "Site search," click Add.
-
Fill in the fields as follows:
- Search engine:
KidSearch - Shortcut:
kid(or your preferred shortcut) - URL with %s in place of query:
https://YOUR_URL/results.html?q=%sReplace
https://YOUR_URLwith the address where you host the project (e.g.,http://localhost:8000for local use, or your server's address).
- Search engine:
-
Click Add.
-
Find
KidSearchin the list, click the three dots (โฎ) next to it, and select Make default.
Now, all searches from the address bar will use KidSearch!
- Fork the project
- Create a branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -m '''Add new feature''') - Push to branch (
git push origin feature/new-feature) - Open a Pull Request
- No results: Check your Google CSE configuration and API key
- Quota exceeded: Wait until tomorrow or check quota indicator
- Images not loading: Check that image search is enabled in Google CSE
- Missing panels: Check that
KNOWLEDGE_PANEL_CONFIG.ENABLEDistrue
- Cache automatically clears after 7 days
- To manually clear: open console and type
localStorage.clear() - Quota indicator appears at bottom right of results page
This project is licensed under the MIT License. See the LICENSE file for more details.
Created with โค๏ธ for children's education
