Custom Search Engines using the Mojeek API and Mojeek Focus
The web is vast and replete with both incredibly useful information and spam. Search engines help you discover and navigate across its huge surface. Sometimes you know where you want to get something from and you just search on that site, even if you may use a search engine to navigate there.
In between these two extremes of discovery and navigation, there are occasions when you want to explore a particular niche, topic, sector, or theme and so on. These themes might be very well covered across a small set of multiple sites, when compared with the vast number of sites on the web. When doing these narrower searches across the web, the big search engines and their search proxies are working against you, since they give you little agency over what is searched.
This is where Mojeek can give you back that agency, by allowing you to search across a set of sites using Focus, either on mojeek.com or via the API. Here we will show you three examples which illustrate the variety of things that can be done with these powerful features:
- Search across several online encyclopedias
- Search across US State government websites
- Search websites, blogs and advice on digital accessibility (A11y)
Encyclopedias
Wikipedia is a goldmine of information and a marvel of what the human collective can build. What it provides in depth is recognised. But what is often forgotten is that it’s has become the “gospel” of information. Since just one page is allowed on each topic, some argue the content of each page represents an amalgm of the consensus view, and that’s good. Others will point out that dissenting voices are thus suppressed.
So what if we always searched across multiple online encyclopedias? Below is how we did that in Mojeek Focus; on the left is the Focus dashboard set-up with 11 encyclopedias, and on the right are the results for a query.
If you want to use this Mojeek Focus, you can use the Restore function on your Focus dashboard and paste this:
N.B. double click to highlight one word and then click once more to select all content within the scroll box.
With Focus we have limited these searches to be across 25 sites so that it can be used without JavaScript. But with the API we recently made some major upgrades so you can now do searches across up to 100 sites.
US States
Suppose you wanted to find out information across the 50 USA state websites. You may think this can be done by searching across all .gov websites, using the site:gov operator in the Mojeek search box. But in this case your results are likely to be dominated by federal .gov websites. Also there is one state, Florida, which uses myflorida.com, not florida.gov.
So here we take advantage of the higher limit in the API and can easily search across all 50 domains for the states. We can do this with the site include parameter &fi, as shown in the API documentation, executed like this:
Below is part of the JSON response for a search made to the Mojeek API, using the domain list above:
Accessibility
For another example of how you can use the API, we created a showcase search engine for digital accessibility, aka A11y. With the help of Joe Devon, the co-founder of GAAD (Global Accessibility Awareness Day) and Tim Dixon we put together a set of 56 sites covering projects, companies, bloggers and advocates who write about the topic. To see the list of sites we used, and even to suggest what we might add, you can use or contribute on the Focus templates Github repo.
JSON output for an example search is shown below, this time showing the details available in the head section which shows output relating to the query and keyword matches. Full details of the JSON response format can be seen in the API documentation.
Search Engine Lists
With Mojeek Focus and/or using the Web Search API you can use and build any number of bespoke search engines. The three above are examples, and if you wanted more inspiration you can see other examples of search engines created by ourselves and the Mojeek community on the Github Focus templates repo. Your ideas and contributions are most welcome there or by getting in touch.